According to the datasheet of the current sensor of ACS721, it can be used in AC or DC circuit and even connected with 230Vac directly. Moreover, the reasons for choosing this component are the size of it is small enough and it can communicate with Arduino through Serial Port.
Referring to the picture above, the pin 1 and pin 2 should be shorted together and connected to the positive pole of the AC circuit. The pin 3 and pin 4 should be shorted and connected to the negative pole. The pin 8 is Vcc, which connected to the 5Vdc power supply. And the filter connects with one capacitor then connects to ground. After finished the circuit by following the picture above, the pin 7 (Vout) can connect with anyone of the analog input of the Arduino, as which is analog signal output, referring the Pin Mapping of Arduino below.
After finished the connection, the Arduino UNO and the Current sensor will look like the picture below.
For convenience, the breakout boards of current sensor can be used also. As the connection is easier.
There is the progress code for trying to understand the communication between Arduino UNO and this Current sensor, referring the steps below.
1. It is just to see what value will Arduino UNO received through the Serial Monitor when there is no current pass through. Referring the picture, the raw value appeared in the serial monitor is around 512, 513, and 514.
1. It is just to see what value will Arduino UNO received through the Serial Monitor when there is no current pass through. Referring the picture, the raw value appeared in the serial monitor is around 512, 513, and 514.
2. After opened the power supply with AC current (which means got current pass through the current sensor), the raw value is changed abound 5 higher or lower than 513 alternately.
No comments:
Post a Comment