Maker Pro
Maker Pro

Need a little design help on my latest project

C

Charlie E.

Your digitizing scheme is not what you really need; the small current
can easily be integrated onto a capacitor, and a comparator input
with one of the nice timer sections can give a single-slope
digitization of the noisy input. Using instead the DAC section, your
noise bandwidth is quite high.

Current-input D/A conversion is easy, and voltage conversion then
voltage DAC has no real benefit here.

Hmmmm... interesting idea.

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...

Charlie
 
C

Charlie E.

Have you considered using an incandescent lamp and two
phototransistors with red filter in front of one and a blue filter in
front of the other. If you run the lamp with a slightly low voltage,
it should have a long life. A 49 lamp runs on 2 volts and 60 ma.


Dan
Definitely see too many variables in this scheme, with lamp voltage
changing color, time on lamp changing color, only two data points.
What I have isn't too great, but probably a little more reliable...

Thanks, though!

Charlie
 
C

Charlie E.

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...

Charlie
 
J

Joerg

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.
 
C

Charlie E.

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
 
C

Charlie E.

Now you don't care about cost? $1.04 ea @2k. Probably $2 in small
qty.
But an inductor is probably close to $1, even in quantity, and the
chip to run it is usually above $1, so two of these starts looking
interesting.

Charlie
 
J

Joerg

Charlie said:
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.
 
C

Charlie E.

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.

I have noticed that on the Microchip power supply chips, either little
stock, or requires big minimums from DK. Not a good sign...

Charlie
 
C

Charlie E.

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!
 
C

Charlie E.

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
 
C

Charlie E.

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.
 
J

Joerg

Charlie said:
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 :)
 
C

Charlie E.

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.



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... ;-) )
 
J

Joerg

Charlie said:
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.
 
G

Guest

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.
 
C

Charlie E.

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.



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




Yeah, amazing, not even the slightest rant.

Ok, this has been bothering me all night. The circuit is now looking
like

Vout from regulator
| point A
FET switch
| point B
LED
| point C
FB resistor
|
GND

(Ok, it isn't ASCII art, but hopefully gets the point across...)

So, working from the bottom, point C is at 1.21 volts. The green LED
has a Vforward of 3.4V, so B is at 4.6V. I have 3.1VDC (typically)
from the PIC pin to switch the FET. Not an easy problem.
Unfortunately, the RGB LED is common cathode, so needs to be switched
above, not below, so need to somehow raise the level of the turn on
signal to be able to control the FET, and still be able to turn it
off. Of course, this is just one of three circuits, so I need to be
sure the others don't turn on at the same time... ;-)

Of course, no parts around here to play with. time to get out the
spice!

Charlie
 
J

Joerg

Charlie said:
Ok, this has been bothering me all night. The circuit is now looking
like

Vout from regulator
| point A
FET switch
| point B
LED
| point C
FB resistor
|
GND

(Ok, it isn't ASCII art, but hopefully gets the point across...)

So, working from the bottom, point C is at 1.21 volts. The green LED
has a Vforward of 3.4V, so B is at 4.6V. I have 3.1VDC (typically)
from the PIC pin to switch the FET. Not an easy problem.


It is easy: Spring for two logic level FETs that are guaranteed to have
low Rdson at 3V drive. One P and one N. The P-channel goes where your
FET switch ist between points A and B, source to point A. It's gate has
a resistor of 10k or whatever to "Vout from regulator". Now place a
N-channel, source to GND, drain to gate of the P-channel and it's gate
is directly driven by the PIC.

Unfortunately, the RGB LED is common cathode, so needs to be switched
above, not below, so need to somehow raise the level of the turn on
signal to be able to control the FET, and still be able to turn it
off. Of course, this is just one of three circuits, so I need to be
sure the others don't turn on at the same time... ;-)

Consider it done :)

Of course, no parts around here to play with. time to get out the
spice!

Nah, this does not need SPICE ...
 
C

Charlie E.

It is easy: Spring for two logic level FETs that are guaranteed to have
low Rdson at 3V drive. One P and one N. The P-channel goes where your
FET switch ist between points A and B, source to point A. It's gate has
a resistor of 10k or whatever to "Vout from regulator". Now place a
N-channel, source to GND, drain to gate of the P-channel and it's gate
is directly driven by the PIC.



Consider it done :)



Nah, this does not need SPICE ...

Ok, looks good.

I still spice it, cause I don't have the parts on hand to breadboard
(not that you can breadboard SM parts...) so gives me a chance to test
things without releasing magic smoke!

I really need to play with this analog stuff more. I know the basics,
but don't have enough practice to know what works, and why. Ya'll
have really pulled my bacon from the fire this time. Maybe if Jim has
his BBQ next month, I will buy a round (or two... )

Thanks,
Charlie
 
C

Charlie E.

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
 
J

Joerg

Charlie said:
Ok, looks good.

I still spice it, cause I don't have the parts on hand to breadboard
(not that you can breadboard SM parts...) so gives me a chance to test
things without releasing magic smoke!

But it can cost some time to obtain models for the logic-level FETs.
Sometimes that takes as much time as just whipping it up.

I really need to play with this analog stuff more. I know the basics,
but don't have enough practice to know what works, and why. Ya'll
have really pulled my bacon from the fire this time. Maybe if Jim has
his BBQ next month, I will buy a round (or two... )

I think Jim needs to order some more global warming before people will
come, or everyone has to bring jackets :)
 
Top