Announcement

Collapse
No announcement yet.

Multiple Button w/ Resistors

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

  • Multiple Button w/ Resistors

    So I have a bunch (about 16) factory buttons I'm wiring to the FB to map to keystrokes. I've got it sussed out except for the fact that I have so many buttons and not enough analog inputs.

    I'm using the +5V off the analogue input. The buttons are simple "push to make circuit, release to break".

    What I'm wondering, can I put a resistor on each button to change the voltage so I can have multiple buttons coming to the same input? As it stands right now every button produces the same current and needs it's own input.

    Was short on time but I made this ms paint drawing. I'm thinking of putting a different value resistor on each of the red lines running to the buttons.

    Thoughts?


  • #2
    You could, though you'd probably be better multiplexing then instead. (Consider the resistor selection to minimise aliasing if multiple keys pressed, and the decoding or error handling.)


    I remember using a MM74C923 20-key encoder (else MM74C922 for 16 keys) rather than bogging down the CPU.
    Mind you, I was only running a dual 6502 (Apple CPU) - aka 6511 (4MHz?), though I'd probably do the same for an 68HC11 or 68HC12 (primitive digital CPUs; less than 17 bit data).

    Comment


    • #3
      Originally posted by OldSpark View Post
      You could, though you'd probably be better multiplexing then instead. (Consider the resistor selection to minimise aliasing if multiple keys pressed, and the decoding or error handling.)


      I remember using a MM74C923 20-key encoder (else MM74C922 for 16 keys) rather than bogging down the CPU.
      Mind you, I was only running a dual 6502 (Apple CPU) - aka 6511 (4MHz?), though I'd probably do the same for an 68HC11 or 68HC12 (primitive digital CPUs; less than 17 bit data).
      Sorry but I don't have a clue what you just said. As you can tell from my drawing, I'm not exactly an electrical genius.

      Comment


      • #4
        MM74C922N-Fairchild-datasheet-7284700.pdf.


        You'll figure the rest out...

        Comment


        • #5
          Basically you’re looking at the same setup used for steering wheels controls in a lot of car.
          Regulate the voltage to the divider well and you can run quite a few switches. However there are limitations for the number of switches that can be reliably used.

          Each button puts a different value of resistor to ground and changes the voltage going to an ADC input. You need to know how to code a micro if you want to implement this.

          On most Microprocessors simple on/off switch inputs are connected into digital IO inputs not the ADC inputs.
          Palm sized ainol MiniPC, 8" Transreflective PRO, Win10, Reverse camera, Dual 10HZ GPS RX's for Speed Display & Sat Nav, FM-DAB & Phone Modules, iDrive interface. T-Screen HVAC control, custom microcontrollers, microcode and FE.

          Comment


          • #6
            Originally posted by Mickz View Post
            Basically you’re looking at the same setup used for steering wheels controls in a lot of car.
            Regulate the voltage to the divider well and you can run quite a few switches. However there are limitations for the number of switches that can be reliably used.

            Each button puts a different value of resistor to ground and changes the voltage going to an ADC input. You need to know how to code a micro if you want to implement this.

            On most Microprocessors simple on/off switch inputs are connected into digital IO inputs not the ADC inputs.
            Could you comment on what these limitations are? You completely lost me with the "ADC" and coding a micro. I'm using a FusionBrain in case no one caught that. Feel like we might be over complicating what I thought should be relatively simple.

            Comment


            • #7
              I replied to your other thread as well, look at a product called RCJOYCON, exactly what Mickz was stating. We both have the same setup. Its exactly what you are describing. I ordered mine today. If you want to know how the install goes, PM me I will be doing bench tests as soon as I get it. Approx 2 weeks.

              What kind of car do you have?
              Attached Files
              2008 350z GT Installed since April 22nd 2011 - Worklog
              2000 Protege Installed Since April 2, 2005 - Intel D201GLY|Fusion Brain|ODBPros ODBII|Engenius|GPS Rikaline|Powermate|Motorized Lilli
              Sound Stage
              Eclipse|MTX|Infinity

              Comment


              • #8
                Originally posted by -zip- View Post
                I replied to your other thread as well, look at a product called RCJOYCON, exactly what Mickz was stating. We both have the same setup. Its exactly what you are describing. I ordered mine today. If you want to know how the install goes, PM me I will be doing bench tests as soon as I get it. Approx 2 weeks.

                What kind of car do you have?
                Perfect thanks mate.. I just saw your other reply also.. Looks like we are doing the exact same thing. I have a 2006 350z. When I installed my screen I used the factory NAV bezel, so I have the factory buttons. They've always just been dead buttons which bugged me so I'm getting around to making them function.

                ---------- Post added at 12:07 PM ---------- Previous post was at 12:01 PM ----------

                I might be doing it wrong, but wouldn't SW2, SW3, SW4 all give you the same voltage with your resistor values?

                Comment


                • #9
                  I got this diagram from the creator of RCJOYCON, he will be sending me the same but with resistor values for 12 buttons. He is also considering making a 12 button version down the road.
                  2008 350z GT Installed since April 22nd 2011 - Worklog
                  2000 Protege Installed Since April 2, 2005 - Intel D201GLY|Fusion Brain|ODBPros ODBII|Engenius|GPS Rikaline|Powermate|Motorized Lilli
                  Sound Stage
                  Eclipse|MTX|Infinity

                  Comment


                  • #10
                    Originally posted by -zip- View Post
                    I got this diagram from the creator of RCJOYCON, he will be sending me the same but with resistor values for 12 buttons. He is also considering making a 12 button version down the road.
                    Are you wiring the same board as me?

                    I discovered my buttons weren't as simple as "open/shut". When the button isn't pressed voltage still passes. .

                    ---------- Post added at 07:35 PM ---------- Previous post was at 07:03 PM ----------

                    Here is what I'm doing to test.

                    Analogue #1 +5V to Button
                    Button to Analogue #1 Input

                    I have FB MDX running to show me the voltag visually. I see 4.5698 without the button pressed. When I press it I see 4.9902

                    Now if I introduce a resistor in the +5V line, no matter what size, all I ever see in MDX is 4.9902. Pushing the button makes no change.

                    I'm seriously confused. Thought I had this worked out.

                    ---------- Post added at 09:09 PM ---------- Previous post was at 07:35 PM ----------

                    Also forgot to mention, if I test the button with a probe on either side I get no continuity unless the button is pushed. So how is it my multimeter gets no continuity yet voltage is flowing?

                    Comment


                    • #11
                      You need a pulldown to ground. You are basically floating an input which is an electrical no-no. So take a couple hundred Kohm resistor and tie it between the analogue input and ground.
                      Fusion Brain Version 6 Released!
                      1.9in x 2.9in -- 47mm x 73mm
                      30 Digital Outputs -- Directly drive a relay
                      15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                      Buy now in the MP3Car.com Store

                      Comment


                      • #12
                        Originally posted by 2k1Toaster View Post
                        You need a pulldown to ground. You are basically floating an input which is an electrical no-no. So take a couple hundred Kohm resistor and tie it between the analogue input and ground.
                        Thanks for chiming in. You mean literally from the ground pin to the input pin?

                        I'm googling what you said so I can understand it, but just wanted to confirm that's what you meant.

                        Comment


                        • #13
                          Originally posted by SKiTLz View Post
                          Thanks for chiming in. You mean literally from the ground pin to the input pin?

                          I'm googling what you said so I can understand it, but just wanted to confirm that's what you meant.
                          Indeed I do.

                          Basically the FB's input is an empty bucket when you power it on. Then you press your button and it fills the bucket up to the level specified by your resistor divider combo. The FB reads the level of this bucket by skimming a bit off the top. (A very very very small amount, like a couple drops). When you disconnect your button that bucket is still full. What you need to do is poke a hole in the bucket. So when the button dumps in its goo, it can drain away when disconnected. Now if you make this hole too small, it won't drain. If you make this hole too big, the button has to put more current (more pressure) to maintain the same level.

                          So pulldowns are a common occurance.

                          Alternatively, you can connect the input to power and ground the button through a resistor.
                          Fusion Brain Version 6 Released!
                          1.9in x 2.9in -- 47mm x 73mm
                          30 Digital Outputs -- Directly drive a relay
                          15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                          Buy now in the MP3Car.com Store

                          Comment


                          • #14
                            Well, I think I killed my brain. I can't get MDX to read any voltage now. Make you a deal. I'll buy another one if you can give me a diagram so I don't kill the next one..

                            Comment


                            • #15
                              Originally posted by SKiTLz View Post
                              Well, I think I killed my brain. I can't get MDX to read any voltage now. Make you a deal. I'll buy another one if you can give me a diagram so I don't kill the next one..
                              How EXACTLY did you hook it up and what values of what did you use.

                              Also, there is a thermal fuse on there. If the board looks dead, give it a few minutes to cool down and try again. You may have killed that output, but the brain should come back to life.

                              ---------- Post added at 11:34 PM ---------- Previous post was at 11:33 PM ----------

                              And please tell me you were messing around with bare leaded components with a live device...
                              Fusion Brain Version 6 Released!
                              1.9in x 2.9in -- 47mm x 73mm
                              30 Digital Outputs -- Directly drive a relay
                              15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
                              Buy now in the MP3Car.com Store

                              Comment

                              Working...
                              X