I have an analog signal ranging from -10V to 0V that functions as an enable signal. When the voltage is -10V, the enable signal is active, and when it is 0V, the enable signal is inactive. I need to convert this signal to a 0V to 5V range so that I can input it into my Arduino Mega. Are there any ICs or level shifters available that can perform this conversion? What is the best way to go about doing this?
The simplest way is probably using a MAX232 or similar. One chip with a couple of capacitors. There are also versions that have the caps built in, but the max232 is cheap and easy to find.
What is the output impedance (drive strength) of that circuit.
If low enough, then try a voltage divider to VCC (not to ground).
10k between input and the analogue pin, 10k between pin and 5volt.
Leo..
You have two accounts. Remove one.
@pel_engineer
@anon7492343
how do i delete one of them?
Click the flag in the post with the account you do not want. Write a note to the admin to remove the account and retain your preferred account.
I tried an inverting amplifier first to go from -10V to plus 10V followed by a voltage divider and a voltage follower/buffer but, I am getting errors when I simulate saying that it is not a number (NaN). I am attaching the picture here.
I just deleted the account
I was actually able to make it work. I used a voltage divider to bring the signal down from -10V to -5V and then used a voltage follower/buffer after that. Finally, I inverted the signal back to +5V using an inverting op-amp. Thank you everyone.
The deleted post had a solution with just two 10k resistors.
One between input and Arduino pin, one between pin and VCC (5volt).
Leo..
I did not see the post or delete it. Can you please share the image of how the solution looked like?
They seem to have been merged now.
Post#3.
Leo..
I see. Can you share an image please? I am not able to visualize the circuit.
As already suggeste: two equal resistors ( 10K each for example ) and you are done, no need for any active component.
That seems much more complex than needed for an "enable" signal.
If all you need is "enabled" (-10V) and "not enabled" (0V), how about an optoisolator between GND and your signal?
@westfw, thank you for your inputs. I tried your suggestion but, I don't see +5V at the collector pin of the optocoupler. I couldn't find 4N33 but, 4N35 is similar.
An opto coupler is digital.
KISS (the abbreviation).
Use two resistors.
Leo..
@Wawa, I followed your suggestion however, I am getting -2.5V at the output when input is -10V. I need to invert the signal to +5V. Also, when the input is 0V, my output is 2.5V.
Sorry, thinking error. Resistor ratio must be 1:2.
Try 22k for R1 and 10k for R2.
That will give 0.3125 volt at -10volt input, and 3.4375 volt at 0volt input.
Enough range for both analogue and digital levels.
If this is a pure digital signal, then the opto solution might be better.
Leo..