Open source extra-sensitive high resolution TED receiver
Previously on the bloggy blog, I posted a few of my projects related to home data acquisition and to The Energy Detective (TED), a whole-house power measurement device. I made a set of homebrew wireless temperature sensors that display graphs on a digital picture frame, I reverse engineered the TED protocol, built a small self-contained open source TED receiver, and used that design to make a nifty clock.
So, I wanted to take the next step and set up real-time power usage graphing alongside the temperature graphs. The only problem: My sensor receivers are on a different power line phase than the TED. I’d need a TED receiver that can deal with all of the noise that switching power supplies put out, and receive weak TED signals that have been coupled across phases by the utility’s pole transformer. There were probably easier ways to solve this problem, but it was a good excuse to get more experience with analog electronics ![]()
The end result was this cute little doodad:
Features:
- Isolated power supplies for the host computer, receiver circuitry, and the power line signal itself. Separate voltage regulators for analog and digital.
- High-Q LC filter, centered at 125 kHz.
- Dual outputs: RS-232 serial and USB (Prolific USB-serial chip)
- Generates human-readable text at 9600 baud:
HC=245 KW=001.347 V=121.228 CNT=033 - Decodes packets with up to 1 watt / 1 millivolt precision!
- Last but not least, an oh-so-cute power/status LED which glows dimly to indicate power, and flashes brightly when a packet is received.
With all of this precision, the resulting graphs look pretty decent. Here are power and voltage graphs, for the same time period. You can certainly see the voltage dips when my refrigerator or heater fan kick on, but you can also see some loads on the voltage graph that don’t show up on the power graph. These are probably the neighbor’s appliances.
The circuit design is pretty straightforward, and it should be pretty easy to build for anyone an AVR programmer and some experience with hobbyist electronics. Inside the box the mains voltage is split into two 9V AC transformers: one for power, and one for data. The power transformer’s output is rectified, and the unregulated voltage is diverted to two 7805 regulators, one for the microcontroller and one for the amplifier. The amplifier is very sensitive to noise, and it helps to have some isolation from all the high frequency harmonics that a microcontroller will toss into its power supply.
I built the prototype on a piece of stripboard in a grounded aluminum box. From left to right: MCP6292 dual op-amp and all associated passives, power supply, ATtiny85 microcontroller, and some transistors to drive the LED brightness control circuit and the RS-232 output.
The analog front-end starts with a high-pass filter which cuts out nearly all of the 60 Hz AC power, leaving a manageable signal level. This goes through some clamping diodes, to protect the op-amp input from transients, then through a first amplification stage with a gain of about 68. It’s important that this pre-amplifier is non-inverting, to avoid oscillation. This then goes through an LC bandpass filter, and another amplification stage with a gain of about 31.
With these op-amps, you could achieve higher gains (around 80), but this is all I needed. Your mileage may vary. If you want variable gain control, try replacing the 3.3k resistor at the second op-amp’s inverting input with a multi-turn 5k trimmer pot. More ambitious readers may even want to design an AGC circuit. After the second gain stage, a final low-pass filter is very important in order to remove transients that can cause false transitions on the microcontroller’s input. The microcontroller finally gets a filtered and amplified signal. It proceeds to do the demodulation and decoding in software.
I apologize for the crude hand-drawn schematic. There are more pictures on Flickr, and software/firmware in Subversion. Happy hacking!









TED receiver
I was looking into build one of these and I have a few questions
1: The 0.5nF cap on the input side of the 1st OpAmp ( beside the A ) can another value be used perhaps 330pF Digikey pricing for 500pF is quite high the 300 or 330 are much more reasonable.
2: Clamping diodes: normal diodes or zeners (I would assume zeners)?
3: Have you thought about adding sd/mmc card support to create a self contained data logger?
Re: TED receiver
Hi!
1) I got my 500pf cap from digi-key, and I don’t remember it being overpriced.. but if you do need to substitute for a 300pf, you may need to increase the value of the 1.5k resistor just to the right of it. These two components form a high-pass filter that rejects most of the 60 Hz power before the first amplifier stage.
2) As shown, this is designed for normal diodes. You can use Schottky diodes if you want, but that’s probably overkill. I think I used a plain old 1N914. This will clamp to -0.3v and 5.3v, which is plenty low enough. Combined with the subsequent resistors, this should still do a good job of keeping the op-amp input current quite low even if the input experiences static electricity or some other high-frequency voltage spike.
3) Yes, I did think about this.. it would certainly be easy to use an AVR with more pins, and give it a couple gigabytes of storage. That should hold quite a bit of data. The reason I decided against this was that I wanted it connected to the internet in real-time, and I had a low-power PC handy for that job. If you end up modding the design to use an SD card, I’d love to hear about it!
Good luck!
–Micah
Thank you
Beautiful!
Why two power supplies
Your previous schematic allowed for one power supply and fewer components. Was there a reason you went with two supplies and a slightly more complex schematic? Were there reliability problems?
Adam
Re: Why two power supplies
Also, all I need is TTL levels to a router board UART. Do I need the two circuits at the bottom of the hand written page still or are those to just boost to rs232 voltage levels?
I am a novice at much of this, but could explain what is happening in the bottom right block?
Thanks,
Adam
Re: Why two power supplies
Hi Adam,
About the two power supplies: This circuit is designed to be more sensitive and more reliable than the previous version. The simpler design is fine if you’re receiving the signal relatively close to the TED transmitter, or if you have power mains that are relatively noise-free- but it doesn’t work as well under less ideal conditions. For example, in my house the simple receiver has trouble recieving packets reliably when I use it upstairs, but when I plug it in closer to the breaker box it’s fine.
The new circuit is designed to be really sensitive, even more so than the stock RDU that comes with TED. I wanted to be able to receive the signal even if my box is plugged into a different power line phase than the transmitter. To do this, I needed a very selective amplifier that could pick out the frequency of interest, amplify it a lot, and reject most of the noise.
So, getting back to the reason for the extra power supply: Any power supply is going to inject noise into the signal I’m trying to measure. For example, a linear DC supply has a rectifier diode which lets the transformer charge a capacitor when the AC waveform is higher voltage than the capacitor, and lets no current flow when the AC wave is lower than the capacitor voltage. Every time the voltage crosses this threshold, there is a sharp change in the current draw through the transformer, which gives you a sharp change in voltage. This sharp change is rich in harmonics, and it’s really hard to completely filter out of the signal. I tried various filtering strategies. In the earlier simple design, an inductor did the trick. In this design, I couldn’t make it work reliably off of one power supply.
As for the circuits at the bottom of the schematic:
The one at the bottom-right is totally optional, it just exists to drive an LED. The LED will glow dimly when the receiver is on, and emit a bright flash every time it receives a packet. Normally, signal (C) is at 5V, and the PNP transistor is switched off. The LED will be dim, because it’s being powered by both resistors in series (680 + 270 = ~1K ohms).
When the microcontroller sends out some serial data, signal (C) will be a series of rapid pulses. We want to smooth those out, and flash the LED. So, every time (C) is low, the PNP transistor switches on, and the capacitor charges. When the transistor switches back off, the capacitor still holds a charge for a while. When the capacitor is charged, the LED is lit through only the 270 ohm resistor, so the current is higher and it lights brighter.
For the bottom-left block: This is just a really basic TTL to RS-232 converter. If you’re using a TTL serial port already, you don’t need it. You can connect it directly to (C). I’d use maybe a 4.7k resistor in series, just to limit the current in case the UART is only 3.3v tolerant.
Good luck!
–Micah
Re: Why two power supplies
I have started putting together a Bill of Materials for those of us that do not stock any parts ourselves to build one of these and your input would be helpful. My email is on my openid page http://chaseadam.myopenid.com/ I have started a zoho spreadsheet to share, but it requires an email to invite.
There are a few things I could not find:
* What is the value of 0.1 cap?
* There are a few caps that I could not find on digikey (I know they are there)
* Is the resistor in the LED block 3.3k or 33k?
You have come up with a great solution. I already have my TED installed and can’t wait to tap into that data. Thanks!
Re: Why two power supplies
Awesome. I’ll shoot you an email so I can see the Bill of Materials.
The 0.1 capacitors are 0.1uF ceramic capacitors, at least 20V or so. I think I used Digi-key 399-4151-ND.
Which capacitors are you having trouble locating?
The resistor in the LED block is 33k. (It’s so big because I wanted to limit the capacitor charging current to a reasonable amount.)
Cheers!
–Micah
Re: Why two power supplies
Micah, what a great project! I also was disappointed with the Footprints solution, the onerous NDA, and the high power consumption of the PC, and was fortunate to find your postings.
You’ve already answered the question about the two transformers. However, I had a related question:
With 11 bytes, 11 bits per byte, and 1200 baud, it seems that the TED transmission would only be a 10% duty cycle. Do you see the possibility of using, say, a power PFET to isolate the Vdigital and Vanalog supplies from the rectified 9VAC source during the 10% of the time when the circuit is receiving? With an adequate cap and the AVR running as low power as possible (sleep mode between timer firings and all unnecessary peripherals turned off), it could hopefully run solely on the charged cap as it discharged. For the other 90% of the time, the cap could be charged back up (the extra noise wouldn’t jam the TED transmission).
It would make the startup a bit more complicated, as the AVR would have to search for the 10% window, but the payoff would be running off of one wall wart.
Just a random thought… Thanks.
Re: Why two power supplies
That’s a good idea. Right now, if you were to run the circuit off of one power supply, there would be a spike of harmonics on the input every 60Hz (or 120Hz if you used a bridge rectifier) and that spike would cause the LC filter to ring. By switching on and off the power like this, you’d be causing these spikes to be larger but less frequent- and you can control their location in software
I’m not worried about running the AVR off of a capacitor for 1 second, but that might not work as well for the amplifier. It likes a very steady power supply voltage, and it isn’t super low power because it uses voltage dividers in order to generate 1/2 Vcc reference voltages.
Maybe a simpler way to run off of one power supply would be to reduce the amplifier circuit’s power consumption? These are already pretty low-power op amps. Maybe it just needs a low power voltage reference or two?
Thanks!
–Micah
Re: Why two power supplies
Hmmm, yes I see that the two 270 ohm resistors that form one of the voltage dividers would dissipate a fair bit of power.
Thanks!
Re: Why two power supplies
what’s the status of your BoM? I’d love to build one of these!
Re: Thank you
Awesome article. Question thou, do you know how I can make this work with a solar PV system? I want to monitor three things, solar electric generation, utility usage, total usage. With TED I can monitor the solar PV breaker to just get solar generation. If I know solar PV generation and utility usage I can get total usage. But how can I use TED to get utility usage…they say the TED device does not work with net-metering. Why? Is there something that I can do to make this work. What part of their system is broken? If the RTU can send negative numbers than I can get this to work by using your design. Or if it gets set to zero then I could install two of these things, one backwards to get the net/excess generation. Any help would be appreciated. Thanks
Re: Thank you
Great question!
I’m not sure how the TED MTU would react in this case.. if I remember correctly, the MTU’s current transformers can be installed in either polarity- so I assume it takes the absolute value of the current flow. I wonder if there’s some way to modify an MTU (or two?) to report net power?
–Micah
Re: Thank you
Exactly. Supposedly they are coming out with a TED5000 that suppose to handle net-metering. I wonder how they are doing that? I saw a manual for TED5000 foorprints here (http://www.theenergydetective.com/media/TED5000%20Footprints%20User%20Manual%20041809.pdf). Looks like the software may be totally redesigned and all web based. Not sure if this means their MTU’s will be totally different.
Ray
There will be some information released this week on the web site. I think everyone will be pleased with what’s coming.
Roman
Re: Thank you
If you install a “new” main panel closer to meter and use it to feed the old main panel and connect the solar into the new panel, then you should be able to get close by doing consumption (old) – generation (solar)
Re: Why two power supplies
I have the BoM nearly complete, I just need to find a proper pnp GP
http://public.sheet.zoho.com/public/chaseadam/bom-ted-reader
Re: Why two power supplies
Mostly finished:
http://public.sheet.zoho.com/public/chaseadam/bom-ted-reader
Re: Why two power supplies
Ah, that is in the LED status light circuit anyways, I should have a spare one laying around somewhere, nothing special. I am going to order these parts next week. If anyone wants to go in on the order I can divvy up the pieces.
Anyone try ordering just the TED 1001 MTU & CTs? http://bit.ly/3P2tQo For $70, looks like a bargain. Since we now have a way to access the raw data with higher precision, I don’t see a need for the RDU, so why purchase it?
I did note in the description that they need you to provide your existing house code. Anyone know how the house codes are set in the MTUs? Is this something easily changed in the field?
Great project! Would love to see a kit.
Yeah, if you don’t need the RDU as a display unit, the MTU & CTs certainly seem like a good deal. The parts to build this simple receiver are quite inexpensive.
You don’t actually need to know your house code ahead of time to use this hardware. MTUs just broadcast their readings onto your power lines with the house code in each packet’s header. There’s no handshaking that needs to occur, so my receiver will just dump out any packets that can be heard on your power lines. It’s up to the PC software to selectively pay attention to only one house code. So if you don’t know your house code, you can find out just by looking at the packets that come out of the receiver’s serial port.
(Also, IIRC the house code is printed on the MTU itself, or at least in the user’s manual.)
As for providing a kit: I don’t think I have the time personally to produce and sell a kit, but since the project is open source, anyone is welcome to do so. You might try asking some of the big hobbyist electronics shops like Spark Fun or Ladyada if they’re interested in putting together a kit.
Thanks!
I’m thinking I would eventually have 3 MTUs: one for the main panel & one for each A/C compressor circuit. I believe each of these would need to have a different house code so you could properly identify the source of the reading.
Any chance of purchasing just a programmed microcontroller? I have a PIC programmer, but have never worked with AVRs. I imagine others would find the purchase of the AVR programmer prohibitive for a single project. Or I suppose I could port the code to the PIC.