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.

Pic MCU + Photoresistor question

Status
Not open for further replies.

keny

New Member
hello, I am new here!

I am trying to solve a problem and I think there is a standard way to do what I want to do but I am not sure. Here is the setup:

I have an array of photo resistors. I want to measure the voltage of each one but I don't have enough A/D's on the MCU. I propose this solution:

use a multiplexer and scan through the array of photo resistors(16!) taking individual readings off of each one from a single AD port.

Here are the issues:

I would rather prepare the circuit for logic outside of the MCU but in the bright light the voltage difference is .2 to .4 volts and in the dark the difference .6 to 2.6 volts, and I want to be able to accommodate both ranges.

not sure how to handle this. any suggestions? what more information can I give? i would be willing to swap out photo resistors for something else that can detect a pen laser as necessary... IR?

Regards,
Keny
 
Do you have a 16:1 analog (not digital) multiplexer in mind?

Do you have a part number of the Photoresistors you plan to use?

Are you willing to add an opamp to the mix?

What is the voltage range of the ADC input?
 
hey Mike! thanks for the response!

I am currently testing with an HCT138 but that was what I used for an LED array and it was laying around..
Also radio shack 5pack photo resistors for the time being, rough i know, i will hit digikey when I get a better scope of what is going on.
I am perfectly fine with adding 16 op-amps, monostable multivibrators and whatever to the mix as needed.
I'm pretty sure the A/D via PIC18f2550 is pretty capable of doing what I need. there are two comparator modules on board, as well as just about everything else under the sun...

but in all reality, what I need is to trigger the ambient reflection of a pen laser at several places for an art project. There is a lighting display that causes fluctuations in light and I need some way to react to the curve of resistance caused by a photocell when subjected to changing lights, ending up in boolean true/false, yes the laser was tripped, no it was not. The laser is reflecting all over the place and I am detecting where it is triggered and changing the lighting accordingly. I dont feel IR would be suitable.

So basically heres the formula and what I need:

Bright ambient Light -> photocell range very small when laser is tripped(.2 to .4V), threshold voltage is .3V
Dark ambient light - > bigger photocell range(.6 - 2.6V), threshold voltage is 1.5V
I need a method to auto-detect the different lighting scenarios and set the threshold accordingly. I either need a good logic signal to send the microchip or to use the features of the microchip to handle the situation.
 
What causes changes in lighting level? Motion? Why not use an AC-coupled amplification between the LDR and the detector? That way, slowly changing illumination levels get removed, leaving only the motion induced changes?
 
So basically heres the formula and what I need:

Bright ambient Light -> photocell range very small when laser is tripped(.2 to .4V), threshold voltage is .3V
Dark ambient light - > bigger photocell range(.6 - 2.6V), threshold voltage is 1.5V
I need a method to auto-detect the different lighting scenarios and set the threshold accordingly. I either need a good logic signal to send the microchip or to use the features of the microchip to handle the situation.
The logarithmic response of the photo resistor can be a problem in bright light, as I found out investigating a solar tracker. Putting a dark lense over the ldr will shift the lux response at bright light to a steeper part of the voltage curve that you witness at low light.

Using Taos light to voltage photodiodes give a linear response (op-amp built in) which could be helpful developing the triggering algorithms.
 
No need to waste A2D inputs for reading LDR's, the more usual technique is to use the LDR to charge a capacitor and time how long that takes. The Joystick tutorial in my PIC tutorials uses the exact same technique.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top