Help debouncing my Marble Counter Project

Hi! My goal is to create a simple marble counter. I’m using a steel bearing to complete a circuit and trigger my i3 Button (the wire leads seen in the video are soldered directly to it). As you can see, the issue is that the marble triggers too many counts, when I want just one. I have tried to insert the Threshold bit between the button and the display, but it serves to basically turn on or off this behavior but it doesn’t accomplish a fix. Thanks in advance for your advice!

see YouTube video of prototype

Hi @Hock,
I tried a few setups to copy your too many counts.
I found that placing the timeout bit (i27) between the button and the number bit works !
I did set the time out bit to minimum time (turned the setting counterclockwise) and the selector switch on OFF-ON, and tested the triggering.
I think your setup with the wires and the metal marble generates one (or more) very short pulse(s).
I tested the button when it was directly connected to the number bit and it triggered OK when pushing it slow. When ticking it quickly it started to trigger erretically indeed !
The time out bit will skip unwanted triggers in the time between the first trigger and the time set. (I think).
Hope this helps!
(Else I found out another trick with the protobit, let me know if you want that one also)
:smile:

1 Like

Hi @alexpikkert - great news - thank you! Yes, I’d love to hear what you learned about the protobit as well. Thank you!

1 Like

Hi @Hock,
When you remove the middle connector (from the SIG line) on the protobit and connect a capacitor of 0.22 uF from SIG IN to SIG OUT then (to my surprise) the bouncing is also gone (after just a few tests)…
I am not sure this will help with your marble setup, just try it if you want, the proof of the pudding is in the eating…
:smile:

4 Likes

Oh, very cool. Thanks for the tip!

Hi @Hock

If the capacitor works YAY! Let us know if it does. If it doesn’t, also post back here. There are some more complicated things you can try as well, like this or this.

Your teaser video looks very cool.

3 Likes

Hi Chris @chris101 ,
Indeed your solution will be better, based on the debouncing theory… my solution was qad (quick and dirty) but it seemed to work… @Hock

I always prefer qad if it does the job.

1 Like

@chris101 - thank you! I will order some parts from Digikey and try both solutions and report back.

Glad you enjoyed the teaser :smile:! If you liked that you will be blown away by the real thing. More on that later!

2 Likes

Hi @chris101, I was just ordering some parts to try out your magnetic reed circuit (or, more specifically, the portion of the circuit that smooths out the signal). I assume you pointed me to this because if I basically substitute my marble “switch” for your reed switch, I have exactly what I need to solve this issue? I am not great at reading schematics but it seems straightforward enough. I pulled up some standard through-hole resistors and 50V aluminum type caps (rated 20%). All sound ok to you? If you have a Digi-Key part list for that circuit that you want to share, please do! Thanks!

I also ordered a cap to try @alexpikkert’s quick and dirty fix. I’ll try both …

2 Likes

Hi @Hock,

I don’t have any part lists, sorry. I usually rummage around a bunch of new + old stuff I have and see what will fit the need. For that project, I used ceramic caps, since in a de-bounce situation, you are dealing with spikes and drop-outs, so don’t really know what the polarity will be. (ps, @alexpikkert, I finally figured out that is what the diode is for, to keep from cross polarizing an electrolytic cap if used in this situation.)

50 V caps should provide MORE than enough leeway! (for a 5V system.) I’m sure my circuit is a lot of overkill, so DO try the single capacitor first. It will undoubtedly save you a LOT of time and board space.

2 Likes

Hi @chris101, thank you! DK does not appear to have any through-hole 480k resistors in stock which is odd to me. Is there a substitute part/value you can recommend?

I used a 470 ohm resistor. I’ve never bought from digikey, but here is one they say is in stock, minimum order is one, and it’s eleven cents:

http://www.digikey.com/product-detail/en/CFM12JT470R/S470HCT-ND/2617620

Have fun!

1 Like

Thanks @chris101, order placed and I will update results once I have a chance to play with this. Thanks again!

Hi @chris101 and @alexpikkert, I ordered parts for both solutions but the quick-and-dirty solution worked like a charm! See photo with part number attached. I will rig up the real thing ASAP and send a teaser of what I’m up to … Thanks much to you both!

2 Likes

Nice soldering job on the bottom of your bit there @Hock!

Hi @Hock,
Waiting for your teaser and the detailed project ! It looks great, please share it so we can all learn from you ! :clap:

Hi @chris101 and @alexpikkert, check out the debounced working beta of the marble counter project. I’m intentionally not showing the entire machine here - this is a product as-of-yet unreleased. But check out www.tinkineer.com and add your email to the notification list. Coming very soon! Thanks again for the advice!

3 Likes

It looks very good Hock - the count is nice and smooth. Good luck with your venture!

Hi @Hock,
Count your marbles !
I wish you lots of success finishing your project !
Great work !