1

I am using the circuit diagram below to turn ON/OFF the lights using Photo-resistor.

How can I use the Arduino to bypass the Photoresistor effect? Let say I want to turn ON the lights even though Photoresistor doesn't want to.

Take note the 12V source is required by the LED. Knowing that Arduino must work with max 5V.

enter image description here

1

You could replace the circuit with these:

  • Use one Arduino analog input to measure the light.

  • Use a Digital Out (Preferable PWM) to control the LED.

Then you can apply whatever logic you want.

schematic

simulate this circuit – Schematic created using CircuitLab

  • 1
    Among the other answers, this is the best, especially because: 1) The arduino can read the light intensity. 2) You can choose of having the LED either on or either off, or its intensity to be inversely proportional to the amount of light 3) you can easily add hysteresis by software 4) you can choose the threshold level, without having to change the pull-up resistor. One thing though: i would put R1 connected to the arduino GPIO and not to the gate, so that there won't be any divider. M1 must also be a 5V logic level MOSFET. Or you can use a BJT. – next-hack Sep 15 '17 at 12:38
0

Be careful with the 12V, the Arduino can not handle 12V at its pins.

The input can be the photoresistor with a resistor to 5V (not to 12V). Use a analog input to measure the amount of light.

The output can be with a resistor to the base of the transistor.
This is an example: PighiXXX transistor
Any unused digital output can be used.
Why do you need 12V for the led ? Is it a special led ?

0

There are several ways to add Arduino control; the question doesn't provide quite enough information to say which is best.

One of the simplest methods is to use a diode to clamp the transistor's base voltage to at most 5 V, as shown in the following diagram.schematic with diode clamp added The voltage at the IO pin cannot exceed 5 V plus one diode drop.

With this circuit, setting the IO pin to be an input leaves the LED under photoresistor control. Setting the IO pin as a low output turns off Q1, and setting it as a high output turns on Q1. Note, R3 should limit the current drawn from the IO pin to at most about 25 mA, so 150 to 200 Ω may be suitable.

  • 1
    Yay! A fellow gschem user! ;) – Majenko Jul 15 '17 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.