Using npn transistor as a switch to ground

Thread Starter

Tkay61

Joined Jan 11, 2022
2
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:


circuit.jpg
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
 

crutschow

Joined Mar 14, 2008
30,116
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?
 

Ian0

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