Using npn transistor as a switch to ground

Thread Starter


Joined Jan 11, 2022
Hello guys,

I have a ESP32-Cam module, which cannot use the analog pins and wifi simultaneously. In the project which I want to realize a photo must be shot when it is bright .

I use a photoresistor and wanted to ask you guys if the following circuit could work:

Both pins are set high.
If it is bright the resistance of the LDR is low and the transistor is switching which leads to the right pin becoming low.

I would be grateful for any advice or help


Joined Mar 14, 2008
That would work, but the switching from off to on would be somewhat slow (the transistor would slowly change from off to on, depending upon how fast the light changes intensity).

Is that a concern?


Joined Aug 7, 2020
Just connect the LDR between the right pin and ground, then enable the internal pull-up resistor. You don't need the transistor.