Sending button presses down a power supply wire - Page 1
Forum section: electronics / projects

author: microbug
author_rank: Frequent Contributor
timestamp: October 20, 2014, 03:48:03 pm
content: I'm making a project which involves powering three high power LEDs in a bike light with a constant current boost converter (mounted elsewhere on the bike). I can either have a two or three pin connector going to the bike light. I'd prefer two pins, because it means less wiring, and I'm already doing a custom driver PCB and a custom PCB that goes in the bike light itself. The LED driver changes current with a button press input.How could I send a button press over the power cables for the bike light? So far, I was thinking of a 555 in the bike light with an AC coupled output, going to the high side cable and adding a 50khz square wave to it when the button is pressed. On the other side, I could sense it with an AC coupled peak detector and a comparator going to the MCU. Since the LED driver is constant current, I'd put a 500ohm or so resistor so the 555 gets power when the light is off.Is this going to work?

author: JVR
author_rank: Regular Contributor
timestamp: October 20, 2014, 08:27:57 pm
content: Depends on the impedance of the circuit how much signal you are going to get. It also needs to be way above the boosters ripple control freq. Its a simple circuit, breadboard it.

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: October 20, 2014, 08:46:50 pm
content: i used a TDA5051A as a PLC modem once, it can send serial data over DC power line too. It use a UART interface, for your case, you using a simple button , you wire it to data-in with a pull up resistor, on the other side you will get the button position out of data_out pin ,as simple as that.

author: microbug
author_rank: Frequent Contributor
timestamp: October 20, 2014, 09:14:56 pm
content: Thanks, @hamdi.tn and @JVR.The circuit is pretty low impedance – it travels over around a metre of wire, but the wire is very thick (so that it copes with 3A without a big drop). The boost controller is an LED6001. It doesn't specify ripple, but I'll put an LC filter (maybe second order) on the output so it should be acceptable.The TDA5051 looks great - thanks!

author: SL4P
author_rank: Super Contributor
timestamp: October 20, 2014, 09:35:09 pm
content: Bridge rectifier and capacitor at the light end.Reverse polarity with button press - and detect it before the bridge.

author: David_AVD
author_rank: Super Contributor
timestamp: October 20, 2014, 10:46:46 pm
content: Could you use a momentary break in power to change the setting, much like the stepped dimming light switches do?

author: Marco
author_rank: Super Contributor
timestamp: October 21, 2014, 12:21:40 am
content: I'd have the button activate a CMOS inverter oscillator at say 1 kHz, put a C-R differentiator behind it which switches on a transistor for a couple 10s of ns to pull down the voltage across the LEDs through a couple Ohm resistor. Add a couple uH of inductance on the positive lead of the cable with some beads at the control box.Pretty sure you'll get enough signal to detect that way ... and next to no idle current consumption thanks to the CMOS inverter.ps. not FCC legal :p

author: SL4P
author_rank: Super Contributor
timestamp: October 21, 2014, 01:01:30 am
content: Bridge rectifier and capacitor at the light end.Reverse polarity with button press at the supply end,and detect itbeforethe bridge with a resistor and diode!-- No extra wires or installation, $2 done.

author: sacherjj
author_rank: Frequent Contributor
timestamp: October 21, 2014, 01:49:13 am
content: Quote from: SL4P on October 20, 2014, 09:35:09 pmQuite a bit of losses through two diodes at 3A.

author: SL4P
author_rank: Super Contributor
timestamp: October 21, 2014, 01:50:35 am
content: Current going through bridge - not the detector diode

author: Marco
author_rank: Super Contributor
timestamp: October 21, 2014, 04:41:18 am
content: He wants to detect a continuously depressed button as well (only mentioned in another thread).

author: SL4P
author_rank: Super Contributor
timestamp: October 21, 2014, 04:44:00 am
content: A little more complicated - but shouldn't be much.The bridge & capacitor do the 'dirty work'He just has to sense when the the reverse biased diode is upside down.

author: microbug
author_rank: Frequent Contributor
timestamp: October 21, 2014, 06:18:51 am
content: You're right @Marco! I should have mentioned that. The TDA5051 will do that fine, though.

author: mikerj
author_rank: Super Contributor
timestamp: October 21, 2014, 11:37:14 am
content: Quote from: microbug on October 20, 2014, 09:14:56 pmTo be able to inject an AC signal the power circuit will need to have a reasonable amount of impedance at the signalling frequency. To achieve this you may need to add a suitably rated inductor to the output of the driver. You'd need to make sure that any inductance doesn't cause instability (constant current+inductive loads can be very tricky).I think I'd be looking at a three core cable to be honest...

author: microbug
author_rank: Frequent Contributor
timestamp: October 21, 2014, 02:40:28 pm
content: Quote from: mikerj on October 21, 2014, 11:37:14 amOK. If it's not possible, I will just go with a 2-core power cable + auxiliary (thin) button cable.

author: fcb
author_rank: Super Contributor
timestamp: October 21, 2014, 05:08:15 pm
content: Put a diode or two in your supply line to the lamp, and a MOSFET across the diodes. Keep the MOSFET turned on until you want to send data - just use a UART in your micro to send a byte or two.Your receiver can be a comparator that uses a pair of potential dividers - say set to 3v0 (-input) and 3v2 (+input). Then just slug the -input with a decent size electrolytic. Use something like 1200bps data rate.

author: microbug
author_rank: Frequent Contributor
timestamp: October 21, 2014, 07:32:04 pm
content: Quote from: fcb on October 21, 2014, 05:08:15 pmI assume you mean a MOSFET in series with the diodes? That should work; I'd have to protect the input of the transmitter with a zener as the LED driver is constant current.EDIT: There is OVP on the LED driver, which will be set to around 15V. I could probably drive a 555 directly with that. I will probably power it from an electrolytic cap (charged through a diode). I'll use a 555 since I'm only sending the button state.EDIT 2: Oh! I see what you mean (or at least, I see a better way). To minimise the down time on the light, a small MCU (powered with a zener & cap) can sense button presses and then transmit the relevant data for a very short period. This way the flicker might not even be visible (as you said, there's only a byte (max) to send).EDIT 3: The OVP of the LED6001 is latching as well, so the MCU could restart it after the DAC has been set.

author: SL4P
author_rank: Super Contributor
timestamp: October 21, 2014, 09:11:19 pm
content: I'm guessing there's a filter on my suggestion for Bridge + CapOh well.

author: microbug
author_rank: Frequent Contributor
timestamp: October 21, 2014, 09:12:58 pm
content: QuoteI'd go with the former, if it makes you feel better!

author: SL4P
author_rank: Super Contributor
timestamp: October 21, 2014, 10:55:08 pm
content: sighs.Thanks - but it's probably too late!

author: Marco
author_rank: Super Contributor
timestamp: October 21, 2014, 10:58:02 pm
content: Quote from: fcb on October 21, 2014, 05:08:15 pmOr a high current off-mom switch.

author: fcb
author_rank: Super Contributor
timestamp: October 22, 2014, 06:55:09 am
content: The two diodes in series create an approx. 1.2v drop on the supply line when the bypass MOSFET is off, and virtually no drop when the MOSFET is on. No need to interrupt the supply at all.Just send data when you need to signal an event.

author: microbug
author_rank: Frequent Contributor
timestamp: October 22, 2014, 05:41:15 pm
content: @fcb – ah, I see what you mean. That is a very elegant solution! There won't be any noticeable flicker or dip in light output at all that way. It should work, since the front light's button is illuminated so when the light is off it still draws current. I think I understand what you mean for the receiver: two voltage dividers set to slightly different voltages on a comparator, and one with a fairly large cap so that when the button is pressed the other is pulled lower and the comparator triggers.Another way to do the negative comparator input for the receiver would be a sample and hold circuit (MCU triggers resample every 10 seconds to account for thermal derating, but not if a button press is detected).

author: fcb
author_rank: Super Contributor
timestamp: October 22, 2014, 06:19:24 pm
content: Quote from: microbug on October 22, 2014, 05:41:15 pmAs you don't need big diodes (1N4001's will be OK, as the average current drawn through them will be small), so the current draw from the micro/comparator/potential dividers should be enough to create a decent drop.Yup, sample and hold would work fine, but probably over-egging it. Set the time-constant using the potential divider & slugging capacitor. Probably also worth adding a hysteresis resistor from the output of the comparator to one of the inputs. LM393 would work fine.

author: microbug
author_rank: Frequent Contributor
timestamp: October 22, 2014, 07:09:47 pm
content: I'm sceptical about using a potential divider & cap. Since I want to detect a held button, the time needed for recovery between button presses would have to be a few seconds. This could make cycling through different modes tedious. TL082 JFET op-amps (high input impedance is ideal for a sample and hold circuit) are £0.15 in one off quantities, and there's already a micro in the receiver end which can control the sampling.EDIT: I just realised this: there are two ways of doing it.– MCU in the transmitter which sends data to the receiver by pulsing the MOSFET across the diodes after a button press (short transmit time)– No MCU in the transmitter; sample and hold in the receiver; send button presses by turning off the MOSFETs while the button is held.I'm not sure which to go with – I need to think whether I might want an MCU in the transmitter anyway for other purposes.

author: fcb
author_rank: Super Contributor
timestamp: October 22, 2014, 07:21:14 pm
content: I assumed that you would have an MCU in both ends.But if you didn't want the MCU in the TX end, then you could just use a 555 set to a 1KHz and 1-2% duty cycle to switch OFF the bypass MOSFET. Press button to activate. The RX code to detect the pulses should be trivial.

author: LabSpokane
author_rank: Super Contributor
timestamp: October 22, 2014, 10:30:14 pm
content: Fcb,I'm with this whole deal, right up until the "slug capacitor". Can you explain more about it and it's location? Thanks!

author: aargee
author_rank: Frequent Contributor
timestamp: October 23, 2014, 03:15:59 am
content: Why not a simple $5 UHF wireless remote control/Tx-Rx combo and avoid the cable all together?

author: microbug
author_rank: Frequent Contributor
timestamp: October 23, 2014, 05:59:44 am
content: @aargee, I'm already doing custom PCBs for the front light and LED driver PCB. It makes sense to use the cable, and it's cheaper than $5 in terms of BOM.

author: fcb
author_rank: Super Contributor
timestamp: October 23, 2014, 08:39:40 am
content: Quote from: LabSpokane on October 22, 2014, 10:30:14 pmSee attached image.The aim of the slugging cap (shown on the sketch as 100uF), is to create a (tracking) reference voltage for the comparator that is largely unaffected by the AC component (data) of the supply rail.If your +BATT is say 7.2V, then your main rail will idle at 7.2V, but drop to ~6.0V during signalling.The non-inverting comparator input will idle at 3.2V, and drop to ~2.67V during signalling - however the slugging capacitor will maintain the reference at 3.0V during signalling (it will drop a little, but not enough to have an impact, assuming low duty cycle messages).If you replaced the UART with a switched 555 timer (1KHz, 5% duty cycle), the reference voltage would only drop to:1.2V*5% = 0.06V7.2V-0.06V = 7.14V7.14V/(potential divider) =3.17VWhich wouldn't do much to compromise the noise margin.You could easily get away with one diode instead of two.

author: LabSpokane
author_rank: Super Contributor
timestamp: October 23, 2014, 12:25:04 pm
content: Thanks! That makes perfect sense.

author: microbug
author_rank: Frequent Contributor
timestamp: October 26, 2014, 01:58:45 pm
content: Just a quick update: I'm going with fcb's solution (MOSFET and diodes), with a small MCU in the front light. The MOSFET will be ON by default (to minimise power loss), and when there is data to be sent, it will first go OFF to tell the receiver that there is data to come before it sends it.The MCU needs to get power when the light itself is off: I will put a resistor in series with an N-Channel MOSFET (with a pull-up resistor) so that the constant-current source can try to put out 10mA by default. This will give the circuit 5-6V, which I'll drop to 3.3V for the MCU with a low power LDO. I'll pulse the PWMI pin on the LED6001 every second or so on the driver – it resets the latching OVP so when the light is plugged in it will work.The MCU will run at a fairly low frequency so it shouldn't consume too much current.

author: fcb
author_rank: Super Contributor
timestamp: October 26, 2014, 02:09:39 pm
content: Quote from: microbug on October 26, 2014, 01:58:45 pmYes, keep the MOSFET on most of the time - you'll find that the MCU UART TX pin will idle high anyway (that's if your using an on-board UART).You may find that the RX MCU + comparator + voltage regulator Iq will be more than enough to give you a Vfwd drop for good communications.