測量電壓
發表於 : 2013-04-04 18:50:38
http://www.geek-workshop.com/forum.php? ... d&tid=1041
http://captain-slow.dk/2010/10/18/volta ... d-arduino/
http://en.wikipedia.org/wiki/Voltage_divider
http://captain-slow.dk/2010/10/18/volta ... d-arduino/
代碼: 選擇全部
under resistive divider
Vout = Vin*Z1/(Z1+Z2)
so for example if you wanted 0 - 12 volts scaled from 0 - 4.9 volts:
Z1 = 10,000 ohms
Z2 = 6901ohms
12v/1024 = .0117v increments