8 way / 16 way press switch project h e l p - Page 1
Forum section: electronics / projects

author: lifescape
author_rank: Newbie
timestamp: February 16, 2013, 10:02:04 pm
content: I Have a project that im not sure on the best way to tackle. I have 8 or 16 press switches that are in a matrix and feed a midi controller that is used to control a midi device to change midi channels. ie press sw1 and Program ch 1 is operated. Press sw7 and Program ch7 is then selected.Now i need a way of lighting an LED that corresponds to the switch last activated. so if sw1 pressed then LED01 needs to be on, but of course if sw3 is operated then LED03 needs to on and of course LED01 needs to go off.i have looked at various ccts but need a simple as possible cct to keep construction time and cost down.Any ideas would be appreciated or any links to suitable ideas so i can develop something.many thanksMikeUK

author: c4757p
author_rank: Super Contributor
timestamp: February 16, 2013, 10:11:11 pm
content: I'd just use a small microcontroller - PIC16F57 is $0.81 in single quantity at Mouser and easily has enough GPIO pins to handle two 4x4 matrices.

author: mariush
author_rank: Super Contributor
timestamp: February 16, 2013, 10:19:30 pm
content: Do you have an existing device you want to modify, or you have to make one?If you have to modify one, it's kind of hard to give suggestions, it depends how that device is designed. And you say the buttons are in a matrix, so I'm not sure how they would be in an existing device.If it's about modding an existing device, it could be as simple as using a hall effect sensor or using the voltage drop across a resistor... when current or voltage is detected through a trace going to the button, as the button is pushed you light the led (maybe using an opamp to amplify enough to drive an npn transistor or light the led directly)If you have to make one, the easiest would probably be use a microcontroller with enough pins to have 8-16 inputs and 8-16 outputs (or at least 3-4 pins to use a shift register) and a few resistors and light up the led directly from the microcontroller... no need for buttons in a matrix, microcontrollers are cheap enough.

author: lifescape
author_rank: Newbie
timestamp: February 16, 2013, 10:48:54 pm
content: Many thanks for those quick replies, yes as you both say its probably going to be better and possibly easier in the long run to use a pic.Its a new build / project not a mod as such, its just we have a ready made pcb that does the midi bit already. Im trying to add the led's so other users have an indication as to what 'scene'has been selected.many thanks to you both.Mike

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 16, 2013, 10:58:37 pm
content: This is definitely a job for a microcontroller. To get an idea of what it takes to scan a matrix-style keypad with just discrete digital components, look at the schematics inthis post.That circuit is a little more complicated that yours will be but you'd still wind up with probably 5 to 10 ICs. An MCU or CPLD can do what you want with just one IC.

author: lifescape
author_rank: Newbie
timestamp: February 16, 2013, 11:20:48 pm
content: Yea i think its going to have to be micro based.... had a look at your link and that brings back memorys. 7400 series etc etc.I did originaly look at an ardiuono but thought it was going to be an 'overkill' as i already have the midi interface with keyboard matrix.i.ll have a delve into the pic chips and the ardiuno. im thinking the ardiuno would be able to drive 7 segment display rather than an led which would look nicer.thanks for the helpmike

author: mariush
author_rank: Super Contributor
timestamp: February 17, 2013, 12:02:20 am
content: Anything will drive a seven segment (or more) ...Just get a common cathode seven segment digit to make your circuit simple and set the output on high on whatever pins you want, with a resistor between each pin and the segment to limit the current if needed... 470-1k ohm would generally do.A pic will output about 15mA on all pins, so depending on what seven segment you use and how bright you want the segment to be you may want to not light up all segments you need... you can just go with a loop and light up a segment for a few ms, turn it off, light the next segment that needs to be lit, turn it off... human eyes won't perceive the segments being turned on and off.