i have been working on a new project that involves me to read a specific voltage and the voltage ranges from 12v to 0v
my question is how do i scale it down from 12v to 5v so the Arduino can read it from an analog input pin. If i were to use a voltage divider, what value resistor should i use? or do i just use an available voltage sensor module that i can find on market?
5:7 is the ratio(5V output, 7 V 'waste'). Or, V1 = V2*R1/(R1+R2); V1 =5, V2 = 12; pick an R1, solve for R2.
Either way, if you use 10k for the lower resistor, you need 14k for the upper. (Put the lower resistance to ground, higher resistance to 12V).
Now, 14k is not a standard value, but the trick is, any ratio resulting in 1:1.4 will work.
If you use 15 k, your divider has a little 'headroom'.
By the way, if your 12V source is automotive, be aware that you should assume 13.8V steady state minimum, higher is better (I'd use 15V, and put in some transient protection as well); recalculate with that in mind.
can i know why you say the 7v waste. also i did some google search, i do want to stick with a simple solution but other solution that i found are to use an op-amp.
I already confused with the many option of the op-amp. I am sure there are for more a lot of specific use case scenario.
yup, im trying to read from a something like a wheel that i pull out from an old car. That thing rotates and works with 12V supply. is it possible that i just use 5v and read it directly?
Note that when switching inductive loads, the instantaneous voltage levels may levels may
greatly exceed steady-state levels due to inductive kickback. Chip damage can
occur if you do not take precautions to protect against inductive spikes.
Be careful inserting noisy loads that can cause a sharp current draw, such as DC
motors, since they can cause problems on the power lines and may cause the
INA219 to reset, etc. When using a DC motor or a similar device, be sure to
include a large capacitor to decouple the motor from the power supply.
The above is from the Adafruit data sheet. If "something like a wheel" is a motor or other inductive load. Be sure to read the data sheet entirety and understand what it is telling you. Failure on this can cause your Arduino sales person to sell you another one and another one ...etc.
@gilshultz and @JCA34F, this is what i manage to pull out from the pcb, im still figure out the resistor value and looks like it, it looks like a giant voltage divider with different R1 and R2 making different output voltage
imma try to use the ina219 module. it seems can read voltage up to 25V. when i try using it, i found out that i need to put a 10k resistor to the VIN- pin in order for it to read the voltage
is there any particular explanation of why do i need to put the 10k resistor on the VIN- or it just was supposed to be like that?
Can you provide a link the the particular module you are using.
The bus voltage is measured at VIN- without a resistor.
Maybe your board has shunt resistors on it.