22
\$\begingroup\$

I'd like to be able to daisy chain multiple devices using just the power supply wires and then inject a communications signal over the power lines to turn it into a half duplex network.

Are there any common methods of achieving this? The simpler the better and it would be great if it used the UART on the microcontroller.

Edit: There are actually two projects that I'm working on that I think would benefit from this - one is a low power sensor network. The other is a LED lighting project. In both cases the objective is to simplify wiring, but if the solution is too complex then it probably makes more sense to use three wires (pwr, gnd, comms).

\$\endgroup\$
3
  • 1
    \$\begingroup\$ AC or DC power supply? What is the power supply voltage? \$\endgroup\$
    – mjh2007
    Commented Jun 11, 2010 at 17:17
  • 4
    \$\begingroup\$ The capacitor + inductor arrangement mentioned in some answers has a name: bias-T. \$\endgroup\$
    – davidcary
    Commented Mar 31, 2011 at 3:19
  • \$\begingroup\$ related: electronics.stackexchange.com/questions/50522/… \$\endgroup\$
    – davidcary
    Commented Jan 4, 2013 at 19:04

11 Answers 11

16
\$\begingroup\$

Have you looked into the Dallas 1-Wire protocol? It is really low speed and if you device takes relatively little current then you can get away with using parasitic power and power the device with the data lines.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for that - 1-Wire looks like it's fairly popular and well suited for low power sensor networks. \$\endgroup\$ Commented Feb 22, 2010 at 4:51
  • 3
    \$\begingroup\$ Hi Peter, since you specifically asked for UART. I managed to find a maxim app notes for using UART as a 1-wire bus master. (see maxim-ic.com/app-notes/index.mvp/id/214 ). \$\endgroup\$
    – Terry Chen
    Commented Feb 22, 2010 at 20:05
12
\$\begingroup\$

You essentially need to push AC signals onto the DC power line, and separate them out again. This is common in homes with TV antennas - the power amplifier is put near the antenna, and DC power is pushed up the antenna wire while TV signals come down the antenna wire.

You don't give enough details for an example circuit, but here are the basics:

The power source should have an inductor in series going to the output to block high frequency signals feeding into the power supply and possibly causing regulation problems.

Each unit's power input should be similarly protected with an inductor to filter out the AC signals. Feeding that into a diode and capacitor will make sure the AC signals don't jeopardize your module power.

Prior to the inductor, you'll also attach a capacitor. It'll probably be a low value so that most of the AC signals on the line pass the capcitor, but none of the DC will.

The output of this capacitor MIGHT be usable directly into a microcontroller (with diode clamping) if you have the skills to implement the necessary software to read the now-mutilated data off the line. Likewise you can send pulses directly into the capacitor with the I/O pin.

Check out what that looks like on a scope - the square wave going into the capacitor will look like a decaying spike on the power line. When it comes out another capacitor on the network it will be further changed - just a spike on the line.

Reading these spikes can be difficult, and filtering out noise can be difficult, so if you're running long lines, have a noisy power supply, or running lines near other noise sources then you'll have to implement significant signal processing. Usually this takes the form of AM (ASK - Amplitude shift keying) or FM (FSK - Frequency shift keying) on the line, with data slicers, comparators, tone generators and detectors, etc. Or the equivalent processing in software.

It may seem like a lot of work, but start off with a simple pulse detector on the receiving end and send square waves when transmitting. Use an oscilloscope to understand what's happening, and if you find you need a more complex solution ask again about ASK or FSK detection.

A pulse detector might be a simple software interrupt on change input pin, or a 555 set up as a pulse stretcher.

\$\endgroup\$
2
  • \$\begingroup\$ I agree with adam here except that I believe all communication should be done FM and you can build some really nice filters to get your signal back almost perfectly. He has mentioned this, but I thought I would add a note to clarify that a noisy signal can be beautiful again with the right filter and FM modulation. \$\endgroup\$
    – Kortuk
    Commented Feb 22, 2010 at 18:30
  • 2
    \$\begingroup\$ FM is significantly better than AM or many other simple modulation schemes, but it does exact a slightly higher cost in terms of hardware and/or software, and if the signal quality is good it may be overkill. \$\endgroup\$
    – Adam Davis
    Commented Feb 22, 2010 at 21:11
7
\$\begingroup\$

I've built something like this for a train controller system (model train, of course).

It was a monodirectional low speed protocol (a single entity sends data, all others are receivers only) and transmission was done by simply reversing rail polarity.

On every "client" there was a simple circuit done with a pic (16C54, years ago!), a rectifier and some dip switches to set address.

I don't have source codes anymore, but system was really easy, and worked flawless for years, allowing easy control of every single locomotive, raiload barrier, semaphore etc. from a the main control panel without additional wires.

\$\endgroup\$
3
  • \$\begingroup\$ Axeman, I do not have anything to say but that you have impressed me sir/ma'am. That solution makes me giggle. \$\endgroup\$
    – Kortuk
    Commented Feb 22, 2010 at 18:25
  • \$\begingroup\$ Kortuk, I hope that you "giggling" means "thumbs up" (I'm italian and not very strong in english, as you can see :-) ) Anyway, years before my "invention" (but I discovered it after my project was completed) model railroad factories designed,standardized and implemented (in the same way) DCC: Digital Command Control, for the same purpose: en.wikipedia.org/wiki/Digital_Command_Control \$\endgroup\$
    – Axeman
    Commented Feb 23, 2010 at 14:24
  • \$\begingroup\$ DCC protocol: "1" = 58microSeconds high then 58uSec low. "0" = 100uSec high then 100uSec low. The total +ve bias equals the total -ve bias, so you get AC power distribution which can be rectified to DC \$\endgroup\$
    – Greg Woods
    Commented Apr 28, 2020 at 22:42
6
\$\begingroup\$

I would recommend thinking about it as a signal that you are adding and removing a DC Offset. You can use capacitors to block DC by placing them in series with your circuit.

Beyond that it is hard to say what you will need to do because it will be dependent upon your application. You may need to use an opamp to separate your coupling capacitor from what ever is receiving your signal. If your DC offset voltage is large compared to your signal voltage you may not even need to do any power conditioning on it to remove the ripple, this is all dependent on your application though.

I have a pair of speakers that use this same technique to light a power LED on a secondary speaker. If I turn the volume up loud enough I can actually notice the LED get brighter. In this particular application they would need to be worried about what type of RC filter is being created.

\$\endgroup\$
1
  • \$\begingroup\$ I've considered trying to modulate RS232 with a hi freq signal coupled to a 12V supply - I'm guessing it would be important to isolate the PSU capacitance so that it doesn't try to smooth out the ripples? \$\endgroup\$ Commented Feb 22, 2010 at 4:59
4
\$\begingroup\$

I know this is quite an old thread, but here's my 2 pence worth...

I haven't got anything working yet, but was looking at doing something similar using an Arduino + VirtualWire (set at a really low baud rate). As Adam Davis says above, you transmit/receive your data from the 12V line via a low value capacitor. It means you essentially get 0V with little spikes on it, which VirtualWire can (probably) decode. The good news about this method is that in theory any device on the 12V line can talk, and any can receive. I've had this working with an ordinary bit of wire between the two devices on a breadboard, but not sure if it'll work over distance, or over an actual power line.

If the transmission is always from the same place, then maybe using something like the Hornby method might be better - ie. have the transmitter switch the power line between +12V and -12V to create the signal. Each receiver has a rectifier on it's connection to the power line, so it always gets +12V supply. You could arguably simply pulse +12V, and have each device use a large capacitor to smooth out the bumps. Either of these methods is probably more reliable because the signal on the power line will be much stronger and therefore easier to decode (I'd still use VirtualWire to do it mind you, but a UART could work too).

For an LED lighting project, there's a good chance you're going to have to shift a couple of amps down the 12V line. That makes switching it a bit harder, so you might be better off with the RF-over-capacitor method. However, the height of the spikes you receive will reduce quite considerably with higher current, so you may need to amplify the signal you write onto the line (eg. use a high frequency transistor or two to 'amplify' the TTL signal to 12V before pushing it through the capacitor onto the 12V line).

Either way, something like VirtualWire will almost always work better than a UART (and probably I2C etc). The reason is that it uses a phase locked loop to 'sync' the transmission and reception together, which means a higher signal to noise ratio and less errors. That should make it a bit more forgiving of less-than-perfect hardware ;-)

\$\endgroup\$
3
\$\begingroup\$

Are you sure some sort of USB solution is not workable? You have around 2-2.5W available.

Here are a couple of other ideas --

Power over ethernet (POE) integrates power and ethernet signals. There are a variety of semiconductors and DC/DC converters designed for these devices. This is probably your best option since there are off-the-shelf parts for this.

I believe some of the home automation companies integrate AC power and communications signals. Maybe some of that is adaptable.

The audio folks have "phantom" powering of microphones. 48VDC plus audio over a microphone cable.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ You will need to be careful with pulling power from USB. When you first plug a device into a USB port you are granted 100mA at 5v = 0.5W. Your device can then request for additional power and get 500mA at 5v = 2.5W. You will also need to insure that your device wont have a large pull when you first plug it in. Wikipedia talks a bit about USB power in the 'Power' section at en.wikipedia.org/wiki/Universal_Serial_Bus#Power \$\endgroup\$
    – Kellenjb
    Commented Feb 22, 2010 at 3:46
  • \$\begingroup\$ Kellenjb, enumeration is not exactly the same as requesting more power, I like to think of it as verifying you are an intelligent device. Most people also forget if they are giving their device to someone else it may be plugged into an un-powered hub, resulting in maximum pull of 100mA no matter the situation. \$\endgroup\$
    – Kortuk
    Commented Feb 22, 2010 at 18:20
2
\$\begingroup\$

There are lots of questions I could ask before giving any advice. I guess the first thing for us to try to understand is, what is your goal here? Low build cost, long communication runs thereby saving wiring, proof of concept or something else. They all would have different recommendations. For example if you aren't worried about cost then maybe go with a Zigbee solution or if it is long runs then that creates problems with most single wire transmitions and now you need to look at other options. I guess the thing that worries me the most about your question is that you say "the simpler the better". What you are asking is possible in some situations, but I dare to say it won't be simple. Mainly due to the real world problems you will encounter, such as signal loss, noise and current management. If you have more specifics then we could be of more assistance.

Best of luck.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks - it's good to hear of potential problems I may run into down the track. I've tried to clarify my needs a little in the above post. \$\endgroup\$ Commented Feb 22, 2010 at 4:55
1
\$\begingroup\$

The X-10 protocol does exactly this.

Also some of the suggestions above aren't safe or certainly can't be used in approved (UL/CE mark) devices.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I'm assuming that "power supply wires" mean low voltage wires. If they are AC supply wires then yes, most of the other answers are unsuitable without taking this into account. \$\endgroup\$
    – Adam Davis
    Commented Feb 24, 2010 at 22:27
  • 3
    \$\begingroup\$ X10 assumes by design an AC power line and needs specific tuned transformer. Don't think it fits to the "The simple the better" part of the question :-) \$\endgroup\$
    – Axeman
    Commented Feb 25, 2010 at 10:19
0
\$\begingroup\$

There ia a dedicated semiconductor that get a UART byte and transfer it over the power line at speeds up to 115.2Kbps. This device was designed for automotive so it is robust to noise. See http://yamar.com/product/sig60/

\$\endgroup\$
0
\$\begingroup\$

Check this:

And the thread where I took that information (same question as you).

\$\endgroup\$
-2
\$\begingroup\$

It is done in telephone systems. As you know in telephone we have power and dialing tone and voice in a two-wire system. You can send your commands through power line by generating tone (like tone dialing in ordinary telephon) the integrated circuits (Ic) for this application are commonly used and therefore are very cheap.

I did a project like this for controlling water valves in a large plant in Iran (up to 99 valves). I can add a block diagram of my coder decoder circuit if you think it may be useful.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ This does not answer the question. \$\endgroup\$
    – Null
    Commented Oct 9, 2014 at 18:53
  • \$\begingroup\$ Saeed, when answering old questions (2010) it's customary to make a significant contribution, especially since there are already other good answers. And please don't propose private exchange of information, since answer are supposed to be helpful for anyone who browses here. \$\endgroup\$
    – clabacchio
    Commented Oct 10, 2014 at 16:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.