Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter

Using encoder with push button shaft with Brain jr.

I have a bunch of encoders that I got off ebay for various projects.  They all have a push button shaft and 5 pins.  I can get the encoder portion to work using the L, R and C pins, but I cannot get the push button to work right. I tried to plug the remaining 2 pins into an open button pair on the header but that didn't seem to work either. So can both elements of these encoders work with the Brain Jr? 

Comments

  • Yes, they both can work. Those back two pins are always a standard button (as far as I've seen), and the two pins on them are interchangeable.
    Double Check your wiring,  if you are still having problems send us a pic of the wiring of the Encoder Push-Button, and we'll help you figure it out.

  • TorTor
    edited June 23

    Hi, I am also trying to use a button shaft encoders with a brain jr. I don't really need the button function. The encoders I have are 5 pin. I've tried connecting just three pins for the encoder to the jr in all the combinations I could think of, but have had no luck so far. I can send a signal that changes values in only one direction. Changing the config in the editor to +/- doesn't seem to make any difference.

    Below is a link to a page that discusses the same encoders I have. Any guidance would be greatly appreciated! I don't even know enough to figure out if they are compatible. Lol, I'd hate to beat my head against a few two dollar components any longer if it's not going to work.

    https://www.google.com/amp/s/bigdanzblog.wordpress.com/2014/08/16/using-a-ky040-rotary-encoder-with-arduino/amp/

    Thanks!

  • Hi Tor,

    Translating this web page into brainjr terms...
    Connect CLK to Button 1 (Brain Configure ID 0) (- side)
    Connect DT to Button 3 (Brain Configure ID 2)   (- side)
    Connect V+ to Button 1 (Brain Configure ID 0 ) (+ side)
    Connect SW to Button 5 (Brain Configure ID 4) (- side)

    The trick here is that all of these buttons share v+ so they have to use the same button column on the brain jr. (This is why you are using every other button, rather than each individual button.)

  • Thanks Moon,


    I was trying to isolate the  encoder with just three connections before. Unfortunately I don't get any response in the Brain Jr config when I connect the pins like you suggest. Should the GND also go to one of the headers on the brain? 

    I don't mind hooking it up so the push button is active, even though it's not necessary to my goal.
  • TorTor
    edited June 24

    I've been swapping around and experimenting,  This is the config I seemed to get the most out of. Maybe this will help.


     header 2 (-) to GND
     header 2 (+) to DT
     header 4 (-) to CLK
     header 6 (-) to SW



    I've linked a pic of my output. (couldn't get it to embed) The orange box is what I get when i turn the encoder in either direction. It's the same either way. The blue box is the response from when I press the button shaft. 

    I can switch  the DT and CLK wires with no change in response in the tools window. When I swap the GND with the + pin on the encoder I receive no feedback in the tools window at all. Ive tried throwing the + pin wire into random headers in both columns but it doesn't seem to make much difference.
  • Here is an interesting thing to note as well. Brain Jr does not save my encoder settings. I can change other parameters in the V2 config, but boxes that are set to "yes" in the "enc?" column revert to "no" when i close the config and reopen it. Any other changes I make and save to the brain are reloaded. How odd. I am going to reinstall the config software and see what happens

  • Typo in what i typed earlier


     header 2 (+) to GND
     header 2 (-) to DT
     header 4 (-) to CLK
     header 6 (-) to SW

  • TorTor
    edited June 26

    Update I switched to using my second Brain Jr. There must be a problem with the first one I was using when it comes to saving encoder settings, as this one saves just fine. However, the response with this one in tools window are the same as what I reported above. 

  • I'm sorry. We do not explicitly support this encoder.

    The device may not output 'Gray' Code which is necessary for functioning with our devices.

    Consider one of these alternatives:
    - Detented

    - Non-Detented
Sign In or Register to comment.