Pages: [1] 2 3 4   Go Down
Author Topic: Multiplex IR LED's?  (Read 6359 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can we do the same technique used in say this: , but instead with IR emitters and detectors?
Logged

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

Well the title of the post is a bit wrong if you want to multiplex detectors. The principle is the same but the circuit is different. And you will only look at one detector at a time, so it will be no good for IR data like from a remote.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well the title of the post is a bit wrong if you want to multiplex detectors. The principle is the same but the circuit is different. And you will only look at one detector at a time, so it will be no good for IR data like from a remote.
Thats fine smiley, Im just looking to detect IR light emitting from the emitters not any data. Also could you please show me an example, it would be much appreciated smiley?
Logged

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

This is an example of multiplexing many analogue inputs into the arduino:-
http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is an example of multiplexing many analogue inputs into the arduino:-
http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html

Ok after reading that page I think I understand what to do, but am still confused. So I have questions regarding that:
  • Are you suggesting I use a 4051 and loop through all the sensor readings? After reading this: http://www.arduino.cc/playground/Learning/4051 I feel it is probably a good idea
  • I never even new these extenders existed until now, so looking back on this: http://arduino.cc/forum/index.php/topic,98317.0.html Would it be suitable to use 2 4051's to control an 8x8 matrix of LED's or maybe even 2 4067's and I could have a 8x12 Matrix? smiley-razz
  • Would these be suitable or fast enough to switch (I know the photodiodes probably dont but the LED's from the prev question do), I really dont know how to read the datasheet smiley-sad
  • To my understanding, all I need to control these are 3 pins on the 4051s and 4 on the 4067s?
  • In your footsteps example, You have 3 pins on the 4051 going to ground, and 1 to the analog input, If I were to not use it as an input and rather an output, how would I do it? I have searched it and only found examples with confusing diagrams
  • I havnt been able to find many 4067s are there any other 16 channel multiplexers that are similar
  • If I have 3 4067s for a 8x12 matrix of LED's and 1 row of 12 photodiodes and 4 blank inputs reading on 1 input to the arduino, that uses 1 Analog in and only 12 Digital Pins right?
  • Last but not least, How do I incorporate the emitters then? Do I just hook them up in parralel with the arduino to the 12v adapter (making sure I lower their voltages) and then control them with a transistor or a simple relay to turn them on and off so theres no power wasted?
I also found this which is helpful if anyone else is reading this that has the same low knowledge as me smiley-razz http://colab.lcc.gatech.edu/wp-content/uploads/2012/04/Analog-Mux-4051.pdf

You are the best and a genius if you can even answer one of these questions smiley-wink
Also That is a great link btw it is very helpful it opened me up to so many possiblities, Thankyou so much grumpy_mike smiley-lol smiley-lol smiley-lol smiley-lol smiley-lol smiley-lol smiley-lol smiley-lol smiley-lol smiley-lol
Logged

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

Quote
Are you suggesting I use a 4051 and loop through all the sensor readings?
Yes I think it will be the simplest option. You can cascade 4051s to get as many inputs as you like therefore you will need one 4051 for every 8 sensors.

Quote
Would these be suitable or fast enough to switch
Yes providing you are getting a good signal from the IR sensors. There is an associated serial resistance with the path through this device, this is different for different manufacturers so check the data sheet.

Quote
To my understanding, all I need to control these are 3 pins on the 4051s
The 3 pins select which one of the 8 wires is connected to the one wire. You can't say input and output because the is bidirectional it is just like a multiway switch controlled by the 3 select lines.

Quote
If I were to not use it as an input and rather an output, how would I do it?
See above the input is the output.

Quote
I havnt been able to find many 4067s are there any other 16 channel multiplexers that are similar
No in simple electronics like this the package size is the thing that determines the cost. As it is easy to use two 4051s these are mainly used in place of bigger multiplexers because of cost.
So far I have been talking about just expanding the inputs with a 4051.

You asked about a matrix, this is a bit more unusual. In fact I have never made a matrix of sensors.

Quote
If I have 3 4067s for a 8x12 matrix of LED's and 1 row of 12 photodiodes and 4 blank inputs reading on 1 input to the arduino,
Sorry I don't understand this, can you draw something. Look at http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html to see how a matrix should be wired.

I have drawn up what I would try if I were to make a matrix of sensors but this is only my starting point and I must stress I have not made such a device so I don't know if it will work. It is attached.


* Sensor Matrix.pdf (22.85 KB - downloaded 20 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Are you suggesting I use a 4051 and loop through all the sensor readings?
Yes I think it will be the simplest option. You can cascade 4051s to get as many inputs as you like therefore you will need one 4051 for every 8 sensors.

Quote
Would these be suitable or fast enough to switch
Yes providing you are getting a good signal from the IR sensors. There is an associated serial resistance with the path through this device, this is different for different manufacturers so check the data sheet.

Quote
To my understanding, all I need to control these are 3 pins on the 4051s
The 3 pins select which one of the 8 wires is connected to the one wire. You can't say input and output because the is bidirectional it is just like a multiway switch controlled by the 3 select lines.

Quote
If I were to not use it as an input and rather an output, how would I do it?
See above the input is the output.

Quote
I havnt been able to find many 4067s are there any other 16 channel multiplexers that are similar
No in simple electronics like this the package size is the thing that determines the cost. As it is easy to use two 4051s these are mainly used in place of bigger multiplexers because of cost.
So far I have been talking about just expanding the inputs with a 4051.

You asked about a matrix, this is a bit more unusual. In fact I have never made a matrix of sensors.

Quote
If I have 3 4067s for a 8x12 matrix of LED's and 1 row of 12 photodiodes and 4 blank inputs reading on 1 input to the arduino,
Sorry I don't understand this, can you draw something. Look at http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html to see how a matrix should be wired.

I have drawn up what I would try if I were to make a matrix of sensors but this is only my starting point and I must stress I have not made such a device so I don't know if it will work. It is attached.

You are a legend, thankyou smiley I am getting real close to understanding what to do now smiley

This is the part I will be using, http://jaycar.com.au/productView.asp?ID=ZC4051&form=CAT2&SUBCATID=972#1 its a 4051 and I have drawn up a diagram to show an example of what I understand I can do with these smiley

To use this example, if I am correct, I would iterate through the inputs of the of the photodiodes that are connected to a 4051 to get the values which will be at A0, then to turn on my normal LED's, I will  select the pins on the 4051 to turn on using the pins 1,2,3 and 5,6,7 on the arduino, then they will allow for the current to flow through the pins from 4 to 8. Allowing for 64 LEDs and 2 less pins used on the arduino than before.

P.S: Red means output and blue means input on arduino in diagram



Is this what you mean I should do? smiley
Logged

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

Close but not quite right. It is not what I sent you but you could try it like that.

There is no need to connect the top 4051 to an arduino output, just connect that directly to +5V.
The next one down can go to an arduino input but you will need a pull down resistor on that input and you would be best connecting it to an analogue input.

I am not sure what the bottom 4051 is doing, are those LEDs or sensors. If they are sensors then that is the other way to use the 4051. If they are LEDs then no.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Close but not quite right. It is not what I sent you but you could try it like that.

There is no need to connect the top 4051 to an arduino output, just connect that directly to +5V.
The next one down can go to an arduino input but you will need a pull down resistor on that input and you would be best connecting it to an analogue input.
Im sorry, I dont understand what you mean, I have never used pull down resistors before and I dont understand what connecting the top 4051 to 5V does when used with a pulldown resistor?
What is the pulldown resistor for? Do I connect it to a button to switch the cuircut on and off or something?
Anyway, are these the modifications you mean?


I am not sure what the bottom 4051 is doing, are those LEDs or sensors. If they are sensors then that is the other way to use the 4051. If they are LEDs then no.
Yes it is the sensors, sorry for my bad diagram, I had a free period at school and took the oppurtunity using paint smiley-razz

Thanks again mikey smiley
Logged

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

You need to remove that switch and connect the pull down and pin 3 and the analogue input together.
Yes that is right with the 5V. The 4051 will supply 5V only to the row of sensors you have selected, the other rows will not be connected to anything and so will be floating.

I am not sure you have shown the sensors wired up the right way round, as you have it they look like LEDs which they are not.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to remove that switch and connect the pull down and pin 3 and the analogue input together.
Why do we do this, wont the LED's be on all the time? I think im misunderstanding the use of this smiley-razz

Yes that is right with the 5V. The 4051 will supply 5V only to the row of sensors you have selected, the other rows will not be connected to anything and so will be floating.
It should only power 1 Led at a time though correct?

I am not sure you have shown the sensors wired up the right way round, as you have it they look like LEDs which they are not.
Oh ok, I thought thats how you wire up photodiodes? I heard something about reverse voltage but I dont understand it, is it just placing it backwards?

Also I almost forgot how do I wire up the IR Emitters?

Thanks again mike smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Almost forgot smiley-razz

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

bump
Logged

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

Yes that looks right.
Quote
wont the LED's be on all the time?
What LED? They are all sensors.

Quote
Also I almost forgot how do I wire up the IR Emitters?
Do you need to controll them? If not wire them up through a resistor to the power and ground.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What LED? They are all sensors.
The top ones are supposed to be LED's and the bottom ones are sensors so that I can have a matrix of LED's lighting up when the sensors detect ir light(sorry for the confusion)

Do you need to controll them? If not wire them up through a resistor to the power and ground.
I dont think I need to controll them, they can stay on the whole time the systems on and wont blow up will they? Also does that mean I should wire them parralel to the arduino and then parralel to each other or connect it to the arduino's ground and power (I dont think its this one im just checking smiley-razz)

Thanks Mike smiley
Logged

Pages: [1] 2 3 4   Go Up
Jump to: