Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Programming for LDR sensor

Status
Not open for further replies.

niagonia

New Member
hi..is there anyone can help me to built a program for an automatic clothes line that using LDR sensor.the clothes line will open when it can detect any light and closed back when there is no light..i really dont know how to make a program with this sensor..=,(
 
I don't know what language your using, or what micro-controller your using. But I have created a project a while ago that automatically opens / closes my blinds. :D I used an AtMega168 AVR micro-controller, and my code is in C. Basically, it uses the ADC to read how light / dark it is, then decides what to do based on the lightness value.

My Code:

Automatic Blinds Controller Code

Its really simple, once you get the gist of it.
 
This is an example of going a long way out of your way just to say that "my project uses a microcontroller"
 
hmm... Microcontroller? Can't you use something like transistor for switching the motor for the blinds or cloth line(?)
 
Exactly, why not simply use a comparator?
LM311 Light/dark detector/thermostat

The chances are you'll need an h-bridge an limit switches but it's not hard.

Heck, you could use a small SLA and solar panel so the whole thing is solar powered.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top