Opto switching to replace mechanical button

Thread Starter


Joined Jul 28, 2011
I have a battery operated circuit that is triggered by a mechanical push button. What optical component could I use that when I cover it with my figure it triggers a mosfet. 4.2 v battery.
Want an optical button I guess.
The push button triggers the mosfet which switches a large resistive load. Nice to change the mechanical button to a touch sensor or ir sensor
Last edited:


Joined Mar 30, 2015
Post a schematic of how the mechanical switch triggers your circuit so we don't have to play 20 questions.


Joined May 29, 2016
You may want something along the lines of this

Basic Optocoupler NPN circuit.png

...which was taken from a Lewis Loflin video on Opto circuits which you can watch here....

Good luck


Joined Mar 30, 2015
You could use a voltage divider consisting of a light dependent resistor (LDR/photocell/photoresistor) and resistor on the gate of the N channel MOSFET.

For more abrupt switching action and/or hysteresis, you could add a comparator.