Device for aligning eyes
Gunner0302
Posts: 12
This is my first post ever! So be gentle, please. I make grow lights, they are simple and do not take too much to build. But I need to build a device that will help me realign my eyes after a work accident. This device needs to be approximately 24X24. It needs to have two concentric circles of 12 LEDs each. It needs to have push button switched located at the LED (or the LED can be in the switch) that when pushed it turns off the LED and randomly illuminates another LED. This is a timed event and I need to know how many LED I pushed in a given time limit. I need to be able to select the amount of time and display the count on a meter. I have tried a 555 timer, it is easy to get this to turn LEDs on and off but I could not find a way to make it randomly select a different LED. If there is any suggestion as to an IC that can help with this, or a simple way to accomplish this, I am all ears.
Comments
You have lots of choices. Many of us would recommend the prop since it relatively cheap and way more powerful than most folks need, so you don't really have to worry about it coming up short.
In order to make a proper selection, we need to know a bit more about what you want to do. Establishing clear and complete requirements is the single most critical factor to success.
Can you draw a picture of what the device is supposed to look like, roughly?
Can you tell us a resource on where you got the idea for realigning eyes using this method? I never heard of it before (like so many things on the earth).
What kind of button, does it matter, what kind of times are we talking, does it matter, how many counts, is it unlimited, what kind of meter, what do mean by random, do you just want the light to jump around the ring on each button push?
After we ask and answer about a zillion questions, we will have something that should be easy to build and code. Then everyone will find it easy to help since its clear what you want.
If you want to get cheap, you can use separate LEDs and pushbuttons. If you want nice, but relatively expensive, you can get lighted pushbuttons with both the LED and the pushbutton in the same device.
To drive the LEDs, a 4-to-16 demultiplexer chip for each set of 12 LEDs might be simpler than using the 74595 shift register. Similarly, there may be a reverse, multiplexer chip that can encode the pushed button. Time delay is easy.
The Random number generation function is offered in both the BasicStamp and the Propeller.
http://www.jaycar.com.au/images_uploaded/74HC154.PDF
Board?
There is a reverse function chip. It is called a priority encoder. Take a look at the 74HC147 (1 of 8 inputs to 3 bits out) and 74HC148 (1 of 10 inputs to 4 bits out).
What's the total size (i.e. rectangular bounding-box dimensions) of the two LED arrays (both together and separately)?
-Phil
If you use a parallel LCD, that with require 7 I/O pins minimum. A serial LCD is more expensive, but uses just 1 or 2. Alternatively, you could use the Debug interface with a computer to time displayed on a computer screen.
The problem with the demultiplexers is that you need two and that would require another 8 i/O pins.
Trying to use 8 to 3bit encoders to connect 24 buttons would require another 8 to 9 pins. I had not considered a timer display.
Obviously, you are over the 16 pin limit. So the 74595 may be a much better solution as these can be chained together and require a minimum of 2 or 3 pins.
I suspect you will prefer a parallel LCD in 4 bit mode for 7 i/o pins and the two sets of three shift registers - one set or input and the other for LEDs, for maybe another 6 i/o. That is a total of 13 pins.
So it seems the multiplexers and decoders would just take up too many pins to be worthwhile. You seem to want yet another 12 LEDs to indicate the switch to push. So this is a lot of I/O.
http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf
http://www.nxp.com/documents/data_sheet/74HC_HCT165.pdf
Loopy,
I don't see where he is talking about LCD's. I'm just seeing LED's in the thread.
Jim
I am still trying to sort out a plan.
Though the demultiplexers have 4 bit inputs and he physically needs two, one could be used for 16 LEDs and the second for just 8 LEDs. Together, they would take just 6 output pins, not 8. The two others could be tied to ground - just 24 outputs would be functional.
But frankly, I haven't gotten a full count of all he needs. Are there 12 buttons or 24, and do these need to light up to indicate the correct choice.
OK,
"display the count on a meter"
I thought that may be a one or two digit 7-segment display.
A serial LCD may be a good option since it only uses one Pin.
-Phil
The Stamps have a random number operation that provides a pseudo-random sequence of 65536 values. You can use this to select one of 24 LEDs to light and you can initialize the random number sequence based on how long it takes to push the start button (a nice truly random factor).
As shown in the StampWorks chapters, you'll need series resistors for the LEDs and you'll need pullup resistors for the pushbuttons. The StampWorks Manual shows 10K pullups and 220 Ohm resistors in series with the 74HC165 input pins. The 220 Ohm resistors are optional and are for protecting the 74HC165 input pins from wiring errors.