Prev: Magnetism is really -- WHAT?
Next: low-end scope
From: langwadt on 1 Mar 2010 12:35 On 1 Mar., 17:54, Charlie E. <edmond...(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%20... > > 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 you need a higher voltage and a way to drive the LEDs with constant current otherwise the output will be all over the place -Lasse
From: Charlie E. on 1 Mar 2010 12:37 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... Charlie
From: Joerg on 1 Mar 2010 12:50 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. -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM.
From: linnix on 1 Mar 2010 12:53 On Mar 1, 9:37 am, Charlie E. <edmond...(a)ieee.org> wrote: > On Mon, 01 Mar 2010 09:32:56 -0800, Joerg <inva...(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%20.... > > >> 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... > > Charlie Can't find any PIC with higher VCC? Most AVR can run up to 5.5V.
From: Joerg on 1 Mar 2010 12:57
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. -- Regards, Joerg http://www.analogconsultants.com/ "gmail" domain blocked because of excessive spam. Use another domain or send PM. |