Smart Meter P1 5v power limit

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
romix
Normal user
Posts: 16
Joined: 30 Dec 2015, 17:52

Smart Meter P1 5v power limit

#1 Post by romix » 20 Dec 2016, 17:56

I am working on getting the EPS8266 based P1-wifi gateway (see romix.macuser.nl to draw its power from the Smart meter, rather than from a separate micro usb power adapter.

The DSMR 4.2 specifications rate the 5v power supply (pins 1/6 of the P1 port) at 100mA. The ESP8266 most of the time draws between 70 and 80 mA. However, during startup there are noticeable spikes above 100mA (even my multi meter shows them) and occasionally (during transmit) it also spikes above 100 mA.

A 4400 uF capacitor can be used to take care of the transmission spikes, but won't keep the power up below 100mA.
Sending a P1 datagram to Domoticz takes about 6 mSec, not an awful lot of time. The 4400 uF capacitor should be able to provide a sufficient buffer.

Does anyone have an idea how to keep the ESP8266 (Wemos D1 mini board in my case) within specs?

Alternatively, does anyone have more information about the P1 power supply in the Smartmeter (Kaifa, for instance). Is it really limited at 100mA, or can it deliver more? Is it fused? If so, will the fuse be permanently blown, or will it reset?

Ronald

antst
New user
Posts: 7
Joined: 22 Dec 2016, 18:25

Re: Smart Meter P1 5v power limit

#2 Post by antst » 22 Dec 2016, 18:36

Right now, I face exactly the same question.
Standard specification says:
http://files.domoticaforum.eu/uploads/S ... l%20P1.pdf
"The power supply will supply a maximum current of 100 mA at 5 Volt. Overload protection shall be implemented as a current limiting mechanism."

But you never know did they follow specs or not :)

In reality, problem is a bit less dramatic, As ESP8266 uses 3.3V. And assuming that voltage convertor has efficiency of 100%, 100mA on 5V gives us 150mA on 3.3V.
I'd expect that in reality, with reasonable converter. one can rely on 130mA, which should fit 802.11N mode of ESP8266. But this is on the edge!
So, I guess it is matter of trying. :)

antst
New user
Posts: 7
Joined: 22 Dec 2016, 18:25

Re: Smart Meter P1 5v power limit

#3 Post by antst » 29 Dec 2016, 01:49

OK, I finished my code which send P1 readings to MQTT. So far it looks like (with my so so voltage regulator) maximal consumption is 150mA. I report every 30 seconds, so I have 30 seconds cycle: 40mA for 27 seconds then 150mA for 3 seconds. (I put radio to sleep when not used).

Tomorrow will try to hook it into my E350 and see, will it work or not.

In theory, it is possible to compensate those peaks with very large capacitor, but this is extra pain, as then I have to extend circuit with current limiter (which itself will also draw some current!)

antst
New user
Posts: 7
Joined: 22 Dec 2016, 18:25

Re: Smart Meter P1 5v power limit

#4 Post by antst » 30 Dec 2016, 10:31

And....it didn't work :) Not enough of juice :(

PietjeNL
New user
Posts: 1
Joined: 05 Jan 2017, 15:30

Re: Smart Meter P1 5v power limit

#5 Post by PietjeNL » 05 Jan 2017, 15:41

Capacitor possible works.
maybe would be possible to load a small lipo, like the usb lipo chargers with max 100mA.

romix
Normal user
Posts: 16
Joined: 30 Dec 2015, 17:52

Re: Smart Meter P1 5v power limit

#6 Post by romix » 06 Jan 2017, 14:52

I know a bit more about the P1 port (consulted people involved in drawing up the standard). If more than 110mA is drawn from the port, it will limit current output to 50mA until the connected device draws less than 100mA. This sounds like an FPF2000 like load switch is adopted in the meter.

I have experimented a bit with an FPF 2000 on my end, combined with a large cap (up to 4700µF 16V). When fed with 5v, the voltage drops to about 3.1V at the 5V terminal at my Wemos D1 mini, the 3v3 regulator outputs the same (slightly above 3V). This seems to be insufficient for the circuit to work properly. The blue ESP led does flash once during startup, but I can't connect to it through wifi, nor does the led flasher I included in main loop give any sign of life. In other words, I'm pretty sure the module does not work at 3v. Spikes on my (simple) scope are mostly gone with tha 4700µF capacitor. If removed, the image is quite lively and the blue led flashes every few seconds (signalling restarts).

What puzzles me is the large voltage drop over the FPF 2000. Unloaded the drop is almost .7 V already.

Several options.
1. Given the load switch in the P1 port, incorporating a load switch at the consumer end (our little ESP gizmo's), might be redundant and actually doing more harm than good. Giving it a try with just a large Cap to buffer the spikes might still do the trick. I am fairly hesitant to give it a try though.

2. incorporating a proper load switch/buffer might require more than just the FPFP2000 and some caps. There is an interesting Fairchild application note (AN-8019, entitled Reliable USB Modem design using the combination of an integrated load switch and a buck converter) that discusses a problem similar to ours: how to handle 2A peak currents in GSM/GPRS setups. The buck converter handles the voltage drops caused by the load switch's actions. The scheme is not useful as is for our problem because it outputs 3.6V and is based on different characteristics of both input and peak load.

One drawback of the fpf based solutions is that these chips are really tiny (5 pin space saving sc-70 package. Well space saving indeed, but a bit of a nuisance to solder).

BTW @antst. I don't think it makes sense to switch off the radio in between samples: starting up the radio and connecting are the main cause of the power spikes. You will get more, rather than less issues with toggling the radio off/on.

antst
New user
Posts: 7
Joined: 22 Dec 2016, 18:25

Re: Smart Meter P1 5v power limit

#7 Post by antst » 15 Jan 2017, 15:00

Looks like I will end up with different approach.
HW: Arduino Pro Mini 3.3 + RFM69 radio, this should draw less than 100mA

And separately I will have (as I need it anyway for other things) RFM69-ESP8266 MQTT gateway (rfm69gw). You can find software here : https://bitbucket.org/xoseperez/rfm69gw

RFM69Manager (from the same guy as rfm69gw) is quite nice library to push things through RF69 radios, with metric names etc.
And RFM69gw uses the same library for receiving.

If someone is interested, I will publish code.

antst
New user
Posts: 7
Joined: 22 Dec 2016, 18:25

Re: Smart Meter P1 5v power limit

#8 Post by antst » 15 Jan 2017, 15:05

I tried both, keeping radio on and switching.

In any case peak value is above 100mA. Formally, when you sleep between sends, then integral power consumption fits the limits, but it is quite large peak to compensate with reasonable schematics.

Caps don't help. I tried. Simple math says that cap which is large enough to compensate must be quite huge. And, then there is an issue of adding current limiter when charging the cap. In any case, I decided that ESP doesn't fit for this application by power requirements and anything which will make it better, will overcomplicate it.

So I will use simple 868MHz radio, which will send metrics to my 868Mhz-WiFI/MQTT bridge.

antst
New user
Posts: 7
Joined: 22 Dec 2016, 18:25

Re: Smart Meter P1 5v power limit

#9 Post by antst » 16 Jan 2017, 12:27

OK, now reader is Arduino Pro Mini + RFM69CW@868MHz . Current is about 25mA and perfectly OK for P1.
And, as side result, I have now excellent stand-alone MQTT gateway for low-power 868MHz devices :)

antst
New user
Posts: 7
Joined: 22 Dec 2016, 18:25

Re: Smart Meter P1 5v power limit

#10 Post by antst » 22 Jan 2017, 22:36

If somebody will want to follow my way and use low-power radio like RFM12B, RFM69, CC1101 etc, keep in mind, there are two options:

1) use 16MHz arduino. Then your arduino is powered by 5V, but you will need level shifters for radio, as all those radios are 3.3V.

2) You can use 8MHz arduino powered by 3.3V, but then it will have issues with 115200 baud rate (specified by DSMR 4.0) if used with external 8MHz oscillator.
At 8MHz arduino will have effective baud rate bellow 115200 (actually it will be 111111, ask google why!) and it is not good enough. You will need to change bootloader and reconfigure fuses to use internal oscillator and play with OSCCAL register to shit frequency higher , then 111111 will become effectively 115200.

In my case, factory calibrated (i.e. to give 8MHz on internal oscillator) value of OSCCAL was 161, but I had to shift OSCCAL to 181. Then frequency is about 8.3 MHz, and effective baud rate is nearly 115200. And it all works perfectly.

You can change OSCCAL either in setup() or in boot loader. If you do it in bootloader, then make sure your bootloader has proper baud rate settings, which will match higher frequency.

In my case, I used optiboot, added line OSCCAL=181 as first instruction in main() and compiled it as

make BAUD_RATE=55555 AVR_FREQ=8000000L atmega328


then you'll get both perfect
1) flashing code from arduino IDE (which will use 57600 baud)
2) 115200 baud rate for DSMR

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 49 guests