A few weeks ago I wrote about my new door monitor. It was the first step towards migrating my XBee based wireless sensors network to RFM69 radios using Moteino platform by LowPowerLab. I was truly impressed by the low power consumption so I committed myself to keep on working with them.
Coincidentally Felix Russo, the guy behind LowPowerLab, released the new version of it’s Weather Shield for Moteino. So it was time to update (or completely revamp) my trusty Arduino FIO based weather station… and last week I received a parcel from LowPowerLab with a pair of shields to play with: the new WeatherShield R2 and the PowerShield R3. They are both compatible with the Moteino (off course).
From left to right: PowerShield R3, Moteino and the new WeatherShield R2
Some days ago I posted about the RFM69 to MQTT gateway based on the ESP8266 I am working on. Over these days I’ve been fine tuning the gateway at the same time I was migrating one of my home sensors to Moteino: the Door Monitor. The previous version was based on an XBee radio and has been on duty for almost 3 years and a half. Real life battery time has been around 3 months for a CR2032 coin cell, which is not bad at all, but still…
Aside from using a Moteino and a RFM69 868MHz radio instead of the XBee, I have reduced the components list by moving hardware logic to software logic. This means using sleeping capabilities of both the ATMega328 and the RFM69 and coding in a clever way to reduce awake time.
Endesa has recently updated my home energy meter to meet new UE and Spanish regulations. The new meter it’s a smartmeter by Meters and More and it basically provides the means to perform remote meter readings and supply changes. The goal of the new regulation is to provide better and more accurate information to final customers regarding their energy consumption habits to promote energy efficiency and saving.
The reason I’m writing about this is that the meters has two communication ports on the front side, an I/O optical port with unknown protocol and a simple LED labeled “4000 Imp/KWh”. This means that every 4 pulses you have used 1Wh of energy or the equivalent: 1 pulse/sec its 900W of instantaneous power consumption (2 pulses/sec 1800W, 3 pulses/sec 2700W or 1 pulse every 2 secs 450W and so on).
So I’m planning to set up a simple pulse counter and send the information to my IoT gateway and store it somewhere (cosm.com or my own webapp). The idea is to use a voltage divider with a resistor and a photocell with the output attached to one of the hardware interrupt pins of an Arduino Mini Pro. The resistor should be at least four times bigger than the resistance of the photocell when illuminated by the pulse light so the Arduino would interpret it as a HIGH. Then count the pulses in the interrupt method and either send a message to the server every say 40 pulses (10 Wh) or every minute using a RTC with an alarm triggering the other interrupt pin in the Arduino.
The first critical issue was to be able to accurately count all the pulses. I was sceptical about using software debouncing since the processor will be busy with turning on the radio and sending the data for maybe one second every minute and it won’t be able to debounce incoming pulses in the meantime so I needed clean signals in the interrupt pin.
I did some quick tests with a CdS photocell in a voltage divider configuration with a 47kOhm resistor and the response of the sensor seemed to be good enough to capture the pulse. The photocell resistance easily dropped below 5kOhms and the pulse looked like some 50ms width. But I needed more precise readings.
And here it came the DSO Nano v2 to the rescue. I attached the probes to the voltage divider output and to ground and after some testing trying to find the right parameters in the scope I managed to get a pretty decent image of the output.
The image shows a pulse with 2.96 Vpp (I was using a 3V3 source) and some 50ms width. The pulse has soft rising and falling edges that resemble those from a RC circuit (albeit one very curious RC circuit with a time constant of around 10ms when rising and 20ms when falling).
Good news is that the output seems ripple-free so there is no need for further softening and I can just plug it to a Schmitt trigger to get sharp edges. I used a 74HC14 I had from another (unfinished) project around although the packaging is a little overkill (I’m only using 1 of the 6 gates it has).
The final pulse has sharp edges and is 80ms width. This gives me time to capture up to 12 pulses per second. That would be a instantaneous power consumption of 10.8kW which is almost double I have at home.
So far so good.