Seat Counter - Need help.

Thread Starter

arcteryx

Joined Feb 14, 2011
8
Hi. I'm building a prototype of seat counter. There would be 5 seats. Underneath the seat would be a switch. Whenever a person sit on the seat, the counter will counter 1. When 2 person sit on the seat, the counter will counter 2. Meanwhile, if one person stand up, the counter automatically subtract 1 from the counter. So, any recommendation on how I should start this project? Besides, I wanted to use 7-segment to display the number.
Thanks!
 

Bernard

Joined Aug 7, 2008
5,784
Connect all 5 SW commons together & to + V, say 12V. Connect each NO SW to a + out differentiator, outputs then into a 5 in NOR gate [ 4071 & 4025 ], out neg going pulse into UP input of up/dn counter [74C192. 74C193, 40192 or 40193 ]. Connect NO SW also tu neg. out differentiators, invert input to 5 in NOR, then into DN input of counter. Decode outputs via4510,or 4516 4 bit to 7 seg.
 

Bernard

Joined Aug 7, 2008
5,784
Here is a sketch of one solution. The 4001 is one of 5 de-bounce ckts to prevent possible multiple counts on one SW activation. Diode OR gates are shown but can be made up with logic gates. The 40192 has seperate up/dn inputs. Invertor at up input can be unused NOR, would be best if dn in was fed with a double inversion to shape neg pulse. The strange symbols are waveforms to show polarities.
 

Attachments

Thread Starter

arcteryx

Joined Feb 14, 2011
8
Here is a sketch of one solution. The 4001 is one of 5 de-bounce ckts to prevent possible multiple counts on one SW activation. Diode OR gates are shown but can be made up with logic gates. The 40192 has seperate up/dn inputs. Invertor at up input can be unused NOR, would be best if dn in was fed with a double inversion to shape neg pulse. The strange symbols are waveforms to show polarities.

Thanks! but where's the 5 switches?
 

Bernard

Joined Aug 7, 2008
5,784
Only one of 5 shown- on left side of drawing connected to the 4001, a single pole double throw switch. Also the OR gate resistors, shown as 10k, would be better if increased to around 100k. Would be better to add non inverting buffer between -OR & DN,or 2 invertors.
 

someonesdad

Joined Jul 7, 2009
1,583
I agree with debjit625. A microcontroller like the 18 pin PIC16F690 could do the whole job. In fact, if you run it with the right power supply voltage, you could even drive the segments of the 7 segment display directly without any current limiting resistors (depends on the 7 segment display chip). Then, except for a decoupling capacitor and the switches, there would be no other needed components.

The assembler and IDE needed are free and the microcontroller chip can be had for a few dollars. You will need a programmer; I recommend the PICkit 2 or PICkit 3. The PICkit 2 Starter Kit is $50 and it gives you a PC board with the 16F690 on it in a socket and some switches and LEDs to play around with. Study the included lessons and you'll know all you need to know. One of the lessons is how to debounce a switch, and that's code you can use directly. Another lesson is how to store data in ROM and you'd use that directly to store the information on how to light up the 7 segment display.

I just went through this stuff last week with a friend and we had a good time, so I know for a fact that this would be almost trivial (and fun!) to do with a microcontroller.

While that $50 might not look too attractive, realize that it enables you to make many projects in the future for just the cost of a microcontroller. Look at it as an expense for a textbook. If a decrepit old geezer like me can learn this stuff (and have fun doing it), you'll have no problem! :p
 

Thread Starter

arcteryx

Joined Feb 14, 2011
8
I agree with debjit625. A microcontroller like the 18 pin PIC16F690 could do the whole job. In fact, if you run it with the right power supply voltage, you could even drive the segments of the 7 segment display directly without any current limiting resistors (depends on the 7 segment display chip). Then, except for a decoupling capacitor and the switches, there would be no other needed components.

The assembler and IDE needed are free and the microcontroller chip can be had for a few dollars. You will need a programmer; I recommend the PICkit 2 or PICkit 3. The PICkit 2 Starter Kit is $50 and it gives you a PC board with the 16F690 on it in a socket and some switches and LEDs to play around with. Study the included lessons and you'll know all you need to know. One of the lessons is how to debounce a switch, and that's code you can use directly. Another lesson is how to store data in ROM and you'd use that directly to store the information on how to light up the 7 segment display.

I just went through this stuff last week with a friend and we had a good time, so I know for a fact that this would be almost trivial (and fun!) to do with a microcontroller.

While that $50 might not look too attractive, realize that it enables you to make many projects in the future for just the cost of a microcontroller. Look at it as an expense for a textbook. If a decrepit old geezer like me can learn this stuff (and have fun doing it), you'll have no problem! :p

Thanks. I already have the PICkit with 16F877A. but my problem right now is the programming. =( Do you have any website that you can recommend me to learn the programming. Thanks.
 
Top