Need Help with light sensor and motor

Hello,

I’m new to electronic/mechanical kits and could use some help for a project I’m working on. I want to detect a light source and if it detects light, then operate a servo motor to rotate a certain amount. If there is no light it stays in one position, if there is light, the motor turns. Can anyone help with what parts I might need from sparkfun? I think I need:

1x light sensor

1x servo motor

where would my power come from? how to find a light sensor that works with the servo motor? Can you help point to specific products here that would work together?

Thanks for the help!!

Steve

You want a photocell (photoresistor, light detector, photoconductive cell… they have a few names, but most work basically the same.)

https://www.sparkfun.com/products/9088

As for a servomotor… well… it depends entirely on the needs of your project, and you’re the subject matter expert on what your project needs.

https://www.sparkfun.com/categories/245

Things to consider when picking the servo are the size of the housing (you want it to fit in your project), range of motion (a 180 degree servo is useless if you need 360 degrees of motion or even continuous rotation), torque (how “strong” the servo is), and power requirements.

A few considerations: Your power is going to come from your house power supply in one shape or another… While a servo is on, it’s always drawing full power, regardless of the position it’s in, because it needs power to keep it in that position. This will drain batteries very quickly.

Thus, you’ll need a power supply. I like the USB based phone charging wall warts, personally, because they produce a nice 5V and at least 0.5A, with my preferred ones going up to 2A.

https://www.sparkfun.com/products/11456 will give you everything you need.

https://www.sparkfun.com/products/13831 is the Tim “The Tool Man” Taylor’s Tool Time Approved ™ USB charger. More power, aroooo-oooh-ooooh-ooooh! (More power does not necessarily translate into a better product for your task, although if you choose a higher voltage servo and need to step up the power, you may want the higher amps provided by this wall wart.

And, if you’re going 9V, https://www.sparkfun.com/products/298 is the old standby.

Now the next question you need to ask is, how do you get the sensor data from the photocell to be meaningful to the servo?

You need some sort of logic in between. You can build your own logic circuit that will detect when the voltage coming through the line that has your photocell hits a certain threshold, which then activates some control circuitry that will power the servo and provides the data to tell it which position to move to, including the painful work of fine tuning a 555 timing IC… (definitely not beginner stuff)

Or you can pick up a microcontroller. Arduinos are all the rage right now. They’re easy to use, powerful, and cheap.

There are several versions of Arduinos out there, from ones built and designed by the actual Arduino team themselves to other ATmega based systems that expose or simplify other aspects of the microcontroller, reducing price further, exposing more IO pins, moving USB features onboard or letting power management be handled entirely by the user…

For someone’s first venture into microcontrollers, I suggest picking up an Arduino Uno R3.

https://www.sparkfun.com/products/11224

SparkFun also makes their own Arduino Uno clone, the RedBoard: https://www.sparkfun.com/products/12757 I can’t vouch for it myself, but the next time I’m picking up an Uno compatible Aurduino clone, this is the one I’m grabbing.

And, if you want to get brief taste of the vast possibilities available with Arduinos, I suggest picking up the official Starter Kit: http://www.arduino.org/products/kits/6- … tarter-kit (It includes a book with several recipes to build different things, so you’re not just given a box of sensors, resistors, LEDs and transistors and expected to make something out of them without being shown how… Oh, and never feel bad if you blow up an LED, that’s what they’re there for; to teach you Ohm’s Law.)

Putting it all together:

You want a photocell… not much choice there.

Pick your own servo, you’re the expert and there are too many choices for us to pick for you.

Grab a microcontroller board… For your first one, I personally suggest an Arduino Uno or clone. You really don’t want to deal with a 555 timer. Lots of math involved. Lots of opportunities to release the magic blue smoke.

Breadboard. Did I forget to mention a breadboard? Yep, grab one if you don’t already have one. A half-sized one will do well.