DIY Line sensor, would this work?

Hi, would this design work ? And also, do i need so many leds and sensors :?

instead of putting the Tx and Rx next to each other I put them vertically! It’s hard to explain without showing the design but the sensors are on top and transmitters are on bottom.(not bottom layer)

hurtsliveheaven.pdf (28.1 KB)

First thing. What are you trying to achieve? A level indicator with IrDA of some sort? I’m just guessing, but you should make this clear.

Your 330R resistor will allow 12mA for 6 LED’s, which is within limits of the arduino output, but likely not enough for proper operation of the emitters, which are typically rated for 10-20mA. The outcome of having a weak emitter is that you will have to make your receivers too sensitive and therefore will be subject to more noise.

I would never drive LED’s in parallel. Each of the bottom IR emitters needs to have its own current limiting resistor.

Assuming a current of 10mA with a supply of 5V and forward voltage of 1V, R=((5-1)/0.010) <=> R = 400Ohm. Change according to your current needs and with care not to surpass the available output of the arduino pin (Cant remember, about 40mA?)

Other than that, yes it appears to work. From what I understand, when the receiver is not seeing any signal from the emitter it will stay open, therefore output = 5V, given by the pull ups (R2, R3, R4, R5, R6, R7). As the receiver is placed close to something reflective that transmits some of the light from the emitter it will start conducting so the voltage will fall to 0V or close. Is this what you’re looking to?

Note: Sun light, and any other source of red or Ir light such as an incandescent bulb will also trigger the sensor, in case you don’t know.

casemod:
First thing. What are you trying to achieve? A level indicator with IrDA of some sort? I’m just guessing, but you should make this clear.

Your 330R resistor will allow 12mA for 6 LED’s, which is within limits of the arduino output, but likely not enough for proper operation of the emitters, which are typically rated for 10-20mA. The outcome of having a weak emitter is that you will have to make your receivers too sensitive and therefore will be subject to more noise.

I would never drive LED’s in parallel. Each of the bottom IR emitters needs to have its own current limiting resistor.

Assuming a current of 10mA with a supply of 5V and forward voltage of 1V, R=((5-1)/0.010) <=> R = 400Ohm. Change according to your current needs and with care not to surpass the available output of the arduino pin (Cant remember, about 40mA?)

Other than that, yes it appears to work. From what I understand, when the receiver is not seeing any signal from the emitter it will stay open, therefore output = 5V, given by the pull ups (R2, R3, R4, R5, R6, R7). As the receiver is placed close to something reflective that transmits some of the light from the emitter it will start conducting so the voltage will fall to 0V or close. Is this what you’re looking to?

Note: Sun light, and any other source of red or Ir light such as an incandescent bulb will also trigger the sensor, in case you don’t know.

I was planning on making a line follower robot.
I’ll change the 330Ohms to 220Ohms!

and using a separate resistor for each of my leds is going to make it complicated, but I’ll do that! why do you tell me to do so:?

and sounds like i should connecting it to a separate power source! (maybe include a 5v regulator in my circuit!)

and yes, i was looking to make it fall to 0v when surface is white(although I’m starting to think the opposite is better!)!

thanks :slight_smile:

kamhagh: and using a separate resistor for each of my leds is going to make it complicated, but I'll do that! why do you tell me to do so:?

You should never connect LEDs in parallel. The forward voltage of all LEDs will never be exactly the same, so some will take most of the current while others will only get a minimal amount. If they all have series resistors, then they'll all draw the same amount of current.

For example, with your present setup, if you chose the resistor value such that you supplied 120mA, equivalent to 20mA per LED, it's possible that one LED will conduct most of that current and die, while others would barely operate at all.

OldSteve: You should never connect LEDs in parallel. The forward voltage of all LEDs will never be exactly the same, so some will take most of the current while others will only get a minimal amount. If they all have series resistors, then they'll all draw the same amount of current.

For example, with your present setup, if you chose the resistor value such that you supplied 120mA, equivalent to 20mA per LED, it's possible that one LED will conduct most of that current and die, while others would barely operate at all.

:O, this is similar to something I've tried a few days ago, I just connected bunch of LEDs in parallel, but for some reason only if I added a different color led, others would turn off! I guessed it had to do something with having different resistance and electricity choosing to go on the least resistive path! thanks!

sound like i have to route again :S + use some resistors :)

Life will get a whole lot more complicated than having to add a resistor to each led :slight_smile:

You will have to calibrate R2, R3, R4, R5, R6, R7 to match you surface/reflection rate and depending on the current you feed your emitters to eliminate any sources of outside noise. To worsen things, some emitter/receiver pair will have different gains. You have to try it and see.

Lastly, make sure the 6 emitters don’t draw more than the available power each arduino pin can provide. If they do, use a transistor/mosfet to switch from VCC (5V)

kamhagh:
:O, this is similar to something I’ve tried a few days ago, I just connected bunch of LEDs in parallel, but for some reason only if I added a different color led, others would turn off! I guessed it had to do something with having different resistance and electricity choosing to go on the least resistive path!
thanks!

sound like i have to route again :S + use some resistors :slight_smile:

You’re right on to it. Different colors are extreme cases (IR = 1V, Red, Yellow, Green = 1.95V, White, Blue, High bright green = ~3V), but different LEDs of the same color can have a different FV or a few milivolts (for example 1.95 and 1.90V), therefore current will not be shared evenly. Even transistors have this problem, which can cause thermal runaway, in case you want to research about it.

Hence the need to have individual resistors to make sure the current is shared equally.

You can also power led’s in series, if your voltage is great enough. This way, each is allowed to draw whatever voltage it requires to work, but the string current will be exactly the same.

Say if your voltage is regulated at 5V, you can parallel each 3 emitters. In this case for a current of 10mA we have:

R=((5-(1*3))/0.010) <=> R = 200Ohm. Change according to your current needs

6 emitters would therefore be configured as two independent strings of 3 leds drawing 10mA each for a total consumption of 20mA, rather than 60.

In the end, that’s the beauty of electronics. There are many solutions to a problem.

casemod:
Life will get a whole lot more complicated than having to add a resistor to each led :slight_smile:

You will have to calibrate R2, R3, R4, R5, R6, R7 to match you surface/reflection rate and depending on the current you feed your emitters to eliminate any sources of outside noise. To worsen things, some emitter/receiver pair will have different gains. You have to try it and see.

Lastly, make sure the 6 emitters don’t draw more than the available power each arduino pin can provide. If they do, use a transistor/mosfet to switch from VCC (5V)

You’re right on to it. Different colors are extreme cases (IR = 1V, Red, Yellow, Green = 1.95V, White, Blue, High bright green = ~3V), but different LEDs of the same color can have a different FV or a few milivolts (for example 1.95 and 1.90V), therefore current will not be shared evenly. Even transistors have this problem, which can cause thermal runaway, in case you want to research about it.

Hence the need to have individual resistors to make sure the current is shared equally.

You can also power led’s in series, if your voltage is great enough. This way, each is allowed to draw whatever voltage it requires to work, but the string current will be exactly the same.

Say if your voltage is regulated at 5V, you can parallel each 3 emitters. In this case for a current of 10mA we have:

R=((5-(1*3))/0.010) <=> R = 200Ohm. Change according to your current needs

6 emitters would therefore be configured as two independent strings of 3 leds drawing 10mA each for a total consumption of 20mA, rather than 60.

In the end, that’s the beauty of electronics. There are many solutions to a problem.

I was planning to have all the IR LEDs on all the time, maybe connecting it to a transistor on my PCB!

and this is getting more complicated than I expected :slight_smile: but it’s good because I learned new stuff about electronics! maybe I should order one online :smiley: (jk)

Btw, I just remembered, I'm going to calibrate the sensors with software(using a black and white surface and save values for each sensor) and maybe putting that in the ROM