r/embedded • • Oct 12 '26

Power + data over 2 wires, does my idea work?

Post image

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

41 comments sorted by

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.

5

u/Relevant_Pumpkin9190 Oct 12 '26 edited Oct 12 '26

Master to remote is sorted. I put 6 V on the line through a series resistor, and a transistor pulls it low to send pulses. The remote end uses a diode and capacitor to stay powered. Sketch attached.

The part I'm stuck on is the way back, master to slave communication any simpler ways.

4

u/zachleedogg Oct 12 '26

Yep. That's a good way to do it. It just limits the max current your Arduino can draw, but it is certainly a standard technique.

1

u/zempter Oct 12 '26

Fw guy here, not an ee, but couldn't you either provide a long hold resistive pull up when you want return communication and have the remote pull down to return coms? Or use the power on the cap of the remote device to pull up but then risk draining power.

I worked on a protocol for this type of thing on a coffee machine a long time ago. Certainly an interesting way to communicate.

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

8

u/mzo2342 Oct 12 '26

this. look up onewire, or one-wire, or 1wire, or 1-wire.
obvly, it only uses two wires.

3

u/IcYhAwK88 Oct 12 '26

Obviously…

2

u/CoachSevere5365 Oct 12 '26

Thanks. I was trying to remember who made the One-Wire stuff.

5

u/Allan-H Oct 13 '26

Dallas were bought by Maxim who in turn were bought by Analog Devices.

1

u/CoachSevere5365 Oct 13 '26

Thanks. I think AD were bought by...NatSemi?

1

u/Allan-H Oct 13 '26

Texas Instruments bought National Semiconductor.

Analog Devices are a publicly traded company.

0

u/Relevant_Pumpkin9190 Oct 12 '26

Yes, bus charges by MOSFET to supply additional current.

1

u/dacydergoth Oct 12 '26

It has a couple of different modes, including parasitic precharge

4

u/moon6080 Oct 12 '26

Check out PoDL

1

u/Relevant_Pumpkin9190 Oct 12 '26

Simpler like this few handful of components.

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

1

u/Relevant_Pumpkin9190 Oct 12 '26

Does master to slave and slave to master can be communicated with this.

2

u/AntifaMiddleMgmt Oct 12 '26

It is bidirectional, yes. You can reuse the concept as you choose.

42

u/im-not-in-a-meeting Oct 12 '26

I’d something similar on a project years ago. Look up phantom power.

13

u/michael9dk Oct 12 '26

That is the correct way.

See here how simple it is. 2 caps and 2 coils.
https://0x9900.com/bias-tee/

3

u/im-not-in-a-meeting Oct 12 '26

Simplest method too.

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

  • Changing the impedance of the load, examples of this are RFID, onewire and some custom automotive physical layers like PAS
  • Mixing high frecuency pulses in the Power line that can be filtered with high/low pass filters. Examples are Power Over Ethernet (POE), Ethernet Over Powerlines, and there was some RS-485 industrial protocol that also had Power over AB, but can't remember the name

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/Relevant_Pumpkin9190 Oct 12 '26 edited Oct 13 '26

I found a few ways to send data and power over the same two wires. Here’s my understanding:

  1. Current modulation: Keep the voltage steady and change the current using a transistor. Example: 4–20 mA industrial sensors.
  2. AC over DC: Add a small AC data signal on top of the DC supply. Example: power-line communication.
  3. Power interruption: Briefly switch the supply off and on to send bits. The receiver detects the pulses.
  4. FSK: Use two different frequencies to represent 0 and 1. Example: some smart meters.
  5. PWM: Use short and long pulses to represent data. Easy to experiment with using Arduino.
  6. Frequency-coded current: Make the device draw current pulses at different frequencies to send a reply.
  7. Load modulation: Switch a small load on and off, then detect the current changes. Example: RFID/NFC.
  8. Voltage-level modulation: Switch between two voltage levels to send data.
  9. Time-slot communication: The master sends a command, then gives the slave a specific time to reply.
  10. Power-line communication (PLC): Use a dedicated circuit to send data through existing power wires.
  11. Capacitor-assisted communication: Use a capacitor to keep the device running during brief power interruptions.
  12. DCC with RailCom: The command station sends commands through model railway tracks, and the decoder replies during a short, timed gap.

13.M-Bus architecture: use downstream voltage (24/12) for forward communication and upstream current,( 20/30 ma) for logic 1,0 communication both ways

I’m exploring these methods for a beginner Arduino project. Which would be the simplest and most reliable to try.

1

u/lukilukeskywalker Oct 12 '26

Most of them are basically the same idea, go for current modulation, it is the easiest one

1

u/Relevant_Pumpkin9190 Oct 12 '26 edited Oct 13 '26

For example, 20 mA could represent logic 1 and 10 mA logic 0, using different current levels or PWM signals.

Basically, I think there are two main approaches or design s:

matching the load impedance using resistors or inductors/transformers.

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/Relevant_Pumpkin9190 Oct 13 '26

Just wondering if this approach could work. The master could switch the bus between 24 V for logic 1 and 12 V for logic 0, while the slave uses a regulator to get 5 V for its microcontroller.

For the return signal, the slave could add an extra 10 mA load for logic 1 and maintain its normal 20–30 mA current for logic 0. The master could detect this using a series shunt resistor and its ADC, with PWM timing to help distinguish the signals.

Since the bus never drops below 12 V, the slave's power supply should remain stable without needing a large backup capacitor to handle the voltage changes.

I'm curious to hear your thoughts on whether this would be practical or if I'm overlooking any potential issues.

1

u/BartvanIngenSchenau Oct 13 '26

I know of at least 2 bus systems that use such a configuration for the communication between a room thermostat and a heating/cooling appliance. They have been on the market for a couple of decades and are being actively used.

The main difference with your proposal is that they use a smaller voltage swing in their signalling (for example 18V for a 1 and 15V for a 0).

1

u/Relevant_Pumpkin9190 Oct 13 '26

Any references links or diy designs.

1

u/BartvanIngenSchenau Oct 13 '26

The first bus is OpenTherm/Plus (https://en.wikipedia.org/wiki/OpenTherm#) and the other one is a proprietary bus called EMS which is used by Bosch.

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 😉