Please help me for my first time project using current sensor.
I'm planning to make "auto stop power window" for my old car (rear window) when it goes all the way up. It's just for safety when my kids hit the button to close the window and his hand hold the window down. You know kids imagination.. ::).
I've tested the power window motor that the Ampere will rise constantly when I forced to stop its movement. That way, I was thinking that I can use current sensor to tell arduino when DPin 2 is HIGH become LOW in certain ampere received by Pin A0. So I've made the schema as I attached here. My concept is when the button pressed once, DPin 2 continuously HIGH until Pin A0 gets sense (between 3A - 5A) from current sensor to tell DPin 2 to LOW. That's all.
I really don't know how to create the sketch in arduino. Please help...
In Arduino tutorial, as far as I found, was just to read the current flows to display. What I need is to read the current flows and until reach the certain value of ampere (3A - 5A) then command the output to LOW from HIGH. In this case, the sensor is act as switch to cut off the DC flow (as the diagram on attachment).
As we do not have the current sensor data, we cannot know what the conversion is.
The current sensors usually have Vcc/2 when no current flowing. If for eg the conversion is 100mV per amp, at 5A there would be 0.5v away from the zero reading. Do your ADC read and if the reading is a certain distance from 512, you have the current so turn off the output.
Note that the sensors often read +& - current so make sure you connect the right way for your code.
As we do not have the current sensor data, we cannot know what the conversion is.
The current sensors usually have Vcc/2 when no current flowing. If for eg the conversion is 100mV per amp, at 5A there would be 0.5v away from the zero reading. Do your ADC read and if the reading is a certain distance from 512, you have the current so turn off the output.
I see... I haven't measured the current data of 12V DC motor with arduino, but I've measured it with digital AV test meter came up 1,8A and if there is a heavy load become > 3A.
I haven't got the current sensor module yet, because I'm not sure which one is the most suitable for my project. Any suggestion?
Note that the sensors often read +& - current so make sure you connect the right way for your code.
As I rad the spec of the current sensor generally that the sensor read one of the + or - current flows. That's way I took only red one on my wiring diagram (+) to read.