How to use up to 10 push button switch with 1 Arduino input pin ANPB-V1
ฝัง
- เผยแพร่เมื่อ 15 มิ.ย. 2024
- Learn how to use only one input pin of Arduino to connect up to 10 push buttons switches to control output pins to turn ON or OFF relay, LED or any other system. This fully explained. you may get the code from the link below or jump to different chapters of this video.
Here is Version 2 of this video:
Control 10 output pins or relay using 10 push button switch with 1 Arduino input pin ANPB-V2
• Control 10 output pin...
**** Free Course ***
Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe.😊 .
Download Arduino code for this video: robojax.com/L/?id=293
** Purchase item **
Amazon USA
- Arduino UNO(authentic): amzn.to/3glHgYp
-Arduino Mega(authentic): amzn.to/33P5sO1
-Arduino Nano (authentic): amzn.to/3onbH3s
- Arduino UNO(compatible): amzn.to/3ghPnp9
-Arduino Mega(compatible): amzn.to/3lXizTG
-Arduino Nano (compatible): amzn.to/3n3s5FO
Amazon Canada
- Arduino UNO(authentic): amzn.to/3qtwzrw
-Arduino Mega(authentic): amzn.to/36NwOpI
-Arduino Nano (authentic): amzn.to/39NPveJ
- Arduino UNO(compatible): amzn.to/36QA5ok
-Arduino Mega(compatible): amzn.to/36QA5ok
-Arduino Nano (compatible): amzn.to/36NwOpI
Related Videos:
-How to use a breadboard: • How to use breadboard?...
-Read any DC voltage using Arduino: • Built Voltage Sensor w...
Jump to different section of video by clicking on the time:
00:00 Start
01:10 Introduction
08:14 wiring explained
12:09 Code Explained
25:14 Demo: 5 push buttons
27:17 Demo: 3 push buttons
28:31 Demo: 10 push buttons
30:08 Demo: Arduino Mega
30:45 Demo: Arduino Nano
31:08 Demo: Arduino Due
31:34 Demo: Arduino MKR
32:09 Demo: with Potentiometer
Tutorial by Ahmad Shamshiri form Canada
****************************
Arduino Step by Step Course (over 100 lectures) Starts here • Lesson 00 What is Ardu...
Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135
****************************
If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robojaxTV
Follow me on Facebook robojaxTV
Follow me on Twitter: / robojaxtv
Follow me on Instagram: / robojax
Tutorial by Robojax.com
Get other projects code and learn Arduino
robojax.com/learn/arduino
robojax.com/learn/arduino
#robojax #robojaxArduinoVoltage - วิทยาศาสตร์และเทคโนโลยี
You are AMAZING! Thank you for this video!
I want to use this to make some custom steering wheel buttons that control relays for several accessories. However, I can only pass 2 wires through my steering wheel clockspring.
I can feed my 5v signal and output wires through the clockspring, and get ground inside the steering wheel hub as it is grounded already and where the horn button is grounded.
This will come in perfectly and will be my first time using Arduino. I will study up very good now.
Thanks again friend!
Thank you. I've been looking for a video like this. I'm interested in extending a button's functionality by long press, double-tap, and maybe double-tap-hold. I know the combinations are many but at least get 3 buttons out of one would be great. Like some handsfree headphones have a single button to take care of prev track(triple-tap, I think),(single-tap) toggle play, next track(double-tap,I think), stop (single-tap toggle), and call/voice command (long press)
Amazing - yet again another very detailed explanation. I had managed to do this but it was a mess. I have learnt a lot from your code and method of programming.
Thanks.
Great to hear!
Very smart idea.. ladder switching
Nice tutorial learn again a little more from you
Thank you! Cheers!
Brilliant idea thanks ❤️
You’re welcome 😊
Hi, will this work with 12 buttons with an ESP32 ? Thank's and keep up the good work !!!
Nice tutorial...👍👍👍 Please do same project with relays.thank you
this is for relay. Already incorporated. I did not feel the need to connect relay. the code is already included controlling relay.
@@robojax oh ok thank you ☺️
Great idea and great explanation! We live in the same region, do you know of any good courses you would recommend for arduino programming?
Hello, here is my Arduino course on Udemy from absolute beginner to complicated projects bit.ly/rj-udemy
hello sir ahmad... thanks for this informative video it gives me a lot of ideas as a beginner... i would like to ask if you could make a video on 6 pushbutton to control one servo motor.. each button have different programs for the servo to perform.. thank you sir...
Hello, just search my channel and I am sure you will find something. You will be surprised.
Thanks a lot!
You're welcome!
30:00 button#6 's lower value is lower than #5's higher value. You may have an int that snuck into the calculations.
This is a great way to add more buttons. I forgot about this long ago. But I'm glad you reminded me!! You won't be able to press more than 1 button at a time, but if you add resistors and more buttons, you won't need to!
I'm trying to figure if voltage sag (batteries going lower) would affect the buttons. Vref should stay the same, but actual voltage on the ladder might decrease.
Yes you are right. then in that case we will have to set the tolerance to 1% of 5% to increase the gap between voltages. I will try to mention this somewhere or may be update the video. Please comment as I will delete this video and update it with relay as it seems many people did not see how it is used even though I've shown it can turn on digital outputs.
@@robojax oh no don't delete this video. The discussion is a great place for people to always learn more! In fact, I find, doing something non perfect in a video generates even more great discussion than a perfect video. (And better info in the end).
Great video!!
hola Ahmad
En primer lugar darte las gracias por tus videos y la forma tan didáctica de explicarlos para los que no entendemos.
Mi pregunta puede funcionar con 32 pulsadores para dos módulos de 16 relés con resistencia de 1K y final de 400K
gracias por anticipado
un saludo
hello ahmad
First of all, thank you for your videos and the educational way of explaining them for those of us who do not understand.
My question can work with 32 pushbuttons for two modules of 16 relays with resistance of 1K and final of 400K
Thanks in advance
a greeting
Hello, you are welcome. there is V2 of this video which shows relay control. the link is in the description.
I have explained it and shown what the problem is. The more resistor you put the more error you will have. so I believe 10 seems maximum for one arduino. why don't you use keypad? here 4x4 keypad with 5 wires th-cam.com/video/qIDzzG2LUtg/w-d-xo.html or 4x5 keypad th-cam.com/video/sbQ3D1_x_tg/w-d-xo.html search my channel for more. Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo or 8 channel relay th-cam.com/video/dkESWpdDBYk/w-d-xo.html
Sir how to to control multiple outputs at a one time using this idea
I would like to see long distance rs485 remote control relay use key board 4x4 master and sleeve arduino.
it is on my list. When time permits. God willing I'll make it. But it is at the bottom of the list.
Hi, I would like to know how to use a Keypad (4x4) with I2C to set 16 outputs on a PCF8575. I would like to use PCF8574 for the keypad and for a display (2x16) with PCF8574 on the same I2C bus line. Read from Keypad, show on display and action on PCF 8575 to set the corresponding output. That should be a nice project for you to handle a lots of outputs, from one keypad with a minimum of wiring. I use Arduino NANO so it will be as cheap as possible. Thank you in advance!
Hi, Yes indeed it is very interesting project. I just added it to my "to do list".
Thanks for this great info., but my micro controller is esp32...will this works?
See the principal of reading voltage with esp32 from this video th-cam.com/video/COssWn4Pcm4/w-d-xo.html
ty man
You are welcome.
15:50 you should use a define instead of ...oh you beat me to it.
Yes indeed "define" was better option. I am going to remove this video and update it with controlling relay as it helps many people to see the result. it seems this was not enough as how it is used.
Is it possible to register multiple buttons presses at the same time with this method ?
If you want to read the value bar the same time then you need to use multiple inputs of arduino.
hello, is there a way to cancel the channels except one, if multiple buttons are pressed, keeping all resistors output?
Hello, do you want not use other resistors? (1) or when it one key is pressed, you want the others to be deactivated?(2), 1-you can used 2 or more, (2) then how are you going to implement it? as long as a key is pressed, it should not accept other key-press.? if so you need to use conditional statement to check that. It needs some work.
MCP2515 CAN BUS can you do a tutorial on this?
Hello, I have added into my "to do list". Thanks for letting me know. I removed the video to update and posted with relay. Once the V2 of this video was posted, I brought back the V1 (this video).
👏👏👏
👍 👍
Hi Robojax can this be done with vibration sensors instead of push button?
It just needs connection ground . If your sensor can bring the connection to GNS level or zero volts, it should work
@@robojax What is GNS?
Sorry 😂 typo , GND
Hello, if I put 14 push-buttons in one code and 2 push-buttons in the other code to turn on a led, what will it look like? Can you help me, if it works, send the code to Arduino
This video is for learning. Please watch and learn. I have three full course if you want to learn certain or all topics. Just click on Robojax logo under the video and look at the playlists.
Better approach is to use 2 pins one analog and one external interrupt and using a transistor send signal to interrupt pin. With this no polling is needed
this is the easiest. In my opinion. one resistor for each push button.
The code on your site will not compile
Line 66 “voltage_minimum” not defined
Line 77 “ ‘else’ without previous ‘if’ “
Hello, thank you for letting me know. We've migrated our website to new Content Management System and used automated data transfer. this process have missed up some of the pages. I just fixed this manually. this should work now. Please let me know.
Here is Version 2 of this video:
Control 10 output pins or relay using 10 push button switch with 1 Arduino input pin ANPB-V2
th-cam.com/video/AI-zzmSZVfw/w-d-xo.html
I don't see the code on your website - have you not uploaded it yet?
OMG. thank you for letting me know. so much to do for a video and I forgot it. Just activated the link.
@@robojax should be 341 not 292
Works with arduino micro?
Yes it will.
why do you put r5 and not leave it out and make r99 smaller. In that way you save power.
didn't get it? r99?
@@robojax at 3:19 if you remove r5 from the schematic, you do not have the constant power draw by 5kOhm. Then make r99 (at the IC) smaller in value to get the correct voltage drop if you press a button.
Using 2 ports with the same concept can we have 20 buttons?
Yes the same methods can apply to all analog pins to get more push buttons inputs
@@robojax thanks so much!
Can I do 12 push buttons in one pin ?
Please watch as I have answered that question
but it cant be used for latching switches
I am having problem with word latch in this context.
More simple way can can handle this. No need write biggest code
Please share here. Just make sure to use one input pin. 📍
Hi sir how to use it as a switch?
As a on off switch?
Hi, video will be updated demonstrating controlling relays.