Monthly Archives: October 2012

Smartmeter pulse counter (1)

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.

Endesa smartmeterThe 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.

Smart meter pulse reading by the photocell

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).

Pulse after Schmitt trigger

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.

Electronics jewelry

Funny how this has ended up being my first post…

It has recently been our 12th anniversary with my wife and as it always happens you feel like socially impelled to give her a “material” present, although there is no better present than a night out together or a romantic weekend out of the city. But anyway, since it was supposed to be something personal and since I’ve been tinkering with electronics for quite some time now, I though about putting something of my hobby into it.

I knew that the blinking-LEDs kind of things wouldn’t appeal to her very much, so it should be something more manual and less electronics… and it happens that it’s not hard to find that sort of things on the internet. Just google electronics jewelry or search for the same keywords on etsy.com and you will find loads of ideas.

Now, most of those designs are copyrighted so you are not supposed to use them freely. Copyright and intellectual property in jewelry, as in many other fields, is a hot issue but consensus and common sense say that law may only apply, if it does, when someone is taking profit of somebody else’s work. And since that’s not my case I just borrowed two of the designs I liked for a one-time gift for my wife.

IC horse

The first design is an horse/deer-shaped earring made with an IC and a resistor. Initially I thought it was a design by Saltygal because one of the pictures I found was linked to her profile at Etsy, and since she had closed her shop I wrote her and asked her for permission to borrow her design. Finally it turned out it is not so I don’t know who designed it… anyway, even thou it is pretty simple it’s also one of the nicest ones. It involves just electronics components to mimic a horse or a deer or whatever four legged animal you like the most (albeit with eight legs…). I had some trouble gluing both components together. I used some jewelry-glue I bought but it took ages for it to dry so I had to use the third hand I use to hold still the PCBs while soldering and I just left both pieces there for 24 hours before daring to touch them again. If there is a next time I will give epoxy a chance…

5-coil flower pendant

The second one is a flower pendant using 5 axial coils. I think I also took the idea from Etsy but I have not been able to find the product now that I’m writing this post so I don’t know whose design it is either. It is also quite simple and it involves some soldering. The tricky part here is trying to find some good-looking inductors… and although I’m happy with the final result I know I could do better.

By the way… my wife liked them a lot. She wore them to a party just the night after I gave her the present and I think she enjoyed being the geekiest girl in the party…