Electronic – Long distance button

distancemicrocontrollersignalvoltage

I have always had problems with my wireless doorbell solution. Since my driveway is around 50m (160ft) the signal is never quite strong enough to trigger the bell all the times.

So I was thinking about creating my own wired solution, but my question is how I would make this work.

Would a let’s say 5v DC signal be able to travel this distance and still be picked up by a microcontroller? Or is there maybe a better way to make this happen (using AC and converting it to DC at the gate)?

Best Answer

5V signal is sufficient to make travel till the end of 50 m but you cannot connect that directly to your micro controller.

Best thing is to isolate the noisy weak digital signal from the MCU port. One way is to use optocoupler as mentioned by Michael.

You can use say from example below circuit. enter image description here

  1. Replace 3.3 V (only the one connected to R1) with your 5 V supply and a series switch at the entrance.
  2. Choose a optocoupler with good CTR (current transfer ratio, higher is better)
  3. The optocoupler will turn on(the internal LED) when you close the switch
  4. It will in turn, turn on the transistor.
  5. Microcontroller will sense it because now the output is shorted to ground via transistor in the optocoupler.
  6. Microcontroller can run with independent supply. (3.3 V) for example.
  7. You have isolation between signal and MCU.. Hence there will never be pseudo triggering of the signals due to voltage coupling because of a generator close by or some power spikes..
  8. When switch is closed a finite current will flow through the series resistor and the LED in the opto coupler. Choose R according to optocoupler data sheet.

You can also use higher voltage (instead of 5 V) there by reducing ohmic losses in the cables.

This idea is feasible with just a battery for 5V side. Because the current will flow only when the user activates the switch.