method to debounce / ignore noise on ADC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
daveb0360
Posts: 139
Joined: Mon Sep 21, 2009 10:17 am
Location: Leicester
Has thanked: 35 times
Been thanked: 12 times

method to debounce / ignore noise on ADC

Post by daveb0360 »

Hi,
Can anyone suggest a method of including debounce or noise/spike suppression on ADC inputs.
My design watches for an analogue signal voltage falling outside a mid rail 'ignore' window and reacts accordingly. I have overcome this programmability thanks to the forum and can include hardware filtering on board but I would like to be able to write into the code that a reaction is only valid if voltage is outside this window for more than say, 250ms.

Any simple way this can be done?

Dave

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: method to debounce / ignore noise on ADC

Post by Benj »

Hi Dave,

You could add a low pass filter to the ADC inputs to do it via hardware. Low pass filter can be made with simple resistors and capacitors.

You could also add a software debounce by creating some kind of checking procedure.

eg.

sample = readADC

if ((sample > minrange) && (sample < maxrange))
yes: in range ok
no: outside of range, delay and retest.

daveb0360
Posts: 139
Joined: Mon Sep 21, 2009 10:17 am
Location: Leicester
Has thanked: 35 times
Been thanked: 12 times

Re: method to debounce / ignore noise on ADC

Post by daveb0360 »

Thanks Ben,
I already intend to have hardware filter and was just wanting belt and baces approach to augment the hardware because this trigger MUST NOT activate in error.

Your decision and retest is logical and I think a loop of 10 with 25ms per test is a good way to be sure.

Thanks for the input.

Dave

Post Reply