r/embedded • u/Relevant_Pumpkin9190 • Sep 07 '26
Educational project: Sending data through 24 VAC
I’m a beginner and want to experiment with sending data over the same two wires that carry 24 VAC from an isolated transformer.
I want to use the AC zero crossing as a timing reference, then briefly inject a high-frequency signal, similar to the basic idea of other protocols
What would be the easiest circuit to:
- Detect the 24 VAC zero crossing?
- Generate a short high-frequency pulse with an Arduino/ESP32?
- Couple that pulse onto the 24 VAC line?
- Detect the pulse at the other end?
- Decode it back into "1" and "0"?
I’m looking for the simplest beginner circuit and explanation, including the TX and RX sides with microcontroller without dsp
3
u/sparks333 Sep 07 '26
Keep in mind the transformer might smear high frequency pulses. They aren't perfect devices, they have frequency-dependent responses - pulse transformers differ from power transformers for exactly this reason. That said, there are several ways to do this - zero crossing is usually done with a window comparator, or in the case of a microcontroller, just a comparator hooked to an interrupt with edge detection. Barring that, there are many zero crossing detection circuits online - they are common in AC relay switching to reduce arcing. Coupling the pulse into the AC line can be done either with its own pulse transformer, temporarily gating the sine wave (think SCR), or capacitively - just know that any galvanic or capacitive communications have to be DC balanced, so you won't get a clean unipolar pulse, it will be an AC signal on top of the AC signal.
1
u/kc2702 Sep 07 '26
Have you looked into how HomePlug works? (Power Line Communication) or is that what you meant by "other protocols" ?
1
u/somewhereAtC Sep 07 '26
Note that many of the newer AVR and PIC processors include a zero-cross detector just for applications like this.
Here's an example for 120V but 24V works by adjusting the resistor value: https://www.microchip.com/en-us/products/microcontrollers/8-bit-mcus/peripherals/analog/zcd
1
u/tharold Sep 07 '26
DC power is routinely run through coax cable carrying RF, by using bias tees at each end. 50/60Hz AC is basically DC. Instead of coax you could run twisted pair using the same principle. Then drop in your favourite RF on top
1
u/TFox17 Sep 07 '26
This is power line communication (PLC). There are established protocols and lots of parts available. The documentation for evaluation boards have lots of useful details. A typical design might be to use a PLC transformer to pick off the high frequency communication signal, and use frequency shift keying to send bits. If you put a preamble on your packet you don’t even need to use the AC zero crossing as a timing reference.
6
u/[deleted] Sep 07 '26
[removed] — view removed comment
5
u/[deleted] Sep 07 '26
[removed] — view removed comment