From: Charlie E. on
On Mon, 1 Mar 2010 15:39:14 -0800 (PST), whit3rd <whit3rd(a)gmail.com>
wrote:

>On Mar 1, 2:09�pm, Charlie E. <edmond...(a)ieee.org> wrote:
>> On Mon, 1 Mar 2010 12:57:49 -0800 (PST), whit3rd <whit...(a)gmail.com>
>> wrote:
>>
>> >On Mar 1, 8:54 am, Charlie E. <edmond...(a)ieee.org> wrote:
>>
>> >> Sensor is simply an RGB LED and a
>> >> phototransistor, buffered by some amps, and then digitized by a PIC24.
>>
>> >Your digitizing scheme is not what you really need; the small current
>> >can easily be integrated onto a capacitor, and a comparator ...
>> >Current-input D/A conversion is easy
>
>> So, I just feed the emitter of the phototransistor directly to a cap,
>> and use a comparator input to determine when it has reached a
>> reference voltage. I probably need to hit it before and after with a
>> ground to clear the cap for the next sample...
>
>Yes, that would work; consider using an op amp integrator
>(feedback capacitor and photodiode connect to (-) node),
>to keep the photodiode bias steady and
>so you can filter (at the (+) node) to get rid of power supply hash...
>either way, it's gonna give you an average of current over a
>longish time period (maybe turn the illumination on for a few
>milliseconds per color).
>
>I'd prefer to see a 'silicon blue' corrected photodiode for color
>pickup,
>phototransistors have LOTS of red and IR sensitivity, not so much
>in the green/blue range. Brown 'amorphous Si' solar cells are
>somewhat broader response.

I am using an 'ambient light detector' photodiode (TEPT5600) so it is
color corrected. I am going to have to look into your integrator idea
for later models...

Charlie
From: Charlie E. on
On Tue, 02 Mar 2010 00:04:45 GMT, Jan Panteltje
<pNaonStpealmtje(a)yahoo.com> wrote:

>On a sunny day (Mon, 01 Mar 2010 14:33:41 -0800) it happened Charlie E.
><edmondson(a)ieee.org> wrote in <s3goo59u9hh1khbfe0tsuds56j1b8b8bk8(a)4ax.com>:
>
>>On Mon, 01 Mar 2010 22:10:00 GMT, Jan Panteltje
>><pNaonStpealmtje(a)yahoo.com> wrote:
>>
>>>On a sunny day (Mon, 01 Mar 2010 08:54:53 -0800) it happened Charlie E.
>>><edmondson(a)ieee.org> wrote in <54rno5h38v0fq45a1i4gbkqfl2qc6no2gh(a)4ax.com>:
>>>
>>>>Hi Guys,
>>>
>>>I would likely do this very differently and only use one PIC and no other stuff.
>>>How about:
>>>
>>>Red on
>>>Read level1
>>>Red off
>>>Read level2
>>>Subtract level1 from level2, this is the red component independent of the environment light strength and changes.
>>>
>>>Repeat for green and blue.
>>>
>>
>>Hi Jan,
>>In this case, level2 is almost zero, but level1 varies from measurment
>>to measurement. Trying to get that accurate and precise is the real
>>problem...
>>
>>Charlie
>
>I do not get it, if you have a PIC with a 10bit ADC?
>That is good for 5 mV resolution (1024 steps) at 5 V supply,
>less if you use a lower reference.
>Without drift.
>I have seen a lot more signal from a photo transistor.
>
>So what drifts?
>1) the incoming light?
>2) the photo transistor?
>3) your circuit?
>4) any or all of the above? LOL
>I would connect the photo transistor directly to the ADC.

Hi Jan,
As you read the rest of the thread, everyone is pretty convinced the
problem is improper LED drive. At present, the three different LEDs
all have different outputs, making it necessary to have a variable
input amp to get the voltages to the right levels.
From: Joerg on
Charlie E. wrote:
> On Mon, 01 Mar 2010 14:37:22 -0800, Joerg <invalid(a)invalid.invalid>
> wrote:
>
>> Charlie E. wrote:
>>> On Mon, 01 Mar 2010 14:02:09 -0800, Joerg <invalid(a)invalid.invalid>
>>> wrote:
>>>
>>>> Charlie E. wrote:
>>>>> On Mon, 01 Mar 2010 12:54:27 -0800, Joerg <invalid(a)invalid.invalid>
>>>>> wrote:
>>>>>
>>>>>> Charlie E. wrote:
>>>>>>> On Mon, 01 Mar 2010 11:12:58 -0800, Joerg <invalid(a)invalid.invalid>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Charlie E. wrote:
>>>>>>>>> On Mon, 01 Mar 2010 10:38:45 -0800, Joerg <invalid(a)invalid.invalid>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Charlie E. wrote:
>>>>>>>>> <snip original problem...>
>>>>>>>>>
>>>>>>>>>>> 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!
>>>>>>>>>>>
>>>>>>>>>> Where is your VCC coming from? Regulator? If so, what's the minimum
>>>>>>>>>> voltage going into that regulator? If it is a battery that won't drop
>>>>>>>>>> below about 4.5V and has low load ripple (low source resistance, added
>>>>>>>>>> capacitors) fixing this part of the circuit would become fairly simple.
>>>>>>>>> Hi Joerge,
>>>>>>>>> I only have two AA batteries, so voltage is only about 2.5-3.1 volts.
>>>>>>>>> That was why I added in the power supply, to try and stabilize that
>>>>>>>>> voltage. Most of the parts were pretty power tolerant, but I figured
>>>>>>>>> (somewhat correctly) that the LEDs would be pretty voltage sensitive.
>>>>>>>>>
>>>>>>>> That will require switch mode conversion, no other choice.
>>>>>>>>
>>>>>>>>
>>>>>>>>> What do you think of this idea? Take an LED driver chip, like an
>>>>>>>>> LM3519 to do the voltage step up and current control, and then three
>>>>>>>>> fets to switch that current to each of the LEDs. Means a chip, a
>>>>>>>>> small inductor and schottkey, a couple of caps, and three fets.
>>>>>>>>> Shouldn't take up too much board space or budget...
>>>>>>>>>
>>>>>>>> Nope, it ain't quite that easy. It doesn't have an external sense
>>>>>>>> resistor and, consequently, the "accuracy" to which it holds the current
>>>>>>>> is really horrid. Look at the Iout versus Vin, that's just not good
>>>>>>>> enough. If you want to use a chip (or three) you need to find one with
>>>>>>>> at least and external Rsense.
>>>>>>>>
>>>>>>>> It is usually easier and less expensive to boost that voltage from the
>>>>>>>> two AA cells to 5V and add the analog current source circuits I
>>>>>>>> mentioned in my other post (one per LED section). The PIC could be
>>>>>>>> supplied directly from the AA cell if it's happy with 2.5V.
>>>>>>> You are probably right. One problem is that the opamps for the
>>>>>>> phototransistor (ambient light sensor) should also probably stay on
>>>>>>> the battery, to prevent overdriving the ADC inputs for the PIC. There
>>>>>>> are the other LED drivers with an external current sense resistor, so
>>>>>>> will look into the tradeoffs involved...
>>>>>>>
>>>>>> The opamps can be handled with series resistors and, if necessary, BAV99
>>>>>> double-diodes. But if you have suitable opamps you might as well run
>>>>>> them off the PIC rail.
>>>>>>
>>>>>> I'd really consider just one li'l boost converter that makes 5V. Tons of
>>>>>> those available. Then current sources for a clean control.
>>>>> Actually, just found the MCP1252 series - switchable 3.3 or 5.0 boost
>>>>> converters (charge pump) that don't need inductors! Two of these will
>>>>> be cheaper than the inductor based solution I have now, and give me
>>>>> both rails regulated...
>>>>>
>>>> Careful, the 5.0V version doesn't have any oomph below 3V input and
>>>> AFAIK it quits once Vbat drops below 2.7V. I'd use a real boost
>>>> converter that can comfortably cover your battery voltage range all the
>>>> way to the end of discharge. That one little inductor isn't going to
>>>> kill ya :-)
>>> but, could I cascade them? With the 5V being fed by the 3.3V?
>>> Assuming everything is less than 120mA...
>>>
>> Probably, but its also an exotoc part. Digikey stock is zero and for me
>> that's usually a red flag. At least if you want to produce this in
>> larger qties.
>
> Ah, but the MCP1253 (higher frequency version) has lots in stock!


Ok, yes, but I am stingy when it comes to circuit design and I'd go with
something like the AP6714. Unless I can get away with something even
cheaper :-)

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
From: Charlie E. on
On Mon, 01 Mar 2010 14:30:26 -0800, Joerg <invalid(a)invalid.invalid>
wrote:

>langwadt(a)fonz.dk wrote:
>> On 1 Mar., 20:12, Joerg <inva...(a)invalid.invalid> wrote:
>>> Charlie E. wrote:
>>>> On Mon, 01 Mar 2010 10:38:45 -0800, Joerg <inva...(a)invalid.invalid>
>>>> wrote:
>>>>> Charlie E. wrote:
>>>> <snip original problem...>
>>>>>> 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!
>>>>> Where is your VCC coming from? Regulator? If so, what's the minimum
>>>>> voltage going into that regulator? If it is a battery that won't drop
>>>>> below about 4.5V and has low load ripple (low source resistance, added
>>>>> capacitors) fixing this part of the circuit would become fairly simple.
>>>> Hi Joerge,
>>>> I only have two AA batteries, so voltage is only about 2.5-3.1 volts.
>>>> That was why I added in the power supply, to try and stabilize that
>>>> voltage. Most of the parts were pretty power tolerant, but I figured
>>>> (somewhat correctly) that the LEDs would be pretty voltage sensitive.
>>> That will require switch mode conversion, no other choice.
>>>
>>>> What do you think of this idea? Take an LED driver chip, like an
>>>> LM3519 to do the voltage step up and current control, and then three
>>>> fets to switch that current to each of the LEDs. Means a chip, a
>>>> small inductor and schottkey, a couple of caps, and three fets.
>>>> Shouldn't take up too much board space or budget...
>>> Nope, it ain't quite that easy. It doesn't have an external sense
>>> resistor and, consequently, the "accuracy" to which it holds the current
>>> is really horrid. Look at the Iout versus Vin, that's just not good
>>> enough. If you want to use a chip (or three) you need to find one with
>>> at least and external Rsense.
>>>
>>> It is usually easier and less expensive to boost that voltage from the
>>> two AA cells to 5V and add the analog current source circuits I
>>> mentioned in my other post (one per LED section). The PIC could be
>>> supplied directly from the AA cell if it's happy with 2.5V.
>>>
>>
>> something like: http://www.national.com/ds/LM/LM2705.pdf
>> could be used either as constant current or as high voltage supply
>>
>
>AFAIK those become iffy unde 2.5V. Something like this could work, and
>it's cheap:
>
>http://www.diodes.com/datasheets/AP6714.pdf
>
>If Charlie would prefer a nicely regulated 3.3V as well which would be
>nice to keep the detector side in check he could use the same chip for
>that rail.
>
>
>> I think you could have three npns floating on top of a shared sense
>> resistor
>> to do the switching between leds.
>>
>
>That's a good option. Just make sure any load change reactions have
>petered out when the measurement window cometh.

Joerg, et.al.

Ok, I think I like the idea of using the 1253adj in the current
feedback mode, with three transistors to switch the anodes of the
LEDS. Now, for a really controversial subject - transistor selection!
I could just throw 2N2222s in there, but are there any better options
available, like logic-level FETs that I should use? Looking through
the Digikey selections, I found AO9926B, dual FETS that look pretty
good, while still being big enough to solder by hand!

Any good, cheap through hole logic level FETs for prototyping?

Thanks again for all the great advice!

Charlie

(at least, this has been on on-topic discussion... ;-) )
From: Joerg on
Charlie E. wrote:
> On Mon, 01 Mar 2010 14:30:26 -0800, Joerg <invalid(a)invalid.invalid>
> wrote:
>
>> langwadt(a)fonz.dk wrote:
>>> On 1 Mar., 20:12, Joerg <inva...(a)invalid.invalid> wrote:
>>>> Charlie E. wrote:
>>>>> On Mon, 01 Mar 2010 10:38:45 -0800, Joerg <inva...(a)invalid.invalid>
>>>>> wrote:
>>>>>> Charlie E. wrote:
>>>>> <snip original problem...>
>>>>>>> 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!
>>>>>> Where is your VCC coming from? Regulator? If so, what's the minimum
>>>>>> voltage going into that regulator? If it is a battery that won't drop
>>>>>> below about 4.5V and has low load ripple (low source resistance, added
>>>>>> capacitors) fixing this part of the circuit would become fairly simple.
>>>>> Hi Joerge,
>>>>> I only have two AA batteries, so voltage is only about 2.5-3.1 volts.
>>>>> That was why I added in the power supply, to try and stabilize that
>>>>> voltage. Most of the parts were pretty power tolerant, but I figured
>>>>> (somewhat correctly) that the LEDs would be pretty voltage sensitive.
>>>> That will require switch mode conversion, no other choice.
>>>>
>>>>> What do you think of this idea? Take an LED driver chip, like an
>>>>> LM3519 to do the voltage step up and current control, and then three
>>>>> fets to switch that current to each of the LEDs. Means a chip, a
>>>>> small inductor and schottkey, a couple of caps, and three fets.
>>>>> Shouldn't take up too much board space or budget...
>>>> Nope, it ain't quite that easy. It doesn't have an external sense
>>>> resistor and, consequently, the "accuracy" to which it holds the current
>>>> is really horrid. Look at the Iout versus Vin, that's just not good
>>>> enough. If you want to use a chip (or three) you need to find one with
>>>> at least and external Rsense.
>>>>
>>>> It is usually easier and less expensive to boost that voltage from the
>>>> two AA cells to 5V and add the analog current source circuits I
>>>> mentioned in my other post (one per LED section). The PIC could be
>>>> supplied directly from the AA cell if it's happy with 2.5V.
>>>>
>>> something like: http://www.national.com/ds/LM/LM2705.pdf
>>> could be used either as constant current or as high voltage supply
>>>
>> AFAIK those become iffy unde 2.5V. Something like this could work, and
>> it's cheap:
>>
>> http://www.diodes.com/datasheets/AP6714.pdf
>>
>> If Charlie would prefer a nicely regulated 3.3V as well which would be
>> nice to keep the detector side in check he could use the same chip for
>> that rail.
>>
>>
>>> I think you could have three npns floating on top of a shared sense
>>> resistor
>>> to do the switching between leds.
>>>
>> That's a good option. Just make sure any load change reactions have
>> petered out when the measurement window cometh.
>
> Joerg, et.al.
>
> Ok, I think I like the idea of using the 1253adj in the current
> feedback mode, with three transistors to switch the anodes of the
> LEDS. Now, for a really controversial subject - transistor selection!
> I could just throw 2N2222s in there, but are there any better options
> available, like logic-level FETs that I should use? Looking through
> the Digikey selections, I found AO9926B, dual FETS that look pretty
> good, while still being big enough to solder by hand!
>
> Any good, cheap through hole logic level FETs for prototyping?
>

Don't you need P-channel? These look good but there won't be much in
through-hole, that era is over:

http://www.diodes.com/datasheets/ds30933.pdf

But make sure the source doesn't get much above 3.3V or it won't turn
off and your current regulator could hang. IIRC on of your LEDs may
require more than 3.3V. So you could, for example, hang a BAV99 up front
to drop 1.2V and a resistor from gate to source.


> Thanks again for all the great advice!
>

As one SW guy put it, we are here to serve :-)


> Charlie
>
> (at least, this has been on on-topic discussion... ;-) )


Yeah, amazing, not even the slightest rant.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Prev: Magnetism is really -- WHAT?
Next: low-end scope