The spark abacus is a system to monitor electricity consumption.
A micro-controller collects data from various electricity meters placed at the entry of the 3-phase 4-wire mains electricity distribution installation, and sends it over a local network to a computer storing the values in a database.
The measurements can then be visualized.
More information is available on the [wiki](https://wiki.cuvoodoo.info/doku.php?id=spark_abacus).
4 LEDs have been added to show the current activity:
- power (red): shows if the board is power (the voltage regulator works).
- heart beat (green): shows if the firmware is running correctly. It starts when all the setup of all peripherals is complete (including connecting to the WiFi network) and toggles every second.
- query (yellow): goes on when starting to query the measurement values from all electricity meters, and goes off when it received all values.
- submit (blue): goes on when it start submitting the values to the database (using an HTTP POST on influxDB), and goes off when the submission succeeded.
Note: don't use the onboard LED on PC13 on the blue pill as switching it heavily influences the RTC.
Connections LED (cathode) <-> board (all LED anodes are connected to the +3.3V rail):
The ESP-01 WiFi module (based on the ESP8266 chip) is used to join the local network, connect to an InfluxDB database using HTTP, and store the measurement values gathered from the electricity meters.
Once all measurements from all meters have been collected, the firmware will connected to the InfluxDB database to submit the values using and HTTP POST request.
The hostname, port, database name, user name, and password are hard coded in `main.c`.