brewdexta
The biggest tool in the box
- Messages
- 5,620
- Location
- UK
I made a start on the electricity monitor. First attach the LED pulse sensor to the meter. You can see it just below the meter's LCD screen. The pulse meter connects to a BAE0910 one-wire slave chip which is in the box bottom right. The switch on the right is the changeover switch for the gennie.
The slave chip is wired back to a one-wire bus on a raspberry pi that I have under the stairs, I'm using CAT5 cable as I have loads of external grade. Its called one-wire as there is only one data line, but there's +5v and 0v so its actually 3 wires
For once, something worked first time.
The one wire address for the slave chip is FC.0000000001D2 so I added it to my alias file and called it "emeter".
Now I can access the counter easily as follows from the command line,
pi@hapi01:~ $ owget /emeter/910/count ; echo
12520
pi@hapi01:~ $ owget /emeter/910/count ; echo
12996
The counter increments each time the LED flashes on the meter, and this flashes for every 1Wh, so 1000 flashes is 1kWh.
Now I know it works I shall get rid of the spiders and tidy up the cabling.
Next step is to poll the counter periodically, say every 5 minutes, and stick it into influxdb, a time series database. Once its in there it is easy to graph it. I shall get the kids to do that.
I'm quite impressed with the chip, it can do lots more.
One to four 16 bit PWM: two hardware (PWM1 & 2) + two software(PWM3 & 4)
One 8 to 10 bit ADC input 0 to 5V
One 32 bit counter
Up to 4 digital outputs (sink up to 20mA)
Up to 3 digital inputs
it also has a real time clock and and "automation engine" where you can write your own procedures as follows.
The BAE chips embed an Automation Engine that allows creating automatic (re)actions directly within the chip.
This is implemented as a virtual CPU that process up to four flow of instruction in parallel.
The AE programs are stored in non volatile chip memory (eeprom) which is remotely programmable under master
control
The slave chip is wired back to a one-wire bus on a raspberry pi that I have under the stairs, I'm using CAT5 cable as I have loads of external grade. Its called one-wire as there is only one data line, but there's +5v and 0v so its actually 3 wires
For once, something worked first time.
The one wire address for the slave chip is FC.0000000001D2 so I added it to my alias file and called it "emeter".
Now I can access the counter easily as follows from the command line,
pi@hapi01:~ $ owget /emeter/910/count ; echo
12520
pi@hapi01:~ $ owget /emeter/910/count ; echo
12996
The counter increments each time the LED flashes on the meter, and this flashes for every 1Wh, so 1000 flashes is 1kWh.
Now I know it works I shall get rid of the spiders and tidy up the cabling.
Next step is to poll the counter periodically, say every 5 minutes, and stick it into influxdb, a time series database. Once its in there it is easy to graph it. I shall get the kids to do that.
I'm quite impressed with the chip, it can do lots more.
One to four 16 bit PWM: two hardware (PWM1 & 2) + two software(PWM3 & 4)
One 8 to 10 bit ADC input 0 to 5V
One 32 bit counter
Up to 4 digital outputs (sink up to 20mA)
Up to 3 digital inputs
it also has a real time clock and and "automation engine" where you can write your own procedures as follows.
The BAE chips embed an Automation Engine that allows creating automatic (re)actions directly within the chip.
This is implemented as a virtual CPU that process up to four flow of instruction in parallel.
The AE programs are stored in non volatile chip memory (eeprom) which is remotely programmable under master
control