Posts: 1
Joined: Tue Jun 26, 2012 8:10 am

Power meter s0 interface <-> GPIO

Tue Jun 26, 2012 9:32 am


I've just have done RS232 interfaces in my previous carrear, but now I want to go a step further.

Is it possible to connect the GPIO ports of the RaspberryPi with one/multiple s0 interfaces of a power/electricity meter? I want to build a datalogger of the power consumption of our house, but I'm absolutly not familiar with s0 interfaces.

Thank you for your help.
Best regards,

User avatar
Grumpy Mike
Posts: 873
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
Contact: Website

Re: Power meter s0 interface <-> GPIO

Thu Jun 28, 2012 11:03 pm

Yes it is very easy to do this. Basically the S0 interface is really only an open collector switch that switches a number of times pr kwh (mine is 1000 times pr kwh). This will enable both logging of overall use and instantaneous power usage (by measuring the time between pulses).

So all you need to do is to connect it to one of the Pi's GPIO pins and add a pull up resistor to 3V3. If you use GPIO 0 or 1 this already has a pull up resistor fitted. You also need to connect the ground of your meter to the ground of the Pi.

Then you need software to measure the time between pulses. This is where it might get tricky because Linux steals time from any running code making accurate timing difficult. However there are various ways round this problem.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 9 guests