Go Down

Topic: How Many Photoresistors can I use . . .? (Read 1 time) previous topic - next topic

Zwithak

I have an idea for a project (for school) that includes the usage of photoresistors. I'm new to Arduino but I have time to learn how to use it, but before I try and continue with this project I would like to know how many photoresistors can I connect to an arduino unit and if there is a way to increase the maximum (staying within a $120 budget mind you; it's a group project so the cost is split).

Currently I would like to be able to utilize 6 photoresistors and be able to send information to my computer from these resistors. I plan on taking that data and running it through a program and depending on a combination of true-false statements I would create outputs (basically if they are receiving above a light level or not).

If this is possible please let me know, I've only seen people connect a single photoresistor from a breadboard --> arduino --> computer and noted there is a finite number of ports on the Arduino that can be accessed so I'm sure there is a limit but I'm not sure what it is.

Also, is there a way I can circumvent the Arduino entirely and connect the breadboard to my laptop?

capicoso

Yes, you can connect six LDRs. Each one on each analog input. If you want you can expand your analog inputs with multiplexers 4051(8 in) 4067(16 in) or others... With 6 4067 for each analog input you can have up to 96 LDRs.
Once your project is finished, if you have an arduino UNO or olders which have the atmega328 as a DIP with a socket, you can take it off the arduino, and build it with few components on the breadboard, but, the usb part is hard, what most do is power if from the dc jack ... but you need to communicate to your computer, i don't know which protocol you would use, if you need usb or not...

JimboZA

Quote
Currently I would like to be able to utilize 6 photoresistors and be able to send information to my computer from these resistors. I plan on taking that data and running it through a program and depending on a combination of true-false statements I would create outputs (basically if they are receiving above a light level or not).


I'm wondering why you would take the data to your computer to decide what the outputs would be.... why not just get the Arduino to do that?- that's basically what it does: read sensors, compare sensors to thresholds, do stuff based on that comparison (or combinations of).
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Zwithak

#3
Oct 03, 2013, 06:27 pm Last Edit: Oct 03, 2013, 06:37 pm by Zwithak Reason: 1

Quote
Currently I would like to be able to utilize 6 photoresistors and be able to send information to my computer from these resistors. I plan on taking that data and running it through a program and depending on a combination of true-false statements I would create outputs (basically if they are receiving above a light level or not).


I'm wondering why you would take the data to your computer to decide what the outputs would be.... why not just get the Arduino to do that?- that's basically what it does: read sensors, compare sensors to thresholds, do stuff based on that comparison (or combinations of).

I might do just that then. Like I said I'm new to Arduino so I am not 100% how it will work; really what I am trying to do right now is figure out if it could work so I can carry through with the idea, and if it wouldn't I would simply come up with something else (or go along with something someone else in our group came up with).

This is a rough draft of the main pseudo code for the program:
photoresistor submits a new value to be stored as a variable P1 whenever its light level changes to be below x // there are a total of 6 P's: P1, P2, P3, P4, P5, P6
if P1 <  X execute program_1
if P1 < X && P1 == P4 execute program_1
if P1 < X && P1 == P5 execute program_2
if P1 < X && P1 == P6 execute  program_3
(and so on and etc until all the possible potential combinations are made)

JimboZA

You may find this tutorial useful.

Have a look here to compare the number of analog input pins across the Arduino range.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Zwithak


You may find this tutorial useful.

Have a look here to compare the number of analog input pins across the Arduino range.

Because I only need 6 inputs does that mean the Arduino would suffice as it's Analog In/Out is 6/0?
What am I looking for exactly?

JimboZA

When you say "the Arduino" I guess you mean "the Arduino Uno", since they're all Arduinos. (Or is that Arduinoes?)  8)

You need analog inputs to read an LDR, so yep the "6" of the "6/0" is what you want.

But remember you will then drive some outputs... don't know what you have in mind.... lights?... fans?... motors on curtains? whatever?... so you need enough plain digital and or pwm digital pins to do that.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Zwithak


When you say "the Arduino" I guess you mean "the Arduino Uno", since they're all Arduinos. (Or is that Arduinoes?)  8)

You need analog inputs to read an LDR, so yep the "6" of the "6/0" is what you want.

But remember you will then drive some outputs... don't know what you have in mind.... lights?... fans?... motors on curtains? whatever?... so you need enough plain digital and or pwm digital pins to do that.

Ha, yeah I forgot to add the "Uno" after Arduino.

Really all I wanted was a way to process the information given by the 6 photoresistors so I doubt I'll need anything fancier (so no motorized curtains today) so I imagine the Uno will suffice quite nicely.

Go Up