Announcement

Collapse
No announcement yet.

Rotary Encoder question...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    EDIT: Half Axis encoders only spin 180o stop-to-stop. Look for 360o encoders (5th down on the list).

    Tom, suggesting a course of action you've got down pat ...

    I never used a rotary encoder, but a quick search showed 3-pin plus 2-pin and 5-pin configurations. I would think the interface is a well defined standard for those. And if the module implemented a standard design, it's ready to accept a 3-pin encoder. So, I suggest you buy one on the cheap (see below). If it works but usage is imperfect, at least you'll know buying a better encoder or one with different parameters should work as well. If you look to Digikey's encoders, and peruse the filter categories you can see several encoder variables - like pulses per revolution. I would think that's an important parameter for a useful volume control

    In the mean time, if you feel compelled to experiment, you can do Neil's resistor test and/or try the trace the three encoder contacts to their corresponding connections on the module.

    BTW: The rotary encoders with the 3-pin plus 2 pin interface have two pins opposite the main pins (pic below) for an on/off function. One big dial for volume and on/off - "right up your design alley." so to speak. But the switch function seems to be a momentary push on. I presume it's looking for an always-on electronic interface to sense that momentary connection and power up the device. But I don't see a power button on your main module. It might have been possible to parallel the encoder push button contacts with the module's power-on push button.



    Last edited by Millstonemike; 12-26-2019, 11:15 PM.

    Comment


    • #32
      Originally posted by Billet View Post
      I think the square pad usually indicates pin 1. If I remember correctly, the center pin of a three line mechanical encoder is the common.
      Billet nailed it. See below.Beware these "Half Axis" encoders don't spin ad infinitum. That half axis means 180o stop-to-stop.

      Tom Zarbo ; "Black lead on the square pad and the red lead on the other lead furthest from the square pad showed basically no voltage."

      That's becuase you measured the voltage between the A and the B signal - both inputs to the module. The encoder is all physical contacts. When turned, the contacts open and close to generate a specific sequence of contacts for both the A & B signal to C. Both are inputs to the module's circuitry.The middle pin "C" is +3.3 V. The succession of on/off states - individual contact between A & C and A &C - pull the A and the B signal positive using the voltage from C. The logic reads that sequence and translates it into CW or CCW rotation. Both the A and B inputs on the module should be pulled low with a light resistor. Going high only when pulled up to 3.3 V from C.

      So I'm at a loss for the fluctuating voltage between A and C. It should be a steady 3.3 all the time. And the effect of pressing Pause is, uh, entertaining

      Perhaps it's a function of not receiving any input, the module's logic pulsing a wake up / restart signal for some type of active electronic encoder.

      Click image for larger version  Name:	Encoder Spec..png Views:	0 Size:	376.2 KB ID:	1427698


      Comment


      • #33
        Here's an interesting selection

        Comment


        • #34
          Thanks for all the input guys.

          Neil, Nate is right, the three tabs are for the IR receiver, it's more visible on the flipside of the board.

          Here are a few pics of that...

          Click image for larger version

Name:	Ground Not Soldered.jpg
Views:	182
Size:	423.6 KB
ID:	1427708
          Click image for larger version

Name:	Ground Soldered.jpg
Views:	195
Size:	282.9 KB
ID:	1427707

          Well, after taking the board off of the case I saw something funny...

          When I looked at the back side of the board, it appears that the soldering I did only affected the one side of the circuit board, the hidden side doesn't seem to be making contact with the solder on the inside pad. Not sure if I should have done this or not, but I flowed a little solder on to the inside portion as well since I had it open.

          The square tab, the ground one was troublesome to solder, it just didn't want to seem to take any solder and I couldn't get the solder to 'flow' like it normally does. I hit it with flux which helped, but it was still a bugger. The other two were a lot less fussy getting solder to flow.

          After doing that, I had no voltage between the ground, and either of the other two pins. ??? I double checked it with the multimeter and confirmed...

          Then I started connecting the other two pins to the ground quickly to simulate turning an encoder, and after that, the voltage (3.3) is fluctuating as before. It's possible I fixed, then goofed up the board?

          Anyway, the second preamp had been untouched until this morning, I soldered three lines to that and it is acting exactly the same way as the first one with the fluctuating voltage between the ground and second pin. I didn't take that one apart to 'fix' the inside solder joint yet. I wanted to make sure both of them were acting the same though before wasting everyone's time in case I was fiddling with a 'faulty' unit.

          I appreciate the input, I'll order up a few encoders later today (today's our 15th anniversary and I'm taking the wife out on a date in a few minutes!) based on your recommendations and see what we can figure out with it.

          Mike, the push button momentary on some encoders would be great for a 'turn-on' function right? But, like you said, this board doesn't have an 'on-off' button on it to hack into. Mode change maybe? BTW I can't see any of the pics in post #31 for some reason on my phone, iPad or computer.

          Also, looking at the circuit board, I really can't see where anything is going. The screen covers up pretty much most of the board and it's bonded to the board and won't really come off that I can see.

          Thanks again for all the great ideas. Man, it really takes a village to 'raise' me doesn't it?

          TomZ
          *Veneering curves, seams, using heat-lock iron on method *Trimming veneer & tips *Curved Sides glue-up video
          *Part 2 *Gluing multiple curved laminations of HDF *Cello's Speaker Project Page

          *Building the "Micro-B 2.1 Plate Amplifier -- Part 1 * Part 2 * Part 3 * Part 4 * * Part 5 'Review' * -- Assembly Instructions PDF

          Comment


          • #35
            Originally posted by Millstonemike View Post

            BTW: The rotary encoders with the 3-pin plus 2 pin interface have two pins opposite the main pins (pic below) for an on/off function. One big dial for volume and on/off - "right up your design alley." so to speak. But the switch function seems to be a momentary push on. I presume it's looking for an always-on electronic interface to sense that momentary connection and power up the device. But I don't see a power button on your main module. It might have been possible to parallel​
            There are some volume control ICs that can use the momentary push button function to toggle between different modes. i.e. volume/balance, mute/un-mute If I remember correctly MAXIM makes a few like this.

            Comment


            • #36
              Originally posted by tomzarbo View Post
              ... BTW I can't see any of the pics in post #31 for some reason on my phone, iPad or computer.

              TomZ
              Reposting pics from post 31.



              Comment


              • #37
                Something that would help is knowing the part number on that 48-pin chip. The chip is made by Zhuhai Jieli technology company, with that stylize J-L logo (http://www.zh-jieli.com/), but I can't read the part number from the low-rez photos. They make a number of different MP3/Bluetooth/FM decoder chips. The only chip that I could information for is the AC6901, which is also a 48-pin chip. If you look at the pin definition, you can see that the chip has a lot of dedicated ports for the LCD display, analog I/O, USB, SD card, etc.

                Click image for larger version  Name:	AC6901.png Views:	0 Size:	555.4 KB ID:	1427757


                The "keyboard" functions appear to be handled by a single pin, where the keys create a voltage divider. In fact, one of the questions for this device at one site listed the resistors used for the voltage divider: "Add keys circuit key and GND through resistor: next-24k, pre-36k, play-22R, mode-51k, eq-16k, rep-4k7, rec-200k, mic-2k2". These instructions were for using the "key" pin for creating an external keypad. I suspect the "master volume encoder interface" would be similar--it would use a resistor network to create a voltage that the micro would read and interpret as Vol+ or Vol-.

                As I noted in a previous post, the voltages Tom provided don't make sense for this interface being for a rotary encoder. And this chip doesn't appear to provide the ports needed to process a mechanical rotary encoder. Maybe the chip used on Tom's board is different, but I think it is unlikely that there are dedicated pins for a rotary encoder on a relatively small 48-pin chip. Also. it looks like the traces from that empty connector go straight to the other pushbuttons, so it looks like that interface is used to create a specific voltage for Vol+ and Vol-.

                So, I think there is close to zero chance that this interface is for a rotary encoder. However, it would be possible to add a rotary encoder by using an Arduino CPU that would read the rotary encoder and then provide the right voltages to either the "Key" pin or else to that "master volume encoder interface", assuming you could figure out what voltages are required.
                So someone needs to volunteer to write some Arduino code if there is interest in making this device respond to a rotary encoder. The Arduino IDE has library functions to process the pulses from a rotary encoder. I've written my own code to read rotary encoders for several different CPU's, but I'm guessing that with the Arduino library this would be fairly easy. And then the rotary encoder movement would need to be converted to a voltage, so there would be some additional circuitry involved. Any takers? Is this worth doing?


                Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe

                Comment


                • #38
                  Finally got a decent close-up pic of the chip... it's a JL Chip... text for easy copy/pasting... AC19AP1R339-1A8

                  Here is the pic:

                  Click image for larger version

Name:	Chip Closeup.jpg
Views:	160
Size:	132.5 KB
ID:	1427783

                  I'm planning to order a few encoders of various types later today after I wake up a bit. Even if they can't be used on this project, for future stuff.

                  Found a few different 'diagrams' of the back from a few different sellers:

                  Click image for larger version

Name:	Diagram of back.JPG
Views:	176
Size:	142.1 KB
ID:	1427781 Click image for larger version

Name:	Diagram of back2.JPG
Views:	159
Size:	92.6 KB
ID:	1427782


                  Not sure if I trust any of this though; I hate to waste peoples time if this thing isn't what's advertised.

                  Again, thanks for the great info everyone, I'll keep pluggin' with it as long as it seems worth it for folks to invest time and thought.

                  Neil, I paid around $10 ea. for these. How much would the Audrino setup add to the cost of this do you estimate?

                  TomZ
                  *Veneering curves, seams, using heat-lock iron on method *Trimming veneer & tips *Curved Sides glue-up video
                  *Part 2 *Gluing multiple curved laminations of HDF *Cello's Speaker Project Page

                  *Building the "Micro-B 2.1 Plate Amplifier -- Part 1 * Part 2 * Part 3 * Part 4 * * Part 5 'Review' * -- Assembly Instructions PDF

                  Comment


                  • #39
                    Looks like that is a custom part number. You can buy the AC4602 chip for $0.90 at Aliexpress, but they tell you the "chip does not support retail, because the chip requires software". So once it gets programmed, the vendor puts on a different part number. The JL website lists a number of products, but there are some good reasons for thinking that the chip on your board is a programmed AC4602 (same functionality, same number of pins, etc.)

                    The Arduino boards are cheap--you can get a basic "328" board at AliExpress for under $2, and Microcenter has the Adafruit "Trinket" board for $7.

                    However, the idea might not work, depending on how the volume encoder interface is implemented. I assume the master volume is encoded as a voltage like the other buttons. But the software might force you to hold and release the button very slowly, and the rotary encoder connected to the Arduino would only be able to spin at the speed of the button pressing logic. So it might be an unsatisfactory solution. The schematic for the buttons on the AC4602 is shown below. I assume the master volume is encoded in a similar way.

                    Click image for larger version

Name:	Image2.png
Views:	188
Size:	27.5 KB
ID:	1427789

                    I think it's worth investing time on these boards, because these System-on-a-chip (SOC) devices have become very powerful and very high quality in the last few years. This is how consumer electronics is trending, and coming up with clever ways to take advantage of these devices is a new and interesting frontier for the DIY'er.
                    Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe

                    Comment


                    • #40
                      Originally posted by neildavis View Post
                      ...

                      However, the idea might not work, depending on how the volume encoder interface is implemented. I assume the master volume is encoded as a voltage like the other buttons. But the software might force you to hold and release the button very slowly, and the rotary encoder connected to the Arduino would only be able to spin at the speed of the button pressing logic. So it might be an unsatisfactory solution. The schematic for the buttons on the AC4602 is shown below. I assume the master volume is encoded in a similar way.

                      Click image for larger version  Name:	Image2.png Views:	32 Size:	27.5 KB ID:	1427789

                      I think it's worth investing time on these boards, because these System-on-a-chip (SOC) devices have become very powerful and very high quality in the last few years. This is how consumer electronics is trending, and coming up with clever ways to take advantage of these devices is a new and interesting frontier for the DIY'er.
                      That's a strange implementation. Using 10 buttons and a voltage divider network to control one function. After all, one major purpose of these electronic chips is to reduce costs. And that translates to reducing the number and/or complexity of mechanical devices. 2 SMD switches are cheaper tha a stereo pot for both component cost and assembly cost. And less part proliferation as the same switch is used for other functions on the module).

                      I have a BT speaker that uses two separate buttons to control volume; an up & a down button. It doesn't seem to respond to a single push (or it's imperceptible), only to holding the button down. That tells me the chip is reading the contact and adjusting the volume based on time of closure.

                      After reading up on the rotary encoders I concluded that: (1) The class of encoders in this application are purely mechanical rotary switches with two separate sets of contacts. The phase relationship between the opening and closing of the two separate rotaries produces two signals in tandem read by the intelligent device; (2) There are several encoding techniques but quadrature seems to the standard for user electronic type encoders; and (3) A main parameter is the number of pulses per revolution. It is important to match that parameter with the device reading the rotary input. You don't want 1/10th of a revolution to change between minimum and maximum volume. Nor do you want 10 revolutions to accomplish the same span of volume.

                      "I think it's worth investing time on these boards, because these System-on-a-chip (SOC) devices have become very powerful and very high quality in the last few years. This is how consumer electronics is trending, and coming up with clever ways to take advantage of these devices is a new and interesting frontier for the DIY'er."

                      +1

                      Comment


                      • #41
                        The voltage divider approach for keypads is common. The "standard" 2-line LCD Arduino shield uses a single line to encode the 6 pushbuttons--the schematic is at this link. It's very easy to decode this type of keyboard, as you just need to poll the analog input pin for any voltage, read the voltage and then compare it to values in a table.

                        Mechnical rotary encoders are more difficult to deal with, as the keybounce can result in invalid sequences (non-Gray-codes). For that reason, mechanical rotary encoder contacts are usually connected to pins with interrupt capability, and the pulses are debounced and counted in an interrupt service routine. So there is more complexity, although the Arduino library code takes care of that. Also, you can't share CPU pins: each rotary encoder requires two dedicated pins. I don't see any extra pins available on that JL chip for a rotary encoder, so I'm assuming that the volume control encoding, if any, is done as a voltage like the other pushbuttons.

                        I ordered one of these boards yesterday, and it will probably take two or three weeks to arrive. I'll look at those pins with a scope and trace some connections to get a better idea of how this board works and how it can be integrated into active speakers.
                        Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe

                        Comment


                        • #42
                          Indulge me in a "thought experiment" if you will...

                          Why don't the ever-wise "They" invent a non-rotary encoder type of rotation button-pressing device?

                          Here's my thoughts on how it could be made to work:

                          Consider this screwdriver: https://www.parts-express.com/10-in-...tchet--360-136
                          pic here:

                          Click image for larger version

Name:	Screwdriver friction ratchet.JPG
Views:	159
Size:	16.1 KB
ID:	1427937

                          I have one and it's pretty cool, loads the bits rapid-fire without ever needing to touch the bit, which is a cool trick...

                          But the coolest part by far is the ratcheting mechanism. There is no click-click-click like normal ratcheting devices, and when you turn the handle, the mechanism grips instantly, either way, no play whatsoever.

                          Bear with me here.....

                          Imagine a device, like a Potentiometer or Rotary Encoder, but with two of these instantly-engaging 'ratchet' mechanism like this screwdriver has, one going in each direction...

                          So... when you turn clockwise, only the one set up to 'grip' on clockwise motion is turning, and
                          makes contact/breaks/makes contact
                          repeatedly with contacts inside similar to a rotary encoder, possibly a bit more robust to eliminate 'bounce' or whatever... while the other 'ratchet' mechanism would be spinning free unengaged.

                          Then when you turn counter-clockwise, (volume down) the other ratchet mechanism engages and makes contact/breaks/makes contact... just like the other side, but making contact with only the "down volume" lead. That would solve the problem of directivity compared to a 'rotary encoder.'

                          I know it's a pipe dream and those who actually know how these things work would be able to shoot holes in my idea, but I can't believe it couldn't be made to work well enough given the engineering minds that exist out there in the world. If a rotary encoder can be had for under $2 (but still needs additional circuitry and software) and a good quality potentiometer $5-$50, a device like this couldn't be made to turn a profit?

                          Moot point I know, but the way things are going with touchscreens... knobs, and even buttons are quickly going by the wayside.

                          "Long Live Knobs!"

                          Anyway, sorry for the rant... now back to our regularly-scheduled thread!

                          TomZ
                          *Veneering curves, seams, using heat-lock iron on method *Trimming veneer & tips *Curved Sides glue-up video
                          *Part 2 *Gluing multiple curved laminations of HDF *Cello's Speaker Project Page

                          *Building the "Micro-B 2.1 Plate Amplifier -- Part 1 * Part 2 * Part 3 * Part 4 * * Part 5 'Review' * -- Assembly Instructions PDF

                          Comment


                          • #43
                            Originally posted by tomzarbo View Post
                            Indulge me in a "thought experiment" if you will...

                            Why don't the ever-wise "They" invent a non-rotary encoder type of rotation button-pressing device?

                            Here's my thoughts on how it could be made to work:

                            Consider this screwdriver: https://www.parts-express.com/10-in-...tchet--360-136
                            pic here:

                            Click image for larger version  Name:	Screwdriver friction ratchet.JPG Views:	0 Size:	16.1 KB ID:	1427937

                            I have one and it's pretty cool, loads the bits rapid-fire without ever needing to touch the bit, which is a cool trick...

                            But the coolest part by far is the ratcheting mechanism. There is no click-click-click like normal ratcheting devices, and when you turn the handle, the mechanism grips instantly, either way, no play whatsoever.

                            Bear with me here.....

                            Imagine a device, like a Potentiometer or Rotary Encoder, but with two of these instantly-engaging 'ratchet' mechanism like this screwdriver has, one going in each direction...

                            So... when you turn clockwise, only the one set up to 'grip' on clockwise motion is turning, and
                            makes contact/breaks/makes contact
                            repeatedly with contacts inside similar to a rotary encoder, possibly a bit more robust to eliminate 'bounce' or whatever... while the other 'ratchet' mechanism would be spinning free unengaged.

                            Then when you turn counter-clockwise, (volume down) the other ratchet mechanism engages and makes contact/breaks/makes contact... just like the other side, but making contact with only the "down volume" lead. That would solve the problem of directivity compared to a 'rotary encoder.'

                            I know it's a pipe dream and those who actually know how these things work would be able to shoot holes in my idea, but I can't believe it couldn't be made to work well enough given the engineering minds that exist out there in the world. If a rotary encoder can be had for under $2 (but still needs additional circuitry and software) and a good quality potentiometer $5-$50, a device like this couldn't be made to turn a profit?

                            Moot point I know, but the way things are going with touchscreens... knobs, and even buttons are quickly going by the wayside.

                            "Long Live Knobs!"

                            Anyway, sorry for the rant... now back to our regularly-scheduled thread!

                            TomZ
                            I think the case here is a new technology to acclimate. Once you have a grip on that, you'll see the simplicity of the encoder system. And with an intelligent chip already on your device, the decoding s/w is free after the initial coding (and that implementation is public knowledge). Additional circuitry is 2 pull up resistors and 2 debouncing caps. Fractions of a penny for SMDs.

                            Comment


                            • #44
                              I kind of like rotary controls, but I don't like ones with a cheap feel. Most of the cheap mechanical rotary encoders use plastic shafts and collars that don't turn smoothly. And eventually the contacts on the cheaper units get so much "noise" that the encoder doesn't work very well.

                              Some of the better mechanical encoders use metal shafts and collars, but there is usually a lot of "play" in that type of bearing. Put on a large "audiophile knob" and you will notice the play.

                              The better rotary encoders use optical shutters and opto-sensors to generate the pulses. They have zero de-bounce issues, so the software is simple and reliable and the performance doesn't deteriorate with age. You can also get the optical encoders with stainless steel shafts and collars that are like fine bearings--easily good for over 1,000,000 rotations. However, the prices for optical encoders start at $15 and you can't get a stainless steel shaft encoder for less than $35. But if you are using one of those oversized knobs and want a "precision feel", those expensive optical rotary encoders are the way to go.
                              Free Passive Speaker Designer Lite (PSD-Lite) -- http://www.audiodevelopers.com/Softw...Lite/setup.exe

                              Comment


                              • #45
                                Originally posted by neildavis View Post
                                I kind of like rotary controls, but I don't like ones with a cheap feel. Most of the cheap mechanical rotary encoders use plastic shafts and collars that don't turn smoothly. And eventually the contacts on the cheaper units get so much "noise" that the encoder doesn't work very well.

                                Some of the better mechanical encoders use metal shafts and collars, but there is usually a lot of "play" in that type of bearing. Put on a large "audiophile knob" and you will notice the play.

                                The better rotary encoders use optical shutters and opto-sensors to generate the pulses. They have zero de-bounce issues, so the software is simple and reliable and the performance doesn't deteriorate with age. You can also get the optical encoders with stainless steel shafts and collars that are like fine bearings--easily good for over 1,000,000 rotations. However, the prices for optical encoders start at $15 and you can't get a stainless steel shaft encoder for less than $35. But if you are using one of those oversized knobs and want a "precision feel", those expensive optical rotary encoders are the way to go.
                                All good info. Made me think of the 60's/70's Marantz units and their smooth, weighty tuning dials.

                                I think Tom (and me) would be happy if we can zero in on the type of encoder & parameters that will work with his board. Ensuing projects will determine the quality of encoder appropriate for that project.

                                Comment

                                Working...
                                X