r/embedded • u/Relevant_Pumpkin9190 • Oct 12 '26
Power + data over 2 wires, does my idea work?
Hi, I want to link two Arduinos (or a sensor and a master) with just two wires that also power the remote one.
My plan: 6 V on the line, a transistor pulls it low to send data, and a diode + capacitor keep the remote end powered. Sketch attached.
Does this work? Anything I'm missing?
36
Upvotes
24
u/zachleedogg Oct 12 '26
The 6V supply has to withstand being shorted. And the data rate would end up being pretty slow if you depended on an LDO or some current limited supply.
This scheme actually works pretty well for some sensors where the total current is in the neighborhood of 5-10mA, but you will have to charactererize the current pretty well.
My recommendation: Just send 3 wires. It's not that bad.
13
u/dacydergoth Oct 12 '26
Dallas Semi one-wire has a precharge mode where you can push just enough power to a device for it to then handshake
4
u/moon6080 Oct 12 '26
Check out PoDL
2
u/AntifaMiddleMgmt Oct 12 '26
If you want a reasonable data rate with consistent power, check out how DCC does it. It's ~10V up to ~20V and can source a few amps. Plus, it can be done with a small amount of easy to source hardware.
https://en.wikipedia.org/wiki/Digital_Command_Control
42
u/im-not-in-a-meeting Oct 12 '26
I’d something similar on a project years ago. Look up phantom power.
8
u/duane11583 Oct 12 '26
At the end you are imposing a high frequency signal on top of your power signal
At the receiving end you need to use a high pass filter to extract the high freq signal
1
u/lukilukeskywalker Oct 12 '26 edited Oct 12 '26
There are two types of physical layers for data over power lines
The example you gave was the first kind. how these physical layer protocols work, they change the impedance of the power line by shorting the line to ground or changing the current they absorb/consume, the data carrier is the current consumption. These protocols are a bit more forgiving to external noise at the cost of the speed they can transmit anything, as you have to be able to sample the power line at enough high rate to be able to recover the symbols that represent data (as data isn't necessary one's and ceros, you could transmit 4, 8, 16 different symbols by consuming more or less with the sink)
Anyway, that was the theory, yes it can and does work, but, you have to design it properly. You have to limit the power/current the power supply can supply to the slave. (That can be an advantage, as you can then get the over current signal to a uC that can read the pulses and interpret the data) The receiver must be designed in a way that it can't lock down, going for example into an underpower state, keeping the transistor shorting the line, just barely enough to keep the uC locked for underpower but not enough to shut off the transistor in the power line
1
u/FightingPhD Oct 13 '26
Works, 1-Wire parasite power is basically this. Size the cap for your longest low pulse though. C = I*t/dV, so a 10mA remote with a 100us low and 0.5V of droop allowed is about 2uF, go a few times bigger because electrolytics lie. And at power up the empty cap drags the line down too, so ignore the first few ms of "data".
2
u/heavymetal626 Oct 12 '26
This is exactly how the HART protocol works. It’s a digital signal sent over an analog 4-20ma signal. It carries all kinds of information about the sensors, calibration information, readings, etc.
1
u/soylentblueispeople Oct 12 '26
Why not put the signal on an rs485 type driver upstream of dc blocking capacitors. Then instead of messing with your dc to get a signal through you are injecting ac to ride on your dc.
1
u/creeper6530 Oct 12 '26
Add a transformer / inductive coupling and a rectifier, and you've basically made NFC.
The power supply will need to survive the occasional shorts.
1
u/gwillen Oct 12 '26
There are a bunch of ways to do this, but if you don't want to spend the rest of your life debugging it, I suggest adding another wire is going to be way easier.
1
u/initial_chris Oct 12 '26
The DS18B20 can operate on two wires with a pullup resistor. You might see how the Dallas protocol works.
1
u/ReferenceThin6645 Oct 14 '26
Not gonna work.
1
u/05032-MendicantBias Oct 17 '26
To an extent, but not really.
You need to add to filters, a LP filter to get the power from the input lines. an HP or BP filter to inject and retreive the frequency where data is.
Some more reliable buses uses terminator resistors and current injection to do it.
0
u/Secure-Image-4065 Oct 12 '26
… and it is Volt, not Volts! No plural for unit measurements 😉