My Account
My Content
 
My Briefcase
My Sites
 
Electronics Design Engineering Lounge
Previous Next
 
 

Push button Switch

 

I want to count widgets as they go by on a conveyor belt and set up a push button switch and a digital counter so that as the widgets go by they activate the switch and increment the counter. But the problem I am facing is that the first widget produces a count of 1, the second widget causes a count of 21, and so forth. What's going on?

By Sanjay Chawla on Oct. 31, 2008
Forum: Switches - # of views: 1980

#1

Mr. Robin Elkins
October 31, 2008 - 4:53pm
 

Hello! I see your (potential) Problem as a large number of possibilities.

One that comes to mind, right away, is that your "toggle switch" does not have a "Debounce" circuit connected to it, therefore, every time it flips, it actually emits a series of exactly 21 Pulses.

A Simple "debounce circuit" can be constructed by using the (ever popular) 555 Integrated circuit. You can find such circuit diagrams "on the web", or I could draw and scan one for you, if you email me. My email is: LASEROB@aol.com

My website is www.elkindustries.com. I am a Design Engineering Consultant of over 30 Years. I normally charge $150 per Hour for my time doing Debugging, so you are getting a big "free be" here.

Another Problem may have to do with your digital counter. Have you built digital counters before? Many "things" can go "haywire" if you are "over your head" in what you are trying to do.

Also, I would use an alternate method of counting your "Widgets". Instead, I would use an inexpensive, collimated (visible) LASER, and opposite it, put a corresponding PIN Photo diode, which would act as the input to the Digital Counter. Then as the Widgets pass by on the conveyor belt, they will block the beam, long enough to cause your debounce to Produce a single Pulse - longer than the time the widget takes to pass the "electric eye" (Photo diode). Why? Because, otherwise, parts of the "widget" may produce more than one pulse as they pass the LASER beam, such as holes or low points in the widgets.

Much more elaborate systems can be developed to accomplish this simple task. However, my BET is that either you do not have a "Clean" Switch operation (typically switches make thousands of tiny pulses as they change states from on to off), that is why "debounce circuits" were developed. OR, you have screwed up somewhere in your connections to/with the Digital Counter.

It is a rare possibility, but you could actually have a "BAD" Digital Counter IC. Are you using it on the "rising edge", or the trailing edge? Is it positively triggered?, or negatively triggered?

Also, if you are using a CMOS Counter, it is very important to tie all unused inputs to V+ or to GND. However, you must know what you are doing there, or you will defeat or disable the IC's operation.

This is probably the "BEST" answer you will find, anywhere.

**************  LASEROB !! 

 

 

 

#2

Devendra Singh
November 4, 2008 - 5:47pm
 
Of course this is due to debouncing of your switch. I have attached one circuit which produces a single debounced pulse each time you press S1. Moreover, the circuit uses only logic power from the remote pull-up resistor, R2. You can use the circuit to detect when a key is pressed. I hope this will help you out from your switch debounce problem.

Attachment(click to download)
debouncer ckt.JPGdebouncer ckt.JPG 8.05 KB

 
 

Related Discussions

Back
Previous Next
Jump to forum

Translator
Translator
X
Translate this:
Translate
  • English
  • Spanish
  • Chinese
  • Japanese
  • German
  • French
  • Italian
  • Korean
  • Russian
  • Portuguese
  • Dutch