MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
EPICfan
Posts: 14
Dear all,
I am trying to connect Grayhill 62 B optical encoders, and I am running into two problems:

1) I understand that encoders do not need pull-up or pull-down resistors because this handeled on software level by MobiFlight. I have connected Output A und Output B to each one digital pin (directly). In the default setting, I got four pulses / inputs per detent. Under "Extras" -> "Settings" -> "Type" I have selected 4 detents per cycle. Still, I am getting double outputs for every detent.

2) I don't know how to connect the pushbutton - one end to ground and another one to analogue? or digital? I tried both and it did not work.

This is the datasheet for the controller: http://www.grayhill.com/assets/1/7/Opt_Encoder_62B.pdf

The board is an Arduino Mega 2560 Rev. 3.

Would be glad for some help,
Holger
[Last edited by EPICfan, 2020-02-22 17:27]
2020-02-22 14:16
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi Holger,

you are on the right way, but I think you forget one important thing which can be read in the datasheet.

You are right that the internal pull up resitances of the Mega are activatet by the firmware.

But: the internal pull ups have a value of 10 kOhms and the Grayhill needs 2 pullups with a value of 2.2kOhms. So you have to connect from pin 6 and pin 7 two pull ups to +5V separately!

GND is connected to pin 1.

From the pullbuttons one pin also is to be connected to GND (ie pin 2 and 4). Pin 3 and 5 connect to the Mega pins to evaluate.

This type may have 16 or 32 detents per revolution so you have to figure out how many detents generates a pulse. This is the type you have to install for the device in MobiFlight.

Hope this helps.
Grüße,
Stephan (Time: UTC+2)
2020-02-22 18:21
Avatar
EPICfan
Posts: 14
Thank you for being so encouraging, Stephan. I have no clue about electronics, my apologies. But I have read up on the internet, so I think I can at least follow instructions. When you tell me to connect pins 6 and 7 to the resistors, does it mean they branch out like a "Y"? Meaning one leg of the "Y" to the resistor and then to the 5+ and the other leg to the Arduino pin?

Best regards,
Holger
2020-02-23 05:34
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi Holger,

it's no shame not to be familiar with electronics. What do you mean, how many people drive a car and can't fix it.

You connect outputs 6 and 7 as normal with the pins of the Mega. In addition, you connect one end of the resistor to pin 6 or pin 7 and the other end to + 5V. The comparison with the Y fits well. It doesn't matter whether you solder the resistor to the encoder or the mega-pin.
Grüße,
Stephan (Time: UTC+2)
2020-02-23 12:05
Avatar
EPICfan
Posts: 14
Thank you very much, It is working now! Only if I turn the encoder fast, I am getting a pulse in the other direction about every 25th to 29th detent.

It does not seem very logical as the "spacing" between the opposite pulses is not regular. I can "count" pretty well as I am not yet working with the simulator, but the encoder is generating key presses which I can then count (notepad).

The setting for the encoder is the last one (4 detents per cycle) The other settings produce detents without pulses.

Best regards,
Holger
2020-02-29 11:03
icon