Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

High pass filter to grab Arduino serial data from 60hz power transformer line and NOT 60hz sine wave

Status
Not open for further replies.

Quantboy

New Member
I have a student project where I have to use one two wires to transmit both power and serial data between a Raspberry Pi and an Arduino.

The project uses a 120VAC to 24VAC transformer. The 24 VAC is fed down a set of train tracks... The train has a microcontroller (Arduino) that must receive serial data, taken from the 60hz power rails, but disregard the 60hz "noise". The input serial data is fed into the rails by a Raspberry Pi serial output.

Does anyone have any ideas on:
1) inputting the serial data into the 60hz rails from serial +3.3V... and
2) getting the serial data back out and into the Arduino???

Would I want a notch filter to zap just the 60 hz? A highpass / bandpass filter for everything above, say 1khz? OR, a set of optical amps... one for amplifying EVERYTHING... and the other for selectively filtering out the 60hz and inverting the signal, combining it back into optical amp #1 to cancel it?

Any help is appreciated!

--Quantboy
 
What baud rate are you trying to send?

You know that model railroaders have been doing this since the 1960s.
 
I was going to try for 115200 baud... however as low as 2400 would be acceptable...
I was unaware that it was done by model railroaders! However, my project is to actually design show my own set up, and I cant use any off the shelf "controls" ... :(
Any idea on how they are doing it?
 
This is fairly trivial to do with any VCO to modulate and PLL to demodulate with a FM deviation at least 4x the bit rate to improve SNR. You can use synchronous, asynchronous and even full duplex communication on separate carriers. The carrier frequency can be anything say >10x the bit rate.

Filters isolate the channels. Single chip PLL will work.

I'd done this many times, including 1.544mbps on 6MHz AM and 12 MHz AM in other direction.
A tiny ferrite cored direction coupler helps isolate Tx and Rx by at least 30dB, which you can remove from a 3dB splitter.
 
An alternative to the modulation/demodulation approach (FM is better than AM due to motor noise) is direct power rail modulation.

Most model trains run on DC obtained from the AC transformer by rectification. By modulating the +ve buss with your data signal at a fast data rate (>19200 baud) you can pump data to the train that has a simple µC doing the receive by monitoring the incoming DC voltage. On board decoupling caps prevent the 19.2K signal from resetting the µC power rails. A suitable FET can handle the job driven by a µC. You'll have to flywheel snub the train motor to handle any kickback spikes.

Train DC motors tend to have skewed windings to smooth out DC pulses now. While the TX signal is going on it will slow the train by about 25%.

Anyhow, you can also follow the DCC spec as it stands:
https://www.opendcc.de/elektronik/opendcc/opendcc_sw_lenz_e.html
 
DCC is pretty primitive yet effective but ineffiicent old standard compared to what I suggested and have done a few decades ago.

So it depends if you want new technology or old. With 1.5Mbps you can run a video cam live on the engine front end.
 
Tony Stewart : Thanks for the reply! I understand how to use the Arduino (Atmel's) "Virtual Wire" or 'software PLL serial data application' that lets you send serial data between different Arduinos, BUT I have minimal experience is modulating signals and using PLL chips to demodulate them on the other end... Would you be able to point me to a sample circuit? Or idea on how I can get started with figuring modulating/demodulating data that I could feed between controllers??? I just am a little confused at where to start...

Mosaic : Great idea -- however I need consistent power that can power several controllers (train engines) off of the same rails... and consistent power/speed ... I think I have to go with AC...
 
AC is the worst solution since it depends on the winding resistance for load regulation.
DC SMPS like PC PSU 12V is FAR FAR better since tight load regulation means low noise and easy to filter motor noise.

FM telemetry is simple with PLL. But depends if you need Digital or analog interface.
Since this is a smart train, I assume you have the smarts to program a uC to decode and encode the command set and can use an I2C bus.

If so, then https://media.digikey.com/pdf/Data Sheets/Atmel PDFs/U4289BM.pdf
 
Since this is a smart train, I assume you have the smarts to program a uC to decode and encode the command set and can use an I2C bus.

LOL! That's awesome... programming is not a problem... I was planning on taking the AC power and rectifying/smoothing/buffering it out in an on-board DC power supply... filtering out the RF component and converting it into digital data to drive an Arduino uC ... and using the Arduino to control a DC motor controller to more the train...

Thanks for the datasheet -- researching it now...
 
But I'm not interested unless you put in a video cam on it with collision avoidance using IR with LADAR like precision using 3mm LED/photo diodes with 1 mm fiber port mixed with headlight.
 
Simple LED is 1mm clear fishline epoxied to SMD LED behind engine lamp lens.

30 yrs ago I just used analog Rx with NE567, but Atmel has a new sophisticated solution with I2C

Define overall specs 1st for all in/outs; physical ; functional; and cost and time R&D , NRE, test equip avail./required.

You might turn a few ears in the huge N scale clubs with crowd source funding with a good design and retrofits.
 
Does anyone have any thoughts on using an HT12E / HT12D encoder/decoder (433 Mhz) to do the dirty work of encoding data from/to arduinos?

VS

something like a 555 encoder paired with a 565 PLL decoder using FSK? (think it would be sloooow)

vs a PLL 4046??? or ??? any suggestions??? Ideally I would like to hit 19,200baud... but even 300 baud would work (just not as cool)... Just looking for a starting point... Basically how do encode at least 19,200baud digital data across an RF circuit without going thru development/testing/simulation hell... :)

Thanks in advance for any suggestions...
 
Last edited:
simple bit rate FM deviation 1/4 of carrier 4x bit rate minimum ( less with more sophisticated filtering otherwise more jitter.) or go as slow as you want. use Async or biphase with sync word. or ...

NE565/7 500kHz
4046 2.4MHz 16V logic
4046 38MHz 2~6V logic <<<<

The last is a clear analog choice, easy to use but you must have a good RF BPF front end with the correct bandstop rejection and low group delay distortion and decent impedance match to rail to Tx for efficient use and adjacent channel interference etc.

https://www.digikey.com/product-detail/en/CD74HC4046AMT/296-32068-1-ND/3505836
 
Hi,

I am not into model trains but this sounds like fun.

I like the direct DC modulation idea too. If you modulate it by plus and minus 1/2 volt for example then you can amplify that to meet the uC requirements. You can also low pass filter the signal to drive the engine motor, if needed that is.
So at 20 volts it would switch from 19.5 (a zero) to 20.5 (a one) and the detector would amplify the AC part of the signal which would be a 1/2 volt peak square wave. Reference that back to 0v and amplify, you've got your 5v signal.
All the while the motor sees 20v, because the engine motor LP filter averages out the excursions back into a smoother 20vdc.
 
Likely all one needs is 10mV of carrier well filtered to/from 50 Ohm into 10.7MHz IF Xtal filter BPF . More is gravy.
 
Last edited:


Oooooh! Now you got my attention! I was just about to place an order for a few CD4046 ICs and plan to bunker down for some breadboarding development --- This one looks interesting!

Thanks for the find!

Ted
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top