Scanning encoder debounced according to Bourns with Owon SDS1104 scope

Thread Starter

H treboR

Joined Jun 6, 2024
12
I am scanning an EC11 rotary encoder wired according to Bourns debounce design using a Owon SDS1104 scope:

R1 = 10K
R2 = 10K
C = 0.1uF (Bourns uses 0.01uF)

https://www.bourns.com/docs/technic..._enc_sgnl_cond_technote.pdf?sfvrsn=348415eb_4

Bourns debounce drift LOW.png

The peak 5V voltage slowly drifts up as I turn the encoder, and then settles back down. That is not the problem.

I'm concerned with the low voltage, it's also drifting up, well above the 0.8V threshold that is often referred to in Microchip PIC documentation as the LOW level. The 10 or so encoder signals to the right would not get picked up.

Is this normal with RC debounce circuits?

Or is the graph on this $250 DSO drifting north because it's low quality?


And yes, please don't assume that I know more than the absolute basics in electronics.
 

nsaspook

Joined Aug 27, 2009
13,636
I am scanning an EC11 rotary encoder wired according to Bourns debounce design using a Owon SDS1104 scope:

R1 = 10K
R2 = 10K
C = 0.1uF (Bourns uses 0.01uF)

https://www.bourns.com/docs/technic..._enc_sgnl_cond_technote.pdf?sfvrsn=348415eb_4

View attachment 324001

The peak 5V voltage slowly drifts up as I turn the encoder, and then settles back down. That is not the problem.

I'm concerned with the low voltage, it's also drifting up, well above the 0.8V threshold that is often referred to in Microchip PIC documentation as the LOW level. The 10 or so encoder signals to the right would not get picked up.

Is this normal with RC debounce circuits?

Or is the graph on this $250 DSO drifting north because it's low quality?


And yes, please don't assume that I know more than the absolute basics in electronics.
Looks about what you would expect (scope and what's seen in the circuit look normal) to see from a low pass filter with a pulsed DC input. Reducing the filter cap to the recommended 0.01uF (and maybe a bit of load resistance) should reduce the DC component of the filtered signal.
 

bertus

Joined Apr 5, 2008
22,315
Hello,

Did you try the 0.01 uF capacitor?
It could well be that the 0.1 uF capacitor holds the charge by turning the encoder.

Bertus
 

Thread Starter

H treboR

Joined Jun 6, 2024
12
...Reducing the filter cap to the recommended 0.01uF (and maybe a bit of load resistance) should reduce the DC component of the filtered signal.

If I reduce the cap to 0.01uF, I get signals like this if I turn the encoder a little fast.

SDS1104 encoder fast speed.jpg


About the load resistance, you mean decreasing the value of R2?
 

nsaspook

Joined Aug 27, 2009
13,636
If I reduce the cap to 0.01uF, I get signals like this if I turn the encoder a little fast.

View attachment 324003


About the load resistance, you mean decreasing the value of R2?
That looks like a nasty switch bounce that will limit high speed RC debouncing with any method. Those cheap encoders are designed for limited speed turning applications like a mode or volume switch.
A long time constant does not work (DC offs and other issues) when the knob is turned fast and a short time constant doesn't debounce with a very noisy switch. It will be a compromise with that encoder.
1717711431456.png

Looks like you need about 10ms of debounce. So 10K ohm and C=0.1uf is about what you need.
 
Last edited:

Thread Starter

H treboR

Joined Jun 6, 2024
12
... A long time constant does not work (DC offs and other issues) when the knob is turned fast and a short time constant doesn't debounce with a very noisy switch. It will be a compromise with that encoder.

Looks like you need about 10ms of debounce. So 10K ohm and C=0.1uf is about what you need.
That's what I was afraid of. :(
I'm getting an assortment of ceramic caps tomorrow. I'm going to test between 0.01uF and 0.1uF. Hopefully I can get a slightly "less bad" compromise happening.

I still don't understand how I can end up with more than 5V with an RC circuit though. Discovery Channel tells me I can't destroy of create energy/matter. And I'm pretty sure I'm not converting mass to energy on 5V from a PC USB cable. :D
 

nsaspook

Joined Aug 27, 2009
13,636
That's what I was afraid of. :(
I'm getting an assortment of ceramic caps tomorrow. I'm going to test between 0.01uF and 0.1uF. Hopefully I can get a slightly "less bad" compromise happening.

I still don't understand how I can end up with more than 5V with an RC circuit though. Discovery Channel tells me I can't destroy of create energy/matter. And I'm pretty sure I'm not converting mass to energy on 5V from a PC USB cable. :D
Capacitors store energy. With each +5V pulse, some of the energy from the power supply is moved into the cap's electric field. If not all of that energy is discharged back into the circuit before another pulse you have a some of that residual electric field potential energy left in the cap, plus the energy from the next pulse. The total electric field potential energy is expressed as a voltage V and charge Q on the capacitance when measured using your scope.
1717721832540.png
https://courses.lumenlearning.com/suny-physics/chapter/19-7-energy-stored-in-capacitors/
 

sparky 1

Joined Nov 3, 2018
800
There is some adjustments depending on the switching rate other than adjusting to optimize the values from datasheet specs.
Unfortunately, could not find any application note for the MC14490 debounce filter using an encoder.

In order to understand the debounce filter better some have explored the circuit using momentary switch like in the video below.
The digital oscilloscope is being used on 2 channels, modifying the delay was done by changing the timing capacitor.
Zooming in on MC14490 output on the second channel is shown and is producing a very nice clean debounced signal.

If a test setup does not look the same as the video then call Lilliput electronics in Walnut California.
By allowing them to walk you through the Owon settings you can be confident the scope and the test setup are correct.


 
Last edited:

nsaspook

Joined Aug 27, 2009
13,636
The MC14490 is a neat IC, but cost and availability is not pretty (only 1 left at JLCPCB, $3.65/unit).
These are likely too expensive (and overkill for your application) too but I've used them for some heavy duty industrial switch debouncing.
https://www.analog.com/media/en/technical-documentation/data-sheets/max6816-max6818.pdf

The MAX6818 octal switch debouncer is a great device for interrupt driven DIO when up to 8 switches need to be monitored. The dual input MAX6817 is perfect for old school switch encoders.
 

Thread Starter

H treboR

Joined Jun 6, 2024
12
... The MAX6818 octal switch debouncer is a great device for interrupt driven DIO when up to 8 switches need to be monitored. ...

I had found that one on another forum, but it's $4.37CAD at JLCPCB, and there's only 84 left. When those run out, I'll have to pay whatever the going rate is.


I settled on the Bourns RC circuit with 0.1uF, suffixed by a 74HC14.

Thanks to everyone that commented. :)
 

nsaspook

Joined Aug 27, 2009
13,636
I had found that one on another forum, but it's $4.37CAD at JLCPCB, and there's only 84 left. When those run out, I'll have to pay whatever the going rate is.


I settled on the Bourns RC circuit with 0.1uF, suffixed by a 74HC14.

Thanks to everyone that commented. :)
Now you see why there is a preference for optical/ magnetic electronic switched encoders. The switch bounce countermeasures for those mechanical encoders like the EC11 (Chinese clones of the original expensive ALPS EC11 series) is why they are cheaper. You need adequate wetting current (pull-up resistors) to keep the contacts clean, current limiting resistors to limit filter capacitor discharge current through the contacts and have limits on rotational speed because of all of this..
 
Last edited:

nsaspook

Joined Aug 27, 2009
13,636
Eliminate the caps, and do it in software.

.asm / C
Exactly but the crappy mechanical switch bounce will still limit the encoder rotation decoding rate even with the ALPS original versions (I've used them in projects). They are fine for something like a volume control that is slow and is seldom changed.
 

joeyd999

Joined Jun 6, 2011
5,440
Exactly but the crappy mechanical switch bounce will still limit the encoder rotation decoding rate even with the ALPS original versions (I've used them in projects). They are fine for something like a volume control that is slow and is seldom changed.
The encoder spec limits the rotation rate to 60 RPM max. If he needs more, he needs to choose a different part.
 
Top