Reverse engineering a simple analog trigger circuit - Page 1
Forum section: electronics / beginners

author: Majek Ondrovic
author_rank: Contributor
timestamp: August 25, 2020, 04:29:45 pm
content: I'm trying to recreate whatever circuitry exists inside my DMX lighting board that allows for an external "Analog DC Trigger" they call it. It essentially has several GPIO triggers, "contact closures", that are tolerant up to +15v. It also provides +5v out if there's no external voltage, however I want to make my own circuit provide 3.3v out instead and work with voltages as low as 3v.I attached a simplified schematic - the block is what I'm trying to recreate. When the external switch is closed, it will send a high signal to the MCU and it will go low when the switch is open. If there's some simple way to do this with jellybean parts that would be ideal.Thanks!

author: ataradov
author_rank: Super Contributor
timestamp: August 25, 2020, 07:47:59 pm
content: You also need to specify your EMI protection requirements. The most basic circuit that will work is a simple diode clamp. Something like thisYou would want to put a pull-down resistor on the "ADC" side of the schematic.If 3.0 V (minus some drop) is not enough to satisfy the "TTL" requirement, then you can further buffer that voltage with a transistor or a simple buffer gate.A real protection against EMI gets a bit tricky. The easiest way to solve both buffering and EMI problem is to feed the "ADC" signal into the optocoupler.

author: Ian.M
author_rank: Super Contributor
timestamp: August 25, 2020, 09:25:10 pm
content: It would help determine the required specifications if you measured the current through the switch. Just connect your multimeter on a mA current range between your DMX board's +5V out and DC Trigger in.I suspect that the easy option would be an 'over-the-top' comparator with a potential divider setting a reference voltage of 1.6V. That would give you the wide input voltage range capability. Its also going to need a pulldown resistor (or possibly a JFET current sink), and maybe some ESD protection. Protect the +3.3V switch power output with a 50mA polyfuse and a 30V Schottky diode, so some Muppet doesn't blow up your device by stuffing an external 12V supply up its 3.3V rail!https://www.analog.com/en/technical-articles/versatile-precision-comparator-for-status-monitoring.html

author: ledtester
author_rank: Super Contributor
timestamp: August 26, 2020, 03:18:17 am
content: Quote from: ataradov on August 25, 2020, 07:47:59 pmCould you elaborate on what kind of EMI concerns one might have?As I understand it, presumably you might have a long-ish cable running from the switch to control unit, and that might pick up electro-magnetic interference resulting in false triggerings. If that is the case, what is the general remedy? Increase the value of R1? Add some sort of shunt between the input line and ground? Use special cabling?

author: ataradov
author_rank: Super Contributor
timestamp: August 26, 2020, 03:43:50 am
content: For a simple remote switch the best you can do is shielded cable, and additional input protection, like TVS diodes and polyfuses.

author: Majek Ondrovic
author_rank: Contributor
timestamp: August 26, 2020, 05:47:07 am
content: Quote from: ataradov on August 25, 2020, 07:47:59 pmPardon my ignorance, but what function does the zener between 3.3v and the input do?I understand the zener that goes to ground now, that's definitely helpful thank you

author: ataradov
author_rank: Super Contributor
timestamp: August 26, 2020, 05:51:59 am
content: This is a standard voltage clamping circuit. Both diodes serve the same purpose - limiting the voltage to the voltage rail plus the diode voltage drop. You don't really need Zeners there, moderately fast Schottky diodes work fine. In this case it will not be used in the Zener region.The top diode will open when the input voltage exceeds 3.3 V + ~0.6V. R1 limits the current through the diode.Normally this is just a protection circuit and the diodes are never expected to be open, but in this case it also serves as voltage limiting diode, since the maximum input voltage is specified to be 15 V.

author: Majek Ondrovic
author_rank: Contributor
timestamp: August 26, 2020, 06:06:08 am
content: Oh now I see, thank you!

author: Majek Ondrovic
author_rank: Contributor
timestamp: August 26, 2020, 06:27:51 am
content: Just a total guess here but I gave another try with optical isolation and protection now on the outgoing 3.3v rail. Is the attached schematic more on target?Instead of ADC I was hoping to have it work with a regular GPI with a pullup. I know in this schematic the input is flopped but that won't matter to me on the software end.

author: ataradov
author_rank: Super Contributor
timestamp: August 26, 2020, 06:36:50 am
content: You don't need ADC, this is just an example circuit for ADC input protection, but it works for regular digital inputs too.This will work, but it is still not fully bullet-proof. You are still exposing internal 3.3 V rail to the outside world. This will not pass strict testing (10 kV discharge from the ESD gun). The input will be protected, but the 3.3 V rail will pass all the outside voltage and kill your MCU and other devices.A robust way to supply the voltage like this is to use a dedicated isolated DC/DC converter. This way outside voltage rail would be fully isolated from the inside.Again, it all depends on your requirements. You may not need any of this.Although if you are not too worried about ESD, then you don't need the optocoupler either, just connect the "ADC" line directly to the MCU pin.

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2020, 09:54:15 am
content: Quote from: Majek Ondrovic on August 26, 2020, 06:27:51 amIf you're going to use an opto-coupler, which is really only needed if you require isolation, no zeners are required, just a diode in series with the LED, to protect against reverse voltage.

author: ataradov
author_rank: Super Contributor
timestamp: August 26, 2020, 04:39:24 pm
content: This is only true if you are not expecting extreme voltages due to ESD or EMI.And you are exposing +3.3V rail on the outside of the device. This can't be good for noisy environments.