I have a home automation project and am looking to use multiple current sensors (ACS712) for multiple appliances. I just need to know whether current is present or not instead of the current value. Is it possible, that I connect the ACS712 sensor to the digital input of Arduino, and get HIGH or LOW via digitalRead()
function. If not, please suggest an alternative to detect ac current is present or not with digital input i.e. HIGH or LOW that can be read via the digitalRead()
function.
Sign up
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
|
|||||||||||||||||
closed as off-topic by Chris Stratton, Nick Gammon♦ Jan 29 at 5:54
|
|||||||||||||||||
|
Considering an ATMEGA with a 5V VCC we have:
You can connect directly to the Arduino if the output of your sensor is higher than 2.5 volts whether current is present or below 1.5 volts if not. This would translate to HIGH or LOW output from You need to recalculate this values for the 3 volt version of Arduino, probably in this case is better the comparator solution to ensure up to 3 volts max logic level. Example circuit as follow, just need to set voltage divider to desired threshold (note this is for 5v case), |
|||||
|
Use a comparator for an adjustable threshold and feed the output into the arduino digital pin. |
|||||||||||||
|
It seems like you could do this with a transistor (if "faking" a digital signal from the ACS712 doesn't work). A simple circuit where the VIOUT of the ACS712 drives the base of a switching transistor connected to a digital pin on the Arduino with an internal pull up might do the trick (assuming that the ACS712 give you a voltage on VIOUT that is proportional to the current). |
|||
|
The Arduino/AVR (for instance ATmega328p, chap. 22) has an analog comparator (D6/AIN0, D7/AIN1 or any analog pin). This could be used with the correct reference voltage. Cheers! |
|||
|