Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25416
Solder is electric glue
|
 |
« Reply #15 on: June 10, 2012, 03:34:33 pm » |
not analog ones, because I won't have enough of those You can use a 4051 to multiplex more analogue inputs. Reading an analogue signal with a digital pin will take too long for you in this situation. Look at this project for how to use a 4051:- http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 19
|
 |
« Reply #16 on: June 11, 2012, 09:03:24 am » |
not analog ones, because I won't have enough of those You can use a 4051 to multiplex more analogue inputs. Reading an analogue signal with a digital pin will take too long for you in this situation. Look at this project for how to use a 4051:- http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.htmlA multiplexer can only read a single signal at a time. It would be nice if I'm able to read multiple signals, so I can hit multiple "strings" (lasers) at a time. Is there any other way that will have quick response time, other than buying an Arduino Mega?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #17 on: June 11, 2012, 09:04:57 am » |
A multiplexer can only read a single signal at a time. But you've only got one A/D anyway, so you haven't lost anything.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25416
Solder is electric glue
|
 |
« Reply #18 on: June 11, 2012, 09:06:48 am » |
You missunderstand, you can't read more than one signal at a time on an arduino, even a mega. There is only one analogue to digital converter and a multiplexer inside the chip. For what you are doing you will not notice any extra delay from an external multiplexer.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 19
|
 |
« Reply #19 on: June 11, 2012, 09:07:31 am » |
But you've only got one A/D anyway, so you haven't lost anything. what do you mean exactly?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 19
|
 |
« Reply #20 on: June 11, 2012, 09:11:06 am » |
You missunderstand, you can't read more than one signal at a time on an arduino, even a mega. There is only one analogue to digital converter and a multiplexer inside the chip. For what you are doing you will not notice any extra delay from an external multiplexer.
So, how does it work? Does the arduino quickly read the analog values one by one?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25416
Solder is electric glue
|
 |
« Reply #21 on: June 11, 2012, 09:11:54 am » |
Yes if that is what your program tells it to do.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 19
|
 |
« Reply #22 on: June 11, 2012, 09:14:54 am » |
Yes if that is what your program tells it to do.
Which means I should be able to let him read multiple inputs quickly after eachother, right? Do you know how long it takes the arduino to read a series of 8 analog inputs?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 19
|
 |
« Reply #23 on: June 11, 2012, 09:17:16 am » |
Asked too quickly, just found this: It takes about 100 microseconds (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #24 on: June 11, 2012, 09:18:31 am » |
Do you know how long it takes the arduino to read a series of 8 analog inputs? Between 800 and 900 microseconds, assuming they're well matched. Figure on about 110 microseconds per conversion. (finger-in-the-air figure)
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25416
Solder is electric glue
|
 |
« Reply #25 on: June 11, 2012, 09:19:09 am » |
Is that fast enough for you, I think it will be. You can speed it up if you reduce the resolution but there is no need.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 19
|
 |
« Reply #26 on: June 11, 2012, 10:59:52 am » |
Is that fast enough for you, I think it will be. You can speed it up if you reduce the resolution but there is no need.
Yes it probably will be. This means it would be possible to play multiple tones at once, right? Providing I have the right piece of code, I could put my finger through a laser, giving a signal to the arduino. If I then keep my finger there and interrupt another beam, that would also be detected (in +-100 microseconds). Thanks for the suggestion Mike! All I need is 4051 now. This seems okay?: http://pieterfloris.nl/shop/product.php?id_product=386
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19003
I don't think you connected the grounds, Dave.
|
 |
« Reply #27 on: June 11, 2012, 12:19:48 pm » |
If I then keep my finger there and interrupt another beam, that would also be detected (in +-100 microseconds). No, on average it will be 400 or so microseconds.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 19
|
 |
« Reply #28 on: June 11, 2012, 12:30:57 pm » |
No, on average it will be 400 or so microseconds. Oops, misread. Thats fast enough too. So with that IC it should be very doable. Something else: It has been mentioned that driving the lasers is going to be rather tough, because of current that won't be completely constant. Heres the thing: I've been looking at these: http://www.dealextreme.com/p/20mw-532nm-green-laser-module-3v-11-9mm-26887 lasers, I already have the 50mw version, and as you can see on the pictures, it already has some sort of IC on it, and I was wondering if maybe that is to stabilize the current? And if not, what IC would I need to do such a thing?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 269
Posts: 25416
Solder is electric glue
|
 |
« Reply #29 on: June 12, 2012, 04:51:26 am » |
You can't wire modules like that in series, you will need a stabilised supply. They are very powerful, make sure you construct this with the lasers pointing down and don't have anything that could give a reflection. This is a video of my LED harp made about 12 years ago. https://vimeo.com/35657529
|
|
|
|
|
Logged
|
|
|
|
|
|