This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blink_electricity_monitor [2021/04/05 22:32] admin |
blink_electricity_monitor [2022/01/06 03:08] admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Blink Electricity Monitor ====== | ====== Blink Electricity Monitor ====== | ||
- | **Summary:** Using an [[https://www.arduino.cc/|Ardunio]] to count the number of blinks from the electricity meter in the flat and eventually convert that into live and historical electricity usage graphs. | + | **Summary:** Using an [[https://www.arduino.cc/|Ardunio]] to count the number of blinks from the electricity meter in the flat and eventually convert that into live and historical electricity usage graphs. On the meter I have (a EDMI ES-10B), one blink represents 1/1000th of a [[wp>Kilowatt-hourkWh]]. |
==== The hardware ==== | ==== The hardware ==== | ||
It's a really simple circuit, basically connect the light dependent resitor (LDR) to the 5V pin on the Ardunio, then connect back to GND with a 100k resistor between the LDR and GND. Connect the analog data pin (A0) just after the LDR. | It's a really simple circuit, basically connect the light dependent resitor (LDR) to the 5V pin on the Ardunio, then connect back to GND with a 100k resistor between the LDR and GND. Connect the analog data pin (A0) just after the LDR. | ||
Line 44: | Line 43: | ||
To dump this to a file, on the Linux box (or Raspberry Pi) the Arduino is plugged into, you need to use ''stty'' set the baud rate, then just use cat to read directly from the Ardunio (I also use ''ts'' to prefix each line with a timestamp): | To dump this to a file, on the Linux box (or Raspberry Pi) the Arduino is plugged into, you need to use ''stty'' set the baud rate, then just use cat to read directly from the Ardunio (I also use ''ts'' to prefix each line with a timestamp): | ||
<code bash> | <code bash> | ||
- | stty -F /dev/ttyASM0 9600 | + | stty -F /dev/ttyACM0 9600 |
- | cat /dev/ttyASM0 | ts > /tmp/electric_meter.log | + | cat -s /dev/ttyACM0 | awk NF | ts > electricmeter.log |
</code> | </code> | ||