Author Topic: PWM using Photoresistors  (Read 1484 times)

0 Members and 1 Guest are viewing this topic.

Offline sgonzalezp

  • Contributor
  • Posts: 7
PWM using Photoresistors
« on: September 27, 2012, 03:40:16 am »
Hi I'm new to interfacing the PIC micro controllers... I have begun by using a PIC18F4550 and using simple LED applications to get started with the interfacing... My scope for my project though includes using photo resistors as an input for the PIC would analog or digital be best? For the LEDS on the output I was thinking digital because it is based on a scale from 1-255 correct in terms of brightness/dimness. I would like it so that several photoresistors are in series with one another and depending on how man of the photo resistors the user waves their hand across or the velocity...will determine the duty cycle of the leds in series in a contrasting background...I'm not asking for the answer, I'm asking for all the right resources and/or references for doing this because it is part of my assistive technology project and I'm ambitious to make this happen!

THANKS in advance!
 

Offline johnnyfp

  • Frequent Contributor
  • **
  • Posts: 258
  • Country: nz
Re: PWM using Photoresistors
« Reply #1 on: September 27, 2012, 03:16:05 pm »
I'm assuming that you are choosing the 18f4550 because it's readily available in dil package, and want other bread board or Vero board it?  Reason I ask is there are better pic chips with more  PWM outputs in a smaller package that might be better suited for example pic18f27j53 which has 10 Adc and 10 PWM

Probably the simplest circuit would be to putty the ldr in a resistor  voltage divider connected to the adc ports and then drive the leds with a resistor directly from the pwd ports.

Sample the adc and convert into a duty to output. After getting that working you can start playing with multiplexing the output to get more leds and start doing some funky stuff.

Keep it simple to start off with, both in code and hardware then build on that.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf