2011-01-06

NGE101 - Norgo wireless energy meter (part 2)

I want to capture the data from the NGE101 power meter transmitter so that I can later analyze the data, or maybe even send it to Google Powermeter. But first I need to find out how the data is transmitted and encoded.

According to the manual the NGE101 is transmitting the data on 433 MHz, so I dug out an old wireless weather station receiver that I had lost the transmitter for.

Old weather station with 433 MHz receiver.
Even though the weather station was powered by 3V (2 AA batteries) I did not see any components on the receiver PCB that should not be able to handle the 5V from the arduino uno. Its impossible to see in the picture, but the IC on the PCB is a LMV358 op-amp, and its rated for 2.7-5.5V.

The receiver only has three pins, and they are labeled V,R and G. V and G are used for Vcc and Gnd, so by elimination, the R pin must carry the received signal.

When hooking up the receiver to the arduino, I just got a lot of random static, but with some occasional faint hints of something that sounded like bursts of old-school modem noise.

Arduino and the 433 MHz receiver.
Fearing that I might have killed the receiver, I quickly cut the power, and then did what I should have done first; I connected the receiver to the 3.3V pin on the arduino.
Unfortunately the output voltage from the receiver was not high enough for the arduino to detect it, but that was easily fixed by using a 4050 buffer to pull the signal up a bit.

This worked beautifully, I started to get some nice clear data from the arduino. I'm not sure why I got so much noise when it was connected to 5V, maybe there is a lot of digital noise on the 5V power line, maybe its simply not meant to run of that high a voltage.

I wrote a small arduino sketch to capture the signal and output the data as a .au sample. Here is one of the captured data frames:


And here is the source code:

uint32_t nextsampleat = 0;

void setup()
{
  pinMode(2, INPUT);
  Serial.begin(115200*8);
  Serial.write((const uint8_t*)".snd", 4); // magic
  Serial.write((const uint8_t*)"\x00\x00\x00\x18", 4); // header size
  Serial.write((const uint8_t*)"\xff\xff\xff\xff", 4); // data size (-1 = unknown)
  Serial.write((const uint8_t*)"\x00\x00\x00\x02", 4); // coding (2 = 8-bit linear PCM)
  Serial.write((const uint8_t*)"\x00\x00\x27\x10", 4); // rate (10kHz)
  Serial.write((const uint8_t*)"\x00\x00\x00\x01", 4); // channels
  nextsampleat = micros();
}

void loop()
{
  uint32_t now = micros();
  if(int32_t(now-nextsampleat) >= 0)
  {
    uint8_t input = digitalRead(2):
    Serial.write(input?64:-64);
    nextsampleat += 100;
  }
}

A small python script that connects to the arduino, and just dumps all incomming data into a file:

import serial, struct
ser = serial.Serial('/dev/ttyACM0', 115200*8)
samplefile = open('sample.au', 'wb')
while True:
  data = ser.read(1)
  samplefile.write(data)
Next time I will examine how the data is encoded.

11 comments:

  1. Really nice article, i wonder if you got stuck in the project? - I hope not, because i went at bought 2 ekstra norgo meters - I also want to get some live data.

    Henrik

    ReplyDelete
  2. I do have the arduino capturing and sending the data into a CouchDB database. I also have come so far that a small python script is submitting the data to Google PowerMeter. Now I just need to document it :)

    ReplyDelete
  3. Oh i look very much forward to seeing the follow-up, thank you for a great article!

    Henrik

    ReplyDelete
  4. Hej Jesper,

    Jeg er interesseret i at snakke lidt om dette.
    Vil du skrive på luposlip at gmail dot com, så jan jeg sende dig mine kontaktinfo (alternativt skriv dine kontaktinfo, så ringer jeg til dig)?

    Tak! :-)

    ReplyDelete
  5. Our 4 Channel DC Energy Meter comes with options of Shunt, Hall Effect Sensor, Split Core Hall Effect Sensor.The device can be connected through RS485 or we can provide a complete Remote Energy Monitoring Solution.

    ReplyDelete
  6. thanks for sharing this post
    Spaceage security- 24V DC, 48V DC, BTS 4 channel DC energy power meter digital panel meter, remote energy monitoring, RS232, RS4852 Interface, for BTS telecom shelter multiple operator manufacturer supplier, distributor, dealer, exporter in india Delhi/NCR.

    ReplyDelete
  7. Thanks for the so updated information. I was checking weather shop latest weather gadgets and the latest collection is more featured and of the updated best quality.

    ReplyDelete
  8. One of the things that you should do is secure your wireless signal so that only the people you want can access your wireless. this page

    ReplyDelete
  9. The TP-Link DOCSIS 3.0 High Speed Cable Modem (TC-7610-E) has been adulated by numerous clients for its exhibition. Best High Speed cable Modem

    ReplyDelete
  10. Great post, Which you have shared here. Your article is very informative and nicely describes the process . Thank you so much. eaton vfd

    ReplyDelete