I want to build a multiple countdown clock with adjustable input
I have to input 5 time in the format 00:00:000 mm:ss:000
I was thinking about using 5 set of 7 rotary switch each
but how can I read all the values ?
(there are some rotary switch with only 0-5 range ? is not a real problem because I can check if the input is correct with the software but a 0-5 dial will be more user friendly)
You could do that with one rotary encoder and a push-button switch to define whether the encoder was being turned for seconds or minutes.
As the encoder turns one way, for seconds, add another second to the time, for each click. When it passes 60, add a minute, and reset seconds to 0. When it turns the other way, subtract a second per click. Borrow a minute, if needed.
Why do you think you need 5 rotary encoders to set tens of minutes, ones of minutes, tens of seconds, and ones of seconds? What would the other one be for?
I was thinking about using 5 set of 7 rotary switch each
What's the 7 mean? What kind of switches are you thinking of?
ok , today I talked a little with the future users of the device and they agree to use screwdriver dial (they are all Vintage Vespa owners and many of them are more than 70 years old , they have no problem for the screwdriver , they just asked for bigger numbers) ;D ;D
I also reduced the input to 4 digit for each time ( make no sense trying to have a millisecond precision on an Old Vespa racing)
so the countdown range will be from 000,1 to 999,9 seconds
So I was thinking about using 3 digital pin to choose wich time , 2 digital pin to choose wich rotary
to use 4 analog input to (save the digital pin) for reading the rotary value
and to show the count down on a display like this one
a 4 digit 7 segment display
how many pin I need (and do I need some additional chip ) to drive a display like that ?
Sorry but that display is no good for you, it is just a raw LCD and need proper LCD driving and multiplexing. Also LCDs are difficult to see in bright daylight. Go for something like an intelligent LED display, like being currently discussed on this thread :- http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1283258903/15#15
on the right there are the rotary ( just one pictured) with a 5 bit mux (or demux? ) to choose one rotary at the time.
The value from the rotary end into the analog input where i can readit with an AnalogRead and convert it to 0/1 value (Im using the analog for reading to save digital pin)
on the left there are the 7 segment displays , with 4 pin I choose witch digit I need to update , with the other 4 pin I send the value to the driver for conversion from 4 bit to 7 segment (I found out that this driver can be made by just a lot of diodes and wires :o )
You are using pins 0 & 1, this will interfere with the serial communications.
You don't use multiplexers like that. What is the multiplexer part number anyway?
You don't connect switches to the analogue pins.
You should do a proper schematic where we can see what the switch connections actually are. What you have is a construction diagram, you draw that after you draw the schematic.
What is the part number of your driver?
The arduino pins can't source enough current to drive the common anodes of the display. There are 7 segments and a 30mA limit (don't design for 40mA maximum) so that only gives you 4mA per segment, this will not be bright enough.
You need current limiting resistors in the cathodes.
To answer the original question you need a 74LS155 demultiplexer wired up as a 1 line to 8 demultiplexer. You then put the input to ground, then there will be a logic zero on the output pin designated by the three select pins.
Each output pin goes to the common wiper of one switch. The 4 switch outputs go through a diode each with the cathode towards the switch and the anode to the digital arduino input (you can configure the analogue inputs as digital inputs). Repeat this for each of your 8 rotary BCD switches. Each switch has it's own set of 4 diodes and connects to a different pin on the 74LS155 but all going to the same 4 input pins as the other switches. Then enable the internal pull up resistors on the digital inputs.
To read any one rotary switch but the number of it on the three select pins and read the four input pins.
To read more than 8 switches then cascade two or more of the 74LS155 chips.
I used Arduino for some small project with the Ethernet shield (web interface for analogic or digital sensor) but is my first time that I'm using it with some external electronic
So I need to buy 3 74LS155 chip
16 rotary switch
some wire
For the LCD parts I was thinking to use reflective LCD so save power , Arduino can drive this kind of display directly?
what kind of chip I need to drive this type of LCD ( 4 digit 7 segment reflective LCD)