Prev: Magnetism is really -- WHAT?
Next: low-end scope
From: Charlie E. on 2 Mar 2010 23:16 On Tue, 02 Mar 2010 20:48:01 -0600, "neilrued" <neilrued(a)mail2Engineer.com> wrote: >>On Tue, 02 Mar 2010 13:38:02 -0700, Jim Thompson >><To-Email-Use-The-Envelope-Icon(a)My-Web-Site.com> wrote: >> >>>On Mon, 01 Mar 2010 08:54:53 -0800, Charlie E. <edmondson(a)ieee.org> >>>wrote: >>> >>>>Hi Guys, >>>>Ok, going to put myself in harms way, and ask for a little design >>>>advice. I have been working on this project for a while now, and it >>>>has gone through several iterations, and I keep having the same >>>>problem! >>>> >>>>First, the project: I am designing a small color reader for the >>>>visually impaired. >>>[snip] >>> >>>When you figure it out, let me know... >>> >>>I need to recognize the presence of large yellow objects (*) about 60' >>>from the front of the house, and sound a buzzer. >>> >>>(*) aka School Bus ;-) >>> >>> ...Jim Thompson >>Hi Jim, >>Differrent problem. Suggestion: Get a cheap wi-fi camera aimed at >>the spot. Take a netbook or other small PC, and get some of the PD >>visual processing software that should be out there for security. Set >>up a zone of interest, and trigger off yellow! >> >>I knew some guys back in my toll road days that did this kind of >>stuff. By now, it should be pretty generic... >> >>Charlie >> > >Hi, > >I would like to add something from my own experience I had several years >ago. > >I was experimenting with a phototransistor and used a voice modulated LED >to build a photonic intercom. It worked fine in daylight, then at night I >was getting a hum. > >By using an oscilloscope I discovered that when I switched off the LED >transmitter, there was a 50Hz waveform superimposed on the phototransistor >amplifier. I connected the oscilloscope to my power supply, but there was >no 50Hz leaking through. > >After a few hours of fruitless head scratching, I thought I'd turn in, get >a good night's sleep and make a fresh start the next day. When I switched >off the incandescent light, I noticed I forgot to switch off both the >oscilloscope and the phototransistor amplifier circuit, as I went to switch >the light back on, I happened to notice the oscilloscope trace was flat; no >50 Hz leakage. I then switched the light back on and the 50Hz waveform >returned, I then realised that the phototransistor was picking up the 50Hz >as interference from the incandescent light. > >I never got the chance to try out the circuit with a fluorescent lamp. > >Looking at your schematic, I cannot see any filter topology around the >MCP6024A Op Amp? Perhaps a low pass filter designed for fc <= 40Hz, with a >flat passband response may be a good option, such as a Butterworth? > >Neil > > > In my case, the object is held about 1cm from the LED and PT, with the LED at about a 45 degree angle, inside a small case with a small window. The sample is held against the window. and except in very thin fabrics, blocks about just about all the ambient light. If there is a lot of light with no LED shining, the system just says "LIGHT" so a blind person can tell if they left the lights on... ;-) Charlie
From: dagmargoodboat on 2 Mar 2010 23:54 On Mar 2, 10:29 pm, Joerg <inva...(a)invalid.invalid> wrote: > dagmargoodb...(a)yahoo.com wrote: > > On Mar 2, 9:45 pm, Joerg wrote: > >> dagmargoodb...(a)yahoo.com wrote: > >>> On Mar 2, 9:15 pm, Joerg wrote: > >>>> dagmargoodb...(a)yahoo.com wrote: > > >>>>> The RGB LED is common-cathode? Oh. Then this would work: > >>>>> +3.3v > >>>>> -+- > >>>>> | > >>>>> .--------+--------+--------. > >>>>> | | | | > >>>>> |<' |<' |<' |<' > >>>>> -| Q1 -| Q2 -| Q3 -| Q4 > >>>>> |\ |\ |\ |\ > >>>>> | | | | > >>>>> | | | | > >>>>> | | LED-R |LED-G | LED-B > >>>>> | V ~> V ~> V ~> > >>>>> | --- --- --- > >>>>> | | | | > >>>>> | D1 | | | > >>>>> +---|<---+--------+--------' > >>>>> | | > >>>>> |_ L1 --- C1 > >>>>> )|| --- > >>>>> )|| | > >>>>> _)|| === > >>>>> | > >>>>> +--->Vsense (to switching current regulator, > >>>>> | e.g. ZXSC310) > >>>>> .-. > >>>>> | | > >>>>> | | Rsense > >>>>> '-' > >>>>> | > >>>>> === > >>>>> GND > >>>>> This approach is efficient, stable, inexpensive, small, and provides a > >>>>> wide-compliance range. It needs no level-translation, which saves six > >>>>> parts or so. A resistor-DAC to the Vsense node could modify the > >>>>> individual LED currents, if desired. > >>>> A negative voltage can work and if you use FETs instead of the BJTs you > >>>> save three more parts, the base resistors. > >>> I personally like FETs; I put in the PNPs for you. They're cheaper.. > >>> <grin> > >> But only in mass production where SMT placement is cheap :-) > > >>>> However, make sure the 3.3V hangs on, is strong enough. Also the > >>>> switcher frequency must be high so load changes are handled fast enough. > >>>> C1 can't be too large. > >>> Or omit it altogether. C1's optional, really. > >> Careful, then you modulate the LED current with tons of switcher ripple. > >> That could lead to weird color shifts. > > > I actually /was/ going to suggest modulating the LEDs deliberating, Arrgh. "deliberately" > > then using a.c. amplification and synchronous demodulation on the > > detector side. That rejects ambient light and eliminates drift. > > I don't know enough about Charlie's LED but modulating might result in > it sweeping through a narrow swath of spectrum all the time. And if > Murphy strike this will modulate or beat with some other stuff from > fluorescents in the room and the poor uC doesn't know what to do with > all that. I doubt the spectral sweep's a disadvantage here, but you do have to choose intelligent chopping frequencies to avoid beats. That's easy-- just integrate over a line cycle. Half a line cycle, to reject fluorescents. > > But, Charlie doesn't seem to need that level of precision (or > > nuisance) just now. > > > (P.S. D1 = 1n914, as a gift for Tim 'The Timinator' Williams :) > > Probably more like "The Intimidator", after I saw a video of him holding > a glowing pipe upwards (!) into an induction heater coil, sans gloves. Tim's fearless, fearsome, and fire-proof. Me? I've melted metal, and I've gotten some on me. It hurts. Gloves are good. -- Cheers, James Arthur
From: JosephKK on 3 Mar 2010 00:51 On Mon, 01 Mar 2010 12:03:23 -0800, Charlie E. <edmondson(a)ieee.org> wrote: >On Mon, 01 Mar 2010 12:16:52 -0700, Jim Thompson ><To-Email-Use-The-Envelope-Icon(a)My-Web-Site.com> wrote: > >>On Mon, 01 Mar 2010 11:11:55 -0800, Charlie E. <edmondson(a)ieee.org> >>wrote: >> >>>On Mon, 01 Mar 2010 12:08:17 -0700, Jim Thompson >>><To-Email-Use-The-Envelope-Icon(a)My-Web-Site.com> wrote: >>> >>>>On Mon, 01 Mar 2010 09:30:34 -0800, Charlie E. <edmondson(a)ieee.org> >>>>wrote: >>>> >>>>>On Mon, 01 Mar 2010 10:25:21 -0700, Jim Thompson >>>>><To-Email-Use-The-Envelope-Icon(a)My-Web-Site.com> wrote: >>>>> >>>>>>On Mon, 01 Mar 2010 08:54:53 -0800, Charlie E. <edmondson(a)ieee.org> >>>>>>wrote: >>>>>> >>>>>>>Hi Guys, >>>>>>>Ok, going to put myself in harms way, and ask for a little design >>>>>>>advice. I have been working on this project for a while now, and it >>>>>>>has gone through several iterations, and I keep having the same >>>>>>>problem! >>>>>>> >>>>>>>First, the project: I am designing a small color reader for the >>>>>>>visually impaired. Really simple operation - put it against the >>>>>>>object you want to tell the color of, and it will say "RED" or >>>>>>>whatever the color is. Sensor is simply an RGB LED and a >>>>>>>phototransistor, buffered by some amps, and then digitized by a PIC24. >>>>>>>So, what's the problem? I can't get a stable reading. In normal >>>>>>>operation, this thing will run for about two seconds, and then be >>>>>>>turned off. To test, however, I run it in debug mode for hours. When >>>>>>>I first turn it on, and calibrate it to a white sample, I will get one >>>>>>>set of calibrations. Let it sit for about two minutes, and it starts >>>>>>>to drift. In about half an hour, I will have readings totally off the >>>>>>>scale. >>>>>>> >>>>>>>So, why am I baring my soul to ya'll? I need your help identifying >>>>>>>where the gain drift is coming from, and some ideas on how to control >>>>>>>them. I have the schematic here: >>>>>>> >>>>>>>http://edmondsonengineering.com/Documents/Rainbow%20color%20Reader%20Schematic.pdf >>>>>>> >>>>>>>Basic description - MCU turns on an LED. The phototransistor is first >>>>>>>buffered by a non-inverting opamp with a gain of 2, and the signal is >>>>>>>split. Part goes directly to a PGA where it is first attenuated, and >>>>>>>then the PGA boosts it up. This gives me a calibration control to >>>>>>>deal with difference in output of the LEDs. The original and PGA >>>>>>>signal are added, and this is then applied to another non-inverting >>>>>>>opamp with a gain of 2. I also have one feed before this opamp to an >>>>>>>ADC input on the PIC. >>>>>>> >>>>>>>Problems I have already solved: >>>>>>>First, each LED has a different output level. Red needs a gain of >>>>>>>around 2, BLUE a gain of around 5, and GREEN a gain of about 7. The >>>>>>>PGA was added to give me an adjustable gain from around 2 to 14, with >>>>>>>the two different taps into the separate input channels of the PGA. >>>>>>>This gives me 16 different gain levels to play with. Using the tap to >>>>>>>the second ADC channel, it actually gives me 32 different levels. >>>>>>> >>>>>>>Right now, RED uses this lower gain channel, and is steady as a rock. >>>>>>>Part of this may be that my VCC is 3.3 volts, and only RED has a >>>>>>>forward voltage below this. Both GREEN and BLUE have forward voltages >>>>>>>of 3.4 volts. >>>>>>> >>>>>>>So, potential problems? could it be that repeated use warms up the >>>>>>>GREEN and BLUE LEDs so that they become more efficient? Could the >>>>>>>power supply drift higher as it warms up? Could the opamps drift with >>>>>>>slight changes in temperature? Any advice ya'll can give will be most >>>>>>>appreciated. >>>>>>> >>>>>>>Thanks, >>>>>>>Charlie >>>>>> >>>>>>What keeps the LED's at their _constant_ current? >>>>>> >>>>>> ...Jim Thompson >>>>> >>>>>Hi Jim, >>>>>Basically, it is whatever the PIC outputs will put out. They are >>>>>rated at 18mA, but I suspect that they are putting out a whole lot >>>>>less... >>>>> >>>>>Charlie >>>> >>>>Don't you want them to stay at a constant current? >>>> >>>> ...Jim Thompson >>>Yeah, I realize this now... ;-) >>> >>>this is my first foray into photometry. Wanted something cheap and >>>easily reproducible. I just 'assumed' that an LED would give the same >>>output with the same drive... >>> >>>Oh well, I guess the boss will just fire me! >>> >>>Charlie >> >>Maybe 3xAA (or 4xAA), run uP off of two cells, then some little Mickey >>mouse OpAmp mirror games to hold the LED currents constant? >> >>Does uP have an on-board reference? >> >> ...Jim Thompson >Object is to have this as light and small as possible. Using AAs >instead of AAAs only because Serpak has their little M-6 enclosure >that fits right. Would weight too much with 3 or 4 AAs... > >Charlie If your weight budget is that bad: why not Li batteries? how about per led boost (cuk?) current output drive?
From: JosephKK on 3 Mar 2010 02:01 On Mon, 01 Mar 2010 10:55:36 -0800, Tim Wescott <tim(a)seemywebsite.now> wrote: >Charlie E. wrote: >> On Mon, 01 Mar 2010 09:57:43 -0800, Joerg <invalid(a)invalid.invalid> >> wrote: >> >>> Joerg wrote: >>>> Charlie E. wrote: >>>>> On Mon, 01 Mar 2010 09:32:56 -0800, Joerg <invalid(a)invalid.invalid> >>>>> wrote: >>>>> >>>>>> Charlie E. wrote: >>>>>>> Hi Guys, >>>>>>> Ok, going to put myself in harms way, and ask for a little design >>>>>>> advice. I have been working on this project for a while now, and it >>>>>>> has gone through several iterations, and I keep having the same >>>>>>> problem! >>>>>>> >>>>>>> First, the project: I am designing a small color reader for the >>>>>>> visually impaired. Really simple operation - put it against the >>>>>>> object you want to tell the color of, and it will say "RED" or >>>>>>> whatever the color is. Sensor is simply an RGB LED and a >>>>>>> phototransistor, buffered by some amps, and then digitized by a PIC24. >>>>>>> So, what's the problem? I can't get a stable reading. In normal >>>>>>> operation, this thing will run for about two seconds, and then be >>>>>>> turned off. To test, however, I run it in debug mode for hours. When >>>>>>> I first turn it on, and calibrate it to a white sample, I will get one >>>>>>> set of calibrations. Let it sit for about two minutes, and it starts >>>>>>> to drift. In about half an hour, I will have readings totally off the >>>>>>> scale. >>>>>>> >>>>>>> So, why am I baring my soul to ya'll? I need your help identifying >>>>>>> where the gain drift is coming from, and some ideas on how to control >>>>>>> them. I have the schematic here: >>>>>>> >>>>>>> http://edmondsonengineering.com/Documents/Rainbow%20color%20Reader%20Schematic.pdf >>>>>>> >>>>>>> >>>>>>> Basic description - MCU turns on an LED. The phototransistor is first >>>>>>> buffered by a non-inverting opamp with a gain of 2, and the signal is >>>>>>> split. Part goes directly to a PGA where it is first attenuated, and >>>>>>> then the PGA boosts it up. This gives me a calibration control to >>>>>>> deal with difference in output of the LEDs. The original and PGA >>>>>>> signal are added, and this is then applied to another non-inverting >>>>>>> opamp with a gain of 2. I also have one feed before this opamp to an >>>>>>> ADC input on the PIC. >>>>>>> >>>>>>> Problems I have already solved: >>>>>>> First, each LED has a different output level. Red needs a gain of >>>>>>> around 2, BLUE a gain of around 5, and GREEN a gain of about 7. The >>>>>>> PGA was added to give me an adjustable gain from around 2 to 14, with >>>>>>> the two different taps into the separate input channels of the PGA. >>>>>>> This gives me 16 different gain levels to play with. Using the tap to >>>>>>> the second ADC channel, it actually gives me 32 different levels. >>>>>>> >>>>>>> Right now, RED uses this lower gain channel, and is steady as a rock. >>>>>>> Part of this may be that my VCC is 3.3 volts, and only RED has a >>>>>>> forward voltage below this. Both GREEN and BLUE have forward voltages >>>>>>> of 3.4 volts. >>>>>>> >>>>>>> So, potential problems? could it be that repeated use warms up the >>>>>>> GREEN and BLUE LEDs so that they become more efficient? Could the >>>>>>> power supply drift higher as it warms up? Could the opamps drift with >>>>>>> slight changes in temperature? Any advice ya'll can give will be most >>>>>>> appreciated. >>>>>>> >>>>>> As Jim hinted, the first order of business would be to regulate the >>>>>> current that goes through each LED. A resistor that drops only very >>>>>> little voltage isn't going to cut it. >>>>> So, my first stupid mistake was using a VCC of 3.3 volts with LEDs >>>>> that required 3.4! Not an easy problem to fix. >>>>> >>>>> Makes me really wish that the PSOC1s had built in debug capability. >>>>> They could run at 5 VDC... >>>>> >>>> It can be fixed. You'd need three step-up (boost) converters and a small >>>> resistor in front to each and then regulate. If it has to be cheap you >>>> could try to regulate with the uC. Alternatively one step-up and three >>>> linear ones but LDOs are often rather buggy and if you boost to 6V or >>>> more for a proper linear regulation you'll waste a lot of power. >>>> >>>> Yet another option: Supply the PIC with 3.3V or whetever it needs and >>>> the LED with more. But even with several volts of headroom a resistor is >>>> not a constant current source. However, you can make a uC-controllable >>>> current source with two transistors and two resistors per LED, no big >>>> deal. AoE figure 2.25, just flipped around using NPNs and R1 goes to a >>>> PIC port pin. >>>> >>>> This will improve things massively. If that's still not low-drift enough >>>> you can use an opamp current source. >>>> >>> P.S.: If the cathodes are tied together the last idea only works if you >>> leave the current source up against positive, like in the AoE example. >>> Then drive either with a 5V uC or a logic level FET and add a resistor >>>from base to positive supply. >> >> Joerg, >> Thanks for the advice. Yes, I had been concentrating so hard on the >> amplifiers I never really considered the LEDs. In my mind, they would >> just 'work' and I could then adjust accordingly. Didn't realize that >> they would vary that much. Will have to look at maybe adding a higher >> voltage, and go with the constant current drives for them. This does >> need to be pretty accurate! > >Consider using a photodiode instead of a phototransistor -- it _should_ >be more linear and predictable. > >Also consider putting a photoreceptor in the forward light path, to >monitor the light level out of the LED. Even with constant current >sources I suspect that you're going to see drift with temperature and >aging. A photoreceptor in the forward path will let you read the >illumination intensity and make your readings ratiometric. > >You may find that with the extra photoreceptor you don't need a 'real' >constant current source -- just something that sorta kinda works (but >_not_ something with 0V headroom!). Hmmm. I like ratiometric designs. How do you get matched photodiodes?
From: JosephKK on 3 Mar 2010 02:03
On Tue, 2 Mar 2010 08:56:49 -0000, <news(a)rblack01.plus.com> wrote: >On Mon, 01 Mar 2010 10:55:36 -0800, Tim Wescott <tim(a)seemywebsite.now> >said: >> Charlie E. wrote: >> > On Mon, 01 Mar 2010 09:57:43 -0800, Joerg <invalid(a)invalid.invalid> >> > wrote: >> > >> >> Joerg wrote: >> >>> Charlie E. wrote: >> >>>> On Mon, 01 Mar 2010 09:32:56 -0800, Joerg <invalid(a)invalid.invalid> >> >>>> wrote: >> >>>> >> >>>>> Charlie E. wrote: >> >>>>>> Hi Guys, >> >>>>>> Ok, going to put myself in harms way, and ask for a little design >> >>>>>> advice. I have been working on this project for a while now, and it >> >>>>>> has gone through several iterations, and I keep having the same >> >>>>>> problem! >> >>>>>> >> >>>>>> First, the project: I am designing a small color reader for the >> >>>>>> visually impaired. Really simple operation - put it against the >> >>>>>> object you want to tell the color of, and it will say "RED" or >> >>>>>> whatever the color is. Sensor is simply an RGB LED and a >> >>>>>> phototransistor, buffered by some amps, and then digitized by a PIC24. >> >>>>>> So, what's the problem? I can't get a stable reading. In normal >> >>>>>> operation, this thing will run for about two seconds, and then be >> >>>>>> turned off. To test, however, I run it in debug mode for hours. When >> >>>>>> I first turn it on, and calibrate it to a white sample, I will get one >> >>>>>> set of calibrations. Let it sit for about two minutes, and it starts >> >>>>>> to drift. In about half an hour, I will have readings totally off the >> >>>>>> scale. >> >>>>>> >> >>>>>> So, why am I baring my soul to ya'll? I need your help identifying >> >>>>>> where the gain drift is coming from, and some ideas on how to control >> >>>>>> them. I have the schematic here: >> >>>>>> >> >>>>>> http://edmondsonengineering.com/Documents/Rainbow%20color%20Reader%20Schematic.pdf >> >>>>>> >> >>>>>> >> >>>>>> Basic description - MCU turns on an LED. The phototransistor is first >> >>>>>> buffered by a non-inverting opamp with a gain of 2, and the signal is >> >>>>>> split. Part goes directly to a PGA where it is first attenuated, and >> >>>>>> then the PGA boosts it up. This gives me a calibration control to >> >>>>>> deal with difference in output of the LEDs. The original and PGA >> >>>>>> signal are added, and this is then applied to another non-inverting >> >>>>>> opamp with a gain of 2. I also have one feed before this opamp to an >> >>>>>> ADC input on the PIC. >> >>>>>> >> >>>>>> Problems I have already solved: >> >>>>>> First, each LED has a different output level. Red needs a gain of >> >>>>>> around 2, BLUE a gain of around 5, and GREEN a gain of about 7. The >> >>>>>> PGA was added to give me an adjustable gain from around 2 to 14, with >> >>>>>> the two different taps into the separate input channels of the PGA. >> >>>>>> This gives me 16 different gain levels to play with. Using the tap to >> >>>>>> the second ADC channel, it actually gives me 32 different levels. >> >>>>>> >> >>>>>> Right now, RED uses this lower gain channel, and is steady as a rock. >> >>>>>> Part of this may be that my VCC is 3.3 volts, and only RED has a >> >>>>>> forward voltage below this. Both GREEN and BLUE have forward voltages >> >>>>>> of 3.4 volts. >> >>>>>> >> >>>>>> So, potential problems? could it be that repeated use warms up the >> >>>>>> GREEN and BLUE LEDs so that they become more efficient? Could the >> >>>>>> power supply drift higher as it warms up? Could the opamps drift with >> >>>>>> slight changes in temperature? Any advice ya'll can give will be most >> >>>>>> appreciated. >> >>>>>> >> >>>>> As Jim hinted, the first order of business would be to regulate the >> >>>>> current that goes through each LED. A resistor that drops only very >> >>>>> little voltage isn't going to cut it. >> >>>> So, my first stupid mistake was using a VCC of 3.3 volts with LEDs >> >>>> that required 3.4! Not an easy problem to fix. >> >>>> >> >>>> Makes me really wish that the PSOC1s had built in debug capability. >> >>>> They could run at 5 VDC... >> >>>> >> >>> It can be fixed. You'd need three step-up (boost) converters and a small >> >>> resistor in front to each and then regulate. If it has to be cheap you >> >>> could try to regulate with the uC. Alternatively one step-up and three >> >>> linear ones but LDOs are often rather buggy and if you boost to 6V or >> >>> more for a proper linear regulation you'll waste a lot of power. >> >>> >> >>> Yet another option: Supply the PIC with 3.3V or whetever it needs and >> >>> the LED with more. But even with several volts of headroom a resistor is >> >>> not a constant current source. However, you can make a uC-controllable >> >>> current source with two transistors and two resistors per LED, no big >> >>> deal. AoE figure 2.25, just flipped around using NPNs and R1 goes to a >> >>> PIC port pin. >> >>> >> >>> This will improve things massively. If that's still not low-drift enough >> >>> you can use an opamp current source. >> >>> >> >> P.S.: If the cathodes are tied together the last idea only works if you >> >> leave the current source up against positive, like in the AoE example. >> >> Then drive either with a 5V uC or a logic level FET and add a resistor >> >>from base to positive supply. >> > >> > Joerg, >> > Thanks for the advice. Yes, I had been concentrating so hard on the >> > amplifiers I never really considered the LEDs. In my mind, they would >> > just 'work' and I could then adjust accordingly. Didn't realize that >> > they would vary that much. Will have to look at maybe adding a higher >> > voltage, and go with the constant current drives for them. This does >> > need to be pretty accurate! >> >> Consider using a photodiode instead of a phototransistor -- it _should_ >> be more linear and predictable. > >Yep. Phototransistors are horrible for this sort of application. >Linearity, unit-to-unit repeatability, temperature drift will all ruin >your measurement. >A photodiode with transimpedance amplifier should do what you want. If >you have a large dynamic range to cover, consider an integrating amp - >this allows you to control the overall gain by varying the integration >time, which should save a few parts. > >HTH > >R. Kind of like typical autoranging DMMs. |