danners430
Member
Hey guys,
Is there a way to detect polarity? I'm designing a custom DCC function decoder (yes, WestAust...), which is going perfectly fine... except now I've realised I might wanna see if I can make it work on DC too.
A little basic background - DCC is a communication protocol for model railways encoded in a 12-20V DC alternating square wave power signal, so for the purposes of power delivery can be considered AC. My decoder can decode the signals encoded within this signal no problem. However, many people still use "traditional" DC control - a simple analogue 0-12V power signal, which is connected straight to the motor inside a model train - reversing the polarity reverses the train.
As the decoder is designed to work with "AC", the reverse polarity won't affect it in terms of powering up correctly (as soon as the power reaches about 5V, as the MCU is running at 3.3V). However, on DC I want to be able to detect the polarity, so I can tell which direction the train is going, to activate the correct sets of head / tail lights. And, of course, this detection method is going to have to be able to handle the high frequency "AC" of DCC when in "normal" operation...
Does anyone have any suggestions?
Cheers!
Is there a way to detect polarity? I'm designing a custom DCC function decoder (yes, WestAust...), which is going perfectly fine... except now I've realised I might wanna see if I can make it work on DC too.
A little basic background - DCC is a communication protocol for model railways encoded in a 12-20V DC alternating square wave power signal, so for the purposes of power delivery can be considered AC. My decoder can decode the signals encoded within this signal no problem. However, many people still use "traditional" DC control - a simple analogue 0-12V power signal, which is connected straight to the motor inside a model train - reversing the polarity reverses the train.
As the decoder is designed to work with "AC", the reverse polarity won't affect it in terms of powering up correctly (as soon as the power reaches about 5V, as the MCU is running at 3.3V). However, on DC I want to be able to detect the polarity, so I can tell which direction the train is going, to activate the correct sets of head / tail lights. And, of course, this detection method is going to have to be able to handle the high frequency "AC" of DCC when in "normal" operation...
Does anyone have any suggestions?
Cheers!