Trying to drive a flight simulator slipball assembly with Arduino

Hi all,

First post here, however I have been browsing and absorbing as much as possibly while looking for a possible solution to my problem.

So here it is:

I have a +10v to -10V input signal to the simulated slipball instrumentation, all on one wire. I have been designing a custom pcb to go with the arduino, and a voltage divider on that board will lower the voltage to +5v/-5v.

I know that the arduino does not like negative inputs, but I don't know how I could possibly separate the input so that when the input is positive (0.01v to 5v) it will go to one analog input pin, and when the input is negative (-0.01v to -5v) it will go through a circuit to convert to a positive voltage, and then go into a second analog input pin.

Anyone have a clue how I could pull this off?

Wouldn't it be simpler to design your circuit to convert +/-10V to +/-2.5V and level shift it so it reads 0 to 5V? One rail to rail op amp and right selection of resistors should do it. Then you only need one analogue pin.

Steve

slipstick:
Wouldn't it be simpler to design your circuit to convert +/-10V to +/-2.5V and level shift it so it reads 0 to 5V? One rail to rail op amp and right selection of resistors should do it. Then you only need one analogue pin.

Steve

That could work. I apologize for not getting back to you sooner. I was off for the weekend, and just now got back to work where I could start looking at this.

I also asked on EE stack exchange, trying to come up with as many possible viewpoints as I could. What you are saying seems like the most logical choice, although they are also recommending to ditch the multi input method as well. Do you have a suggestion for a good reliable op amp to run this circuit?

Up you don't need an op-amp because you are reducing the signal, only resistors and a possible coupling capacitor are needed.

Capacitor? I think it's basically a DC signal. Certainly not more than 1Hz. I think that takes a little more circuitry.

I did say possible, given the vagueness of the question you might need to AC couple it to get the grounds right.

Grumpy_Mike:
I did say possible, given the vagueness of the question you might need to AC couple it to get the grounds right.

This is a dc signal, I apologize. I have gotten everything wired as needed, now is just to figure out the programming.

I suppose it shouldn't be too difficult to set up the Input as a variable "VAL" and map that variable to the movement of the servo right?

I currently have the Arduino nano receiving the input via a voltage divider board, into A0. I have the servo connected to an adafruit PWM controller board, and want to map it so that the pulselength is equal to the angle of movement, so that when the analog value is X, the angle will change.

I have my analog values mapped, -10V became 0, +10V became 818. Is there an easy way to map the input so that the servo will drive to a specific degree?

Is there an easy way to map the input so that the servo will drive to a specific degree?

Yes it is called the map function oddly enough.