There is a difference on what you're thinking, because when you have 12v. signal, arduino input receives 0v., and when 12v. becomes 0v., arduino input is 5v.. It's just a question on Arduino logic, but you can change the software to sense 0v (instead of 5v.), or change the circuit. But the original circuit is better, because of Atmega internal configuration.
Yes, the links are for a digital solution. For analog input you can use a resistor divider. You want to divide the input voltage by approx 1/3 to ensure that a 12v input will not exceed 5v on the arduino. There is a java voltage divider calculator here http://ourworld.compuserve.com/homepages/Bill_Bowden/r2.htm
but values of 10k for R1 and 4.7k for R2 will be approximately correct. You can use a 10k trim pot for R1 if you want to adjust for an exact value.
Well, honestly I'm not sure how the signal is comign down. I'm trying to translate the steering wheel controls in my new car into something that my computer can understand.
It's the GMLAN protocol. I was planning on experimenting when I got that far.
Having a similar situation where I want to interface with a 12V sensor. I got as far as the voltage divider and that is all good, but I would also like to be able to write back to the original instrumentation a 0-12V analog signal. I could keep the sensor connected to the instrumentation in parallel, however I want to also be able to send my own signals so I can use the gauge to view logs
I am fairly new to electronics, so perhaps I am using the wrong terminology in my searches because I am finding it very difficult to find a simple electronic circuit that will let me basically to the reverse of a voltage divider.
Can someone help with this? I would have thought it a fairly common requirement..
Any help or pointers in the correct direction are much appreciated
It would be better to start a new thread with a new question, but what you are looking for is a non-inverting amplifier with a gain of 2.4 like this opamp circuit:
Thanks for your advice, will definitely try it that way.
I was also thinking that it might be possible to use an opto-coupler connected to an analog pin and switching the 12V reference... seeing as the analog output is PWM, wouldn't this also cause PWM of the 12V?
Regards,
Kenny
Hi Kenny,
It would be better to start a new thread with a new question, but what you are looking for is a non-inverting amplifier with a gain of 2.4 like this opamp circuit:
.
.
.
Regards,
David