Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4541100 - 10/16/20 07:34 PM Bu0386x unwanted input momentary switch on encoder  
Joined: May 2007
Posts: 1,562
Cold_Gambler Offline
Member
Cold_Gambler  Offline
Member

Joined: May 2007
Posts: 1,562
Hi there,
I'm making a generic GA electrical panel.
I'm using an encoder for the cockpit/instrument lighting dimmer.
The encoder I'm using has a push momentary switch which I'd like to use.
I'm usin the Leo Bodnar bu0836x board to drive the panel.
I've downloaded and used the encoder software and the encoder is working.
I've also wired the mom switch and it is working as well.

The problem is that when I turn the encoder I get button presses registered even though I am not activating the switch.

The switch connector's are: clk; dt; sw; +; and gnd.

Any help to eliminate phantom input would be great!
Thanks.


looks very modernishy-phoney-windows eighty-tabletty like

Asus P8P67 Pro Rev. 3.0 // i5 2500k @4.3 GHz with Noctua NH-D14 // nvidia gtx 780 // 8 GB DDR3 1600 //Win7 home 64 bit //450 GB VelociRaptor //Recon3D Champion
Inline advert (2nd and 3rd post)

#4541106 - 10/16/20 08:12 PM Re: Bu0386x unwanted input momentary switch on encoder [Re: Cold_Gambler]  
Joined: Dec 2009
Posts: 748
AndyB Offline
Member
AndyB  Offline
Member

Joined: Dec 2009
Posts: 748
Ayrshire, Scotland
HI,

I think the problem is in the way the encoder works. When you turn the shaft one way you get the equivalent of a switch being pressed. Turn it the other way and you get a different switch pressed. Push down on the shaft and you get the third switch pressed.

Your problem is that all three functions are separate.

Your encoder gets a clock pulse from somewhere in to the CLK pin. When this is supplied the DT (data) pin is read. If it's logic high then the shaft was turned one way, if logic low then the shaft was turned the other way.
SW is the output when the switch is pushed and may be either logic high or low.

In something like an arduino you'll have to monitor the SW output. When it is activated, you then send a CLK pulse. Then read the DT output to see if it was turned left or right.

Based on that information you would then increase or decrease the lighting level.

I haven't had a lot of experience with encoders, just the basic functions so someone else may have a better idea of how to make it do what you want.

Good luck anyway.

Andy

PS In my pit I just used an analogue circuit with a pot to alter the voltage to the instrument lighting led bus.


Andy's simpit: http://www.simpit.me.uk
#4541114 - 10/16/20 10:59 PM Re: Bu0386x unwanted input momentary switch on encoder [Re: AndyB]  
Joined: May 2007
Posts: 1,562
Cold_Gambler Offline
Member
Cold_Gambler  Offline
Member

Joined: May 2007
Posts: 1,562
Thanks for your help Andy!
I appreciate your comments. I'll keep fiddling and researching :-)


looks very modernishy-phoney-windows eighty-tabletty like

Asus P8P67 Pro Rev. 3.0 // i5 2500k @4.3 GHz with Noctua NH-D14 // nvidia gtx 780 // 8 GB DDR3 1600 //Win7 home 64 bit //450 GB VelociRaptor //Recon3D Champion
#4541189 - 10/17/20 05:07 PM Re: Bu0386x unwanted input momentary switch on encoder [Re: Cold_Gambler]  
Joined: Nov 2001
Posts: 3,955
Sokol1 Offline
Senior Member
Sokol1  Offline
Senior Member

Joined: Nov 2001
Posts: 3,955
Internet
From Leo Bodnar page, for "Rotary encoder CTS288V":

[Linked Image]

ELMA Encoder

[Linked Image]

Don't forget the 1N4148 diode if are using BU0836A - for X is not required.



Last edited by Sokol1; 10/17/20 05:08 PM.
#4541385 - 10/19/20 12:24 PM Re: Bu0386x unwanted input momentary switch on encoder [Re: Cold_Gambler]  
Joined: Dec 2009
Posts: 748
AndyB Offline
Member
AndyB  Offline
Member

Joined: Dec 2009
Posts: 748
Ayrshire, Scotland
Hi,

I came across this page while doing a bit of
research and thought it might help you understand what is happening with your encoder.

https://www.seeedstudio.com/blog/2020/01/19/rotary-encoders-how-it-works-how-to-use-with-arduino/

Cheers,

Andy


Andy's simpit: http://www.simpit.me.uk
#4541455 - 10/19/20 04:47 PM Re: Bu0386x unwanted input momentary switch on encoder [Re: Cold_Gambler]  
Joined: May 2007
Posts: 1,562
Cold_Gambler Offline
Member
Cold_Gambler  Offline
Member

Joined: May 2007
Posts: 1,562
Thank you both for responding.
I believe the problem may be because I did not attach the + contact to the 5v, but rather to ground.

I will try this and see if that resolves my issue.


looks very modernishy-phoney-windows eighty-tabletty like

Asus P8P67 Pro Rev. 3.0 // i5 2500k @4.3 GHz with Noctua NH-D14 // nvidia gtx 780 // 8 GB DDR3 1600 //Win7 home 64 bit //450 GB VelociRaptor //Recon3D Champion
#4541463 - 10/19/20 05:32 PM Re: Bu0386x unwanted input momentary switch on encoder [Re: Cold_Gambler]  
Joined: May 2007
Posts: 1,562
Cold_Gambler Offline
Member
Cold_Gambler  Offline
Member

Joined: May 2007
Posts: 1,562
That was it. Once attached to the +5v the switch operates fine without any ghosting.

I'm attaching a photo of my project. Electrical panel: The "keys" are glued to a 6throw 2pole switch. The encoder is next. Alt/batt master and other switches are single throw. The toggles are 2throw (and wired to go to different buttons up and down) the switch at the right is on/off/on for flaps.

The throttle/mix/prop pitch knobs are temporary and will be replaced once IKEA knobs arrive by mail (they'll be shaped and painted).

The trim unit is attached to a pot. The trim indicator is geared down (gears hidden in the housing).

I'm waiting for two more slide pots for aileron and rudder trim to add to the elevator trim unit.

Then I'll figure out labels and trim off the brass rods (sticking out from the left of trim unit).

Thanks again :-)

Attached Files 160312841354429319026.jpg
Last edited by Cold_Gambler; 10/19/20 05:43 PM.

looks very modernishy-phoney-windows eighty-tabletty like

Asus P8P67 Pro Rev. 3.0 // i5 2500k @4.3 GHz with Noctua NH-D14 // nvidia gtx 780 // 8 GB DDR3 1600 //Win7 home 64 bit //450 GB VelociRaptor //Recon3D Champion

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
CD WOFF
by Britisheh. 03/28/24 08:05 PM
Carnival Cruise Ship Fire....... Again
by F4UDash4. 03/26/24 05:58 PM
Baltimore Bridge Collapse
by F4UDash4. 03/26/24 05:51 PM
The Oldest WWII Veterans
by F4UDash4. 03/24/24 09:21 PM
They got fired after this.
by Wigean. 03/20/24 08:19 PM
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0