Pages: 1 [2]   Go Down
Author Topic: IR range/proximity detector not working as expected  (Read 4079 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 3
Posts: 120
Arduinos are cool! :D
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, but I have taken that into account.  I even removed the sensor circuit and connected A1 directly to the ground and I get this:

Sgl = 835, 1023, Sum = 403312, 1022992, Avg = 280.47, 711.40, Dif = -430.93

and when I connect it to Vcc:

Sgl = 0, 0, Sum = 29, 109, Avg = 0.02, 0.08, Dif = -0.06

Notice that the on value is lower than that of the off value?

This makes no sense.
Logged

I'm a programmer dammit, not an engineer! smiley-grin
Like this post?  Please give me some karma for it.  Thanks! smiley

Offline Offline
Full Member
***
Karma: 3
Posts: 120
Arduinos are cool! :D
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, I think I have found the problem.  The LEDs are pulling too much current and are causing other things (i.e. the ADC) to fail.  I'm going to have to have a separate current source to get them to be as bright as I want them (between 100-200mA if not more).  Thing is, how do I wire one up using a transistor as a switch who's base is controlled by the Arduino and uses an external battery as a current source?  They would require a common ground right?  Would I just connect the negative terminal of the battery to a ground pin of the Arduino while using the USB as the primary power source?  And then when I eventually make this a self contained unit, can I draw off the battery directly?
Logged

I'm a programmer dammit, not an engineer! smiley-grin
Like this post?  Please give me some karma for it.  Thanks! smiley

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33295
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes that sounds like the way to proceed.
Logged

Offline Offline
Faraday Member
**
Karma: 57
Posts: 2772
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

LED's don't really have "resistance".  They have a quite non-linear voltage vs current characteristic.

To run them in parallel,  you need a separate means of current regulation ( a constant current source,  or a resistor )
for each one.

You can also connect them in series if you have a high enough voltage source,   and then you only need one
means of current control.
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 120
Arduinos are cool! :D
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

LED's don't really have "resistance".  They have a quite non-linear voltage vs current characteristic.

To run them in parallel,  you need a separate means of current regulation ( a constant current source,  or a resistor )
for each one.

You can also connect them in series if you have a high enough voltage source,   and then you only need one
means of current control.
Yeah, I sorta understand that they are non-linear.  But if you know the Vin and the voltage that each diode will stabilize at, what happens if you use only one resistor?  Can you not calc the current flow?  Or is this not a good idea as the stabilized voltage will drift over the life of the LED causing the current to shift as well?

Logged

I'm a programmer dammit, not an engineer! smiley-grin
Like this post?  Please give me some karma for it.  Thanks! smiley

Pages: 1 [2]   Go Up
Jump to: