Program for reading data from one (or two) ACS712 (current sense amplifier). Read the configuration before trying it.

Dependencies:   mbed

This program aims at implementing a simple current reader which, sensing from an ACS712, prints on the USB port the average of n samples.

The program can be configured at compile-time by setting few defines:

  • the number of channels: either only p20 or the sum of p19 and p20;
  • the number of samples to read before printing their average
  • the operating mode:
    • PIN_TRIGGERED: read a handful of samples when the pin p9 rises
    • USER_TRIGGERED: start reading when the user presses the character 's'
    • ENDLESS_READ: read continuosly

First of all, when the program starts, it read a bunch of samples and then sets their mean value as reference. This means that the software assumes that when such a reference value is read, there is no current absorption.

Committer:
mariob
Date:
Tue Mar 12 12:20:25 2013 +0000
Revision:
0:36d465acb1a2
MB

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mariob 0:36d465acb1a2 1 http://mbed.org/users/mbed_official/code/mbed/builds/0954ebd79f59