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
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:- MIDI Footsteps
A 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?
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.
Grumpy_Mike:
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?
Grumpy_Mike:
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?
Grumpy_Mike:
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
AWOL:
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?
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.
Yes. You need a good regulator or split them up into two or more groups with a regulator each. Also have plenty of decoupling capacitors between each laser module.
Grumpy_Mike:
Yes. You need a good regulator or split them up into two or more groups with a regulator each. Also have plenty of decoupling capacitors between each laser module.
Thanks! I'll have to re-do my drawing, although I'm not really familiar with using decoupling capacitors and regulators.
For the capacitors, would wiring a cap from before the laser, to the ground (for each laser) do the trick?