Hey everyone, I need a bit of advice on a project I am working on. I am trying to wire a photocell into an arduino that I am using for a small motor control. I want the motor to turn on when there is no light and off when there is light. My question is can I use any photocell to do this? I assumed that any one would work because I just needed to read the resistance, so I went ahead and bought one, the link to the exact one I bought is here:
Now that I have it here, I can test with a DMM and see resistance change between common and both of the other lines, but I have yet to figure out how to read that same change in the arduino serial monitor.
I just bought my very first arduino this weekend in hopes to learn something new, so I apologize up front for my ignorance on the subject.
so my 2 questions are:
-
can I use the 110v photocell that I bought and read the resistance through the arduino?
-
If yes to quesion 1, could someone tell me how I would need to wire the photocell to the arduino?
bslaughter5:
Hey everyone, I need a bit of advice on a project I am working on. I am trying to wire a photocell into an arduino that I am using for a small motor control. I want the motor to turn on when there is no light and off when there is light. My question is can I use any photocell to do this? I assumed that any one would work because I just needed to read the resistance, so I went ahead and bought one, the link to the exact one I bought is here:
https://www.amazon.com/gp/product/B000Z9DCF6/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1
Now that I have it here, I can test with a DMM and see resistance change between common and both of the other lines, but I have yet to figure out how to read that same change in the arduino serial monitor.
I just bought my very first arduino this weekend in hopes to learn something new, so I apologize up front for my ignorance on the subject.
so my 2 questions are:
-
can I use the 110v photocell that I bought and read the resistance through the arduino?
-
If yes to quesion 1, could someone tell me how I would need to wire the photocell to the arduino?
Don't call this a "Photocell". It is a light controlled switch for your outside lights, just as the description states. It has electronics inside, including a solid state relay to turn the lights on on off. It only works on 110-120 volt AC. There is no "resistance" to read.
Paul
So your saying there is not a photocell inside of the light switch? There has to be some resistance measured, because I can measure it with a multimeter and watch it change as I dim the lights in the room.
Just make sure NOT to connect that thing to 110V and the Arduino at the same time!!!
I'll pretend for a moment that you have a plain photocell (light dependent resistor). And if you can measure the resistance change, what you have may work.
Two resistors in series make a [u]voltage divider[/u]. If those resistors are equal, you get half the total applied voltage.
If you measure the resistance of the photocell when it's light and you choose another regular resistor with the same value, you'll get 2.5V in the light (assuming you apply 5V). That voltage will change in the dark (one way or the other, depending on which way your voltage divider is wired-up).
Thank you both for the info so far.
Doug, are you Saying that I just need to get several different sizes of resistors and keep trying them on until I can measure and get 2.5v? The switch I purchased has 3 wires in it and they are labeled as line, load, and neutral. I'm guessing that I could hook one wire to the 5v on the arduino and the resistor on one of the other wires and then hook my dmm up with one lead on resistor end and one on the arduino 5v end to check the voltage?
bslaughter5:
Thank you both for the info so far.
Doug, are you Saying that I just need to get several different sizes of resistors and keep trying them on until I can measure and get 2.5v? The switch I purchased has 3 wires in it and they are labeled as line, load, and neutral. I'm guessing that I could hook one wire to the 5v on the arduino and the resistor on one of the other wires and then hook my dmm up with one lead on resistor end and one on the arduino 5v end to check the voltage?
Hi,
No you will not get any result doing that.
You need an LDR, a Light Dependant Resistor.
How were you measuring resistance changes in the light switch you have, what DMM probes to which wires?
Tom... 
TomGeorge:
Hi,
No you will not get any result doing that.
You need an LDR, a Light Dependant Resistor.
How were you measuring resistance changes in the light switch you have, what DMM probes to which wires?
Tom... 
Tom,
I have attached a picture of the wiring diagram that came with the switch instructions for reference. As long as I have one lead on the white wire, I can put the other lead on either red or black and watch the resistance change when the amount of light changes.

The resistance on the light switch starts around 5k with direct sunlight, then at night it will go up to 55M and then the switch will open the circuit.