1 頁 (共 1 頁)

測量電壓

發表於 : 2013-04-04 18:50:38
yehlu
http://www.geek-workshop.com/forum.php? ... d&tid=1041

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
http://en.wikipedia.org/wiki/Voltage_divider