I am planning to use my BBB to perform some current sensing and was wanting to use the ACS712 chip. The chip operates off of 5V, but the analog inputs of the BBB have a max of 1.8V. How can I wire this up to make sure I don't fry my BBB?

Can I use a voltage divider? If so, how do I calculate the resistor values to get the correct scaling?



Yes you can use a voltage divider. Formula for a voltage divider is:

Vout = Vin * (R2/(R1+R2))

Vin is the voltage that goes in the voltage divider, I assume that it will be 5 volt in your case. Choose a value for R2, like 1000 ohm

1.8V = 5V *(1000 / (R1 + 1000))

1000/(R1 + 1000) = 1.8V/5 = 0.36

2777,78 = R1 + 1000 R1 = 2777,78 - 1000 = 1777,78

A nice value for R1 would be 1,8k ohm. when Vin is 5v, Vout will be like 1.78V, maybe it's wise to choose 2k ohm or 2.2k ohm instead, just to be a bit more safe.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.