Electronic – arduino – Trying to read serial communication from smart meter with Arduino

arduinoinvertermeterserialsmart

First my compliments for this wonderful site. I'm hoping to find an answer to my problem. I've checked to find answers, however was not able to find it.

My background is somewhat technical, only with minor electrical knowledge.

My project goal is to read the serial signal which is supplied by the P1 port of a Smart Meter (ISKRA type MT382-D2A52-M2K0agnZ) with an Arduino MEGA 2560 @ 9600 Baud rate.

Many before me have succeeded, however I don't seem to manage.

Before the Arduino can 'read' the signal from the P1 port, the signal requires to be inverted.
(General advice on the internet on this topic: Use 7404 hex inverters and transistors to invert the P1 signal)

I'm currently using the following components and schematic:

  • Arduino Mega 2560
  • NPN transistor 2N2369A
  • 2x 1k resistor

enter image description here

The 2N2369A is doing something, because the serial output of the Arduino with the schematic of above is as follows:

0-0:96.then rubbish
0-0:96.then rubbish
0-0:96.then rubbish

The 0-0:96. part it spits out every 10 seconds looks somewhat like what it should read:

/ISk52ME382-1003
0-0:96.1.1(4B414C37303035313039) 
1-0:1.8.1(00180.912*kWh) 
1-0:1.8.2(00001.416*kWh) 
1-0:2.8.1(00000.000*kWh)
1-0:2.8.2(00000.000*kWh)
0-0:96.14.0(0001)

etc..

When I connect the TX from the P1 (smart meter) directly onto the RX0 port of the Arduino, the following is produced:

(V
eÔR]d�“ZòövRÖå½Vû‹�“£�´ò«}—“IYÙ–ö–ö–V–Ö’’Ö™Ÿ™�™�™—f'ff+9½Rû‹�´dë^Ÿ“••“£(V
eÔR]d�“ZòövRÖå½Vû‹�“£�´ò«}—“IYÙ–ö–ö–V–Ö’’Ö™Ÿ™�™�™—f'ff+9½Rû‹�´dë^Ÿ“••“£(V
eÔR]d�“ZòövRÖå½Vû‹�“£�´ò«}—“IYÙ–ö–ö–V–Ö’’Ö™Ÿ™�™�™—f'ff+9½Rû‹�´dë^Ÿ“••“£¯ÉSë5\²MÔ3¸²-±00´�

which is absolute rubbish. Therefore I think I'm close with the NPN, however I can't make it to the last step.

Is someone willing to advise me what I'm doing wrong?

  • wrong choice NPN? wrong resistors?

In advance my gratitude to anyone willing to help.

Kind regards,

Vernon

!! FOLLOW UP UPDATE!!!

Following up on my question above, I have done a bit more testing.

I have tested a Sketch from internet using AltSoftSerial with Digital pin 48 on the Mega as a software RX solution, however with perfect results:

Result:

*0-0:96.1.1(5A424556303035313739303939343133)

1-0:1.8.1(06558.109*kWh)

1-0:1.8.2(05439.071*kWh)

1-0:2.8.1(00000.002*kWh)

1-0:2.8.2(00000.000*kWh)

0-0:96.14.0(0002)

1-0:1.7.0(0000.80*kW)

1-0:2.7.0(0000.00*kW)

0-0:17.0.0(0999.00*kW)

0-0:96.3.10(1)

0-0:96.13.1()

0-0:96.13.0()

!*

Arduino Sketch used:
http://domoticx.com/p1-poort-slimme-meter-uitlezen-hardware/

Connecting the Smart Meter TX to pin D48 without NPN the output is rubish again:
*+9=V{$46{/#++9=V{

vkZJV%V{

4r+}IYYvvVVV

f'ff+9=R{4dk^4rV+*

I'm very close, however I feel like an idiot not being able to get the normal RX0 serial port to spit out the same data as the AltSoftSerial option.

Anybody ideas?
Many thanks in advance!
Vernon

Best Answer

Looks like you might have your bits/parity set wrong.

Make sure your serial init looks like...

Serial1.begin( 9600, SERIAL_7E1 );

...since these seem to be the settings the meter uses.