0
\$\begingroup\$

I have a circuit like this that has a 12vDC power supply. I would like to measure the voltage on either side of each of the lights with the arduino's analog input pins, but the arduino's max voltage is 5v.

How would I keep the voltage at least proportional to its value while making it less than 5v?

Normally to read voltage from the arduino, I would get the value, which is a number in between 0 and 1023, then multiply it by 5/1023 to give me a voltage between 0 and 5 volts. Could I just stick a resistor between the point on the circuit and the arduino, then multiply the value from the input by 12/1023?

asked Jan 13, 2017 at 18:14
\$\endgroup\$
2
  • \$\begingroup\$ This site has a built in schematic tool (Crtl-M). For future reference. =-D \$\endgroup\$ Commented Jan 13, 2017 at 18:26
  • \$\begingroup\$ Ok thanks, new to the electronics site. I'm usually more of a software guy. \$\endgroup\$ Commented Jan 13, 2017 at 20:39

1 Answer 1

4
\$\begingroup\$

I would like to measure the voltage on either side of each of the lights with the arduino's analog input pins, but the arduino's max voltage is 5v.

To linearly reduce a higher voltage to a lower voltage requires a resistor potential divider like this: -

enter image description here

So if the bottom resistor is (say) 5 kohms and the top resistor is (say) 7 kohms then 12 volts in becomes 5 volts out but, you might want to give a little headroom so that 15 volts in becomes 5 volts out. so use a 5 kohm for Rbottom and a 10 kohm for Rtop.

I would also be tempted to put 100 nF across the lower resistor so that the ADC sampling operates accurately.

answered Jan 13, 2017 at 18:23
\$\endgroup\$
3
  • \$\begingroup\$ But the each light needs the full 12 volts, will this keep the voltage the same for the lights? \$\endgroup\$ Commented Jan 13, 2017 at 20:38
  • \$\begingroup\$ The resistors will not affect the lights I.e. the resistors will not steal significant energy. \$\endgroup\$ Commented Jan 13, 2017 at 21:10
  • \$\begingroup\$ LOL this was for a science fair project and I just realized that I don't need that value. Thanks anyway for future reference though. \$\endgroup\$ Commented Jan 13, 2017 at 21:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.