Easy Way to Control LEDs, or Photoresistor vs Monitor

The magic smoke.

Moderators: phlip, Moderators General, Prelates

User avatar
Jorpho
Posts: 6212
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Easy Way to Control LEDs, or Photoresistor vs Monitor

Postby Jorpho » Fri Sep 13, 2013 4:38 am UTC

I've been building this little DIY electronics project (hooray for surface-mounted components!) that is supposed to be programmable via two photoresistors. Ideally, you're supposed to hold the photoresistors up to a computer monitor and run a program (open source, of course) which will rapidly alternate areas of the screen between white and black. This, alas, is not working, presumably because I cannot get the brightness of my monitor up high enough. The best I've been able to do so far has been my ancient CRT, but it seems the 60 Hz refresh rate is no good.

The doohickey definitely works, as it will register changes in the photoresistors if I wave a bright flashlight in front of them, or even hold it up to a sufficiently bright lamp. I'm thinking if worst comes to worst, I could hook up a pair of LEDs to my computer somehow – but what would be the best and cheapest way to do that? I'm thinking I could jab their leads into serial cable (i.e. DB9), but would a serial port offer enough flexibility to arbitrarily control the signal? Could I do that with Python?

Alternatively, if you know of a similar project that works in a similar way and have clever suggestions as to how to get the photoresistors to behave, I'd love to hear them. (It's possible some of the components in the circuit just need to be adjusted; I'm still waiting to hear about that.)

User avatar
scarecrovv
It's pronounced 'double u'
Posts: 674
Joined: Wed Jul 30, 2008 4:09 pm UTC
Location: California

Re: Easy Way to Control LEDs, or Photoresistor vs Monitor

Postby scarecrovv » Sat Sep 14, 2013 3:49 pm UTC

Could you post a schematic of your circuit? Presumably your circuit works by comparing the resistance of your photoresistor to a reference resistor, perhaps with a voltage divider and a comparator. Try adjusting the reference resistor to change the threshold of your circuit. Also, try measuring the resistance of your photoresistor while your monitor is white, and while it is black. That way you can see what resistances your circuit needs discern.

User avatar
Jorpho
Posts: 6212
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Re: Easy Way to Control LEDs, or Photoresistor vs Monitor

Postby Jorpho » Sat Sep 14, 2013 9:54 pm UTC

Indeed, I ended up changing two of the resistors today and it now functions adequately with my LED TV with the brightness turned up. I guess that's the easy way of doing it. :)


Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 3 guests