Teleinfo on EmonTH/TX

Hi,

I would like to post on emoncms  some data sent by my electric meter over the "teleinfo" protocol. In France, most of "recent"  meters have this feature. More info here about that protocol.

I found a schematic and a sketch (attached) to get those data on a arduino uno. So I just need to modify this sketch to post the data over RFM12B. It should not be problematic. This sketch use a software serial port to talk with the meter. So it needs a digital input. D8 is used in the schematic with a pull up resistor.

I just need to know which pin may I use on an EmonTH. Same question for an emonTX V3.

For both, if possible, I would like to avoid using a pin also needed for something else (pulse/temperature)

 

Eric

 

EDIT : I saw the port map in the technical wiki but anyway ... I have a lack of knowledge to answer my question

I would like to be be sure to not damage my TH/TX

boelle's picture

Re: Teleinfo on EmonTH/TX

hi

 

i tried to make a minimal sketch just to get you going... its one of the example sketches but shaved to actyally only flash the led 

 

you need to get the data out and put the data in variables....

 

typedef struct {
     int realPower;                                         // RealPower

 

tells it what to transmit.... so right now the sketch will just send 0 or some bogus number since the variable is not set... it will transmit every 10 sec..

 

hope it helps a bit

pb66's picture

Re: Teleinfo on EmonTH/TX

Hi Eric,

Probably stating the obvious when I say the problem of not using a pre-assigned pin is physical access, only the pins assigned to temp or pulse are brought to a connector.

The emonTx v3 however does have a pin accessible next to the existing terminals DIO9 http://wiki.openenergymonitor.org/index.php?title=File:EmonTxV3-io.png or there is DIO10 on the RHS below the ISP conn.

I don't think the emonTH is as easy but DIO10 is not used (DIO9 is LED on TH) and is the 2nd pin from the bottom of the row of 10 connections on the LHS  https://raw.githubusercontent.com/openenergymonitor/Hardware/master/emonTH/photo.jpg so you could attach a small fly lead.

Paul

boelle's picture

Re: Teleinfo on EmonTH/TX

ups... total misunderstood the Q....

 

http://solderpad.com/openenergymon/emonth/

 

shows the schematic... 

 

if not much mistaken dig 5, 6 ,9 are taken, but dig 2 & 3 seems free...

 

 

Eric_AMANN's picture

Re: Teleinfo on EmonTH/TX

Thank's both.

Well, I can't read the schematics of the EmonTH/TX. (Lack of knowledge in electronics)

Let's first discuss about the pins assigned to temp or pulse as there are easily accessible on the terminal block.
Can I use them knowing that I will add a 4.7k pull-up resistor as needed in my schematic ?

For the others pins,

   - Emontx : only the dig 10 seems easily accessible (dig 9 is not  connected)

   - Emonth : no pin is easily accessible ?

 

Eric

boelle's picture

Re: Teleinfo on EmonTH/TX

i only looked at schematics for emonth.... there are more free pins on emontx... or at least they are all accessible

 

http://solderpad.com/openenergymon/emontx/

 

look at P1-4.... follow the green lines that goes to the AVR. Pins 11-13 are free...

 

http://darcy.rsgc.on.ca/ACES/TEI3M/images/BreadboardArduinoIntroPics063.png shows both the names of the pins as atmel defines them in datasheet but also their names in the arduino world...

 

 

boelle's picture

Re: Teleinfo on EmonTH/TX

hmm but yes you can use the temp and pulse also if you dont use them for anything else...

 

so if you say have a emonth near the meter but the DHT sensor is not fitted you can use that... 

 

or you can use the pulse input... 

 

so if your meterbox is not getting direct sunlight and have a white surface i would use the pulse input and fit the DHT sensor so i can log both temp and electricity...

 

and if you are lucky that you own the place i would make sure there is some ventilation to the inside of the meter box 

pb66's picture

Re: Teleinfo on EmonTH/TX

It's unclear about DIO 9 the comment is crossed out in the port map but the track is connected in the schematic and pcb layout. The schematics for the RFu-328 on ciscos site also show DIO9 connected.

If you want a clean pin (no other componants to remove) then DIO10 (or 9) is favorite I guess.

DIO2 (pulse) has a 10K pull-down res, the temp terminals cannot be used on emonTH if an on-board temp sensor fitted.

If you were to use the temp conn on the emonTx v3 there is a 4K7 resistor across the terminals so by setting digitalpin 19 high (just as you would if using a temp sensor) the circuit would be as per your diagram minus the LED and only be 3.3v not 5v.

Care should be taken regards power consumption as there not much headroom for the led but the opto-coupler should be ok, may need to recalc the res value if there's no led and using 3.3v not 5v I don't know how critical it is,

I'm sure Robert will be able to advise you better on this.

Paul

Eric_AMANN's picture

Re: Teleinfo on EmonTH/TX

Thank you Paul for raising the power consumption issue.

This is very important as I would like to use a EmonTH rather than an EmonTx.

Eric

Robert Wall's picture

Re: Teleinfo on EmonTH/TX

I am guessing that there is enough current in the opto-coupler emitter to saturate the detector, so we assume that it will drop around 0.25 V (0.4 V max). The blue LED will have a high forward voltage, so I suggest replacing it with a standard red one, with a forward voltage of about 1.7 V at low current, normally about 2 V. With the supply at the nominal 3.3 V, that leaves about 1 V for the resistor. If the LED current is 5 mA (you can afford 9 mA maximum before the emonTx V3 power supply will malfunction at minimum mains voltage), then the series resistor needs to be 200 Ω. The original circuit runs the LED at about 0.3 mA, if that gives acceptable brightness, the resistor value for that is 3.3 kΩ.

If you are running an emonTH on battery, it would be best to omit the LED and use as high a value resistor as possible -  you should be able to use up to 470 kΩ with no problem.

Eric_AMANN's picture

Re: Teleinfo on EmonTH/TX

Thank's Robert.

I will give a try with that conditions:

   - using an emonTH on battery

   - omitting the led

   - without fitting any on-board temp sensor nor using external temp sensors

 

In that conditions :

   - can I use the DIg2 (pulse) knowing it has a 10K pull-down resistor ?

   - can I use the Dig19 (1-Wire Data) ?

Eric

 

Eric

Robert Wall's picture

Re: Teleinfo on EmonTH/TX

I think D2 is the best solution.

Although D2 has R2 (10 kΩ) shown as a pull-down to GND, that resistor is not present unless you are using the DS18B20. (It is a wire-ended through-hole component under the battery case, at the corner nearest to the aerial.)

Therefore, you can use the terminal block for all the connections. Connect your pull-up resistor between 4 (D2) & 2 (3.3 V) and the wires to your opto-coupler between 4 & 3 (GND)

Eric_AMANN's picture

Re: Teleinfo on EmonTH/TX

Ok great !

I will try as soon as I receive the needed components.

If it works, I will share my sketch.

Bye

Charly86's picture

Re: Teleinfo on EmonTH/TX

Eric,

I don't know how is your setup, but just in case, If you have any linux device (Pi, Wifi-Fi Router, ...) near your Teleinfo output you can try the teleinfo broadcast that send all teleinfo data to your local network and/or to emoncms also.

 

 

 

Eric_AMANN's picture

Re: Teleinfo on EmonTH/TX

Hi Charly,

Thank's for this information but I would rather use an EmonTH rather than an Linux machine to capture the teleinfo input. (The meter is out of my home).

I made some tests and it works great as I manage to print the teleinfo packets to the serial monitor.

Now, I need to write a sketch to send the data to my EmonBase.

Eric

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.