The ACS712 current driver measures current in mA (Milliamps). It is hall effect based and reports the current by sending an analog value to the Builder Base.
The ACS712 driver has three parameters that have to be configured:
This is the pin receiving input from the ACS712, any pin is suitable for this driver.
The Resolution is the minimum change the driver reports before the system gets notified.
For example in in the metric system, if our latest reading was 1000mA and the resolution is set to 200, the builder base is not going to notify the central core unless the value is <800mA or >1200mA.
There are 3 versions of the ACS712. One that measures up to 10A, 20A or 30A. Select yours here. The number can be read on top of the IC.
The wiring of the ACS712 can be found below:
The analog value from the sensor
How to write an App
Navigate to the App Builder and create a new application. You can find the “Current” hardware object under the “Hardware” Tab in the object drop down menu on the left, or you can also use the search bar.
Drag the “Current” Object onto the canvas. We also need a “Text” interface object.
Connect the “Current“ Port to the “In“ Port of the Text Interface Object. We can now see the mA measurement of the sensor in our text field on the dashboard.
How to create a firmware
Navigate to the Firmware Builder and create a new firmware file.
Click the “+ Add Hardware” button which will open a modal window. Scroll down in the list to find the “Sensor” section and select the “Current” hardware option.
Give your device a name, and click “Add Device”
Next, select the “ACS712” driver under the driver dropdown menu, set the Pin, Resolution and ACS Model.
For this example we select:
Resolution (mA): 10
ACS Model: 30A
You may now save your firmware file and upload it to one of your clients.