Arduino with I2C LCD and Rotary Encoder

  Рет қаралды 28,686

John Miller

John Miller

Күн бұрын

This tutorial shows how to use an I2C 16x2 Character LCD and a KY-040 Rotary Encoder for local control and readout with an Arduino Uno. The parts cost less than $10 and can be assembled with no soldering. I believe that this makes it the simplest, cheapest, and easiest way to create a local user interface for an Arduino project.
Feel free to skip ahead to the section that is of most interest to you.
1:04 - Purchasing the Parts
4:12 - Assembly of the Hardware
7:38 - Walkthrough of the Arduino Sketch
11:44 - Demonstration
The Arduino sketch shown in this video can be found at:
github.com/jpsrmiller/rotary-...
For a written version of these instructions, refer to:
buildmusic.net/tutorials/user...
The Arduino sketch uses the following external libraries:
OneButton: github.com/mathertel/OneButton
Liquid Crystal I2C: github.com/fdebrabander/Ardui...
The sketch also utilizes code from Simon Merrett’s instructable “Improved Arduino Rotary Encoder Reading”
www.instructables.com/id/Impr...
Parts for this project were purchased from Ali Express (www.aliexpress.com/) and Adafruit (www.adafruit.com/).
Check out my other Arduino projects that use the I2C LCD and Rotary Encoder as described in this video:
Toastmasters Automatic Timing Light - autotiminglight.com/
Build Your Music - Robotic Xylophone - buildmusic.net/

Пікірлер: 35
@eddiejones8709
@eddiejones8709 3 жыл бұрын
Thanks for the video. Being a beginner at this your video really helps me better understand the sketch terms and building.
@chbonnici
@chbonnici 2 жыл бұрын
Very good ,clear, and sensible explanation. Well done and thank you. This is learning at its best.
@thomasbecker-szurszewski1371
@thomasbecker-szurszewski1371 3 жыл бұрын
Nice demo John glad you helped me out
@joshgapp1677
@joshgapp1677 4 жыл бұрын
Love it John. Nice mix of humor along with very thorough and easy to follow instruction.
@robdavidowitz6428
@robdavidowitz6428 Жыл бұрын
Crystal clear tutorial Your explanations are SO clear and usefull. Thanks👌
@Wrighmachining
@Wrighmachining 5 ай бұрын
Hey John pretty well laid out thank you. The code was pretty comprehensive as well for myself trying to learn and modify code to fit what I need. Keep up the good work !
@realcomsolucoes7403
@realcomsolucoes7403 Жыл бұрын
Thanks for your time giving us a good tip.
@christosstylianou9023
@christosstylianou9023 Жыл бұрын
Thank you John, your video was very helpful
@julioalbertodanoviz3854
@julioalbertodanoviz3854 Жыл бұрын
Excellent teaching method. Thanks.
@umitozdemir1386
@umitozdemir1386 Жыл бұрын
It was very helpful. clear explenation. Thanks a lot.
@najeeullah97
@najeeullah97 Жыл бұрын
YOU DESERVE MILLIONS OF SUBSRICBERS
@christiankarlfrey766
@christiankarlfrey766 2 жыл бұрын
Thanks for the video, very useful!
@Drxxx
@Drxxx 2 жыл бұрын
good tutorial!
@luisfernandoalvarez5500
@luisfernandoalvarez5500 Жыл бұрын
Mil gracias. Un abrazo desde Colombia
@hosseinashkboos5188
@hosseinashkboos5188 2 жыл бұрын
Great Job. Thank you.
@shivanikc804
@shivanikc804 Жыл бұрын
hanks lot Sir.. You helping us..
@mauricioruiz6600
@mauricioruiz6600 Жыл бұрын
Saludos desde Ecuador 🇪🇨, éxito
@luisfernandoalvarez5500
@luisfernandoalvarez5500 Жыл бұрын
Thanks a lot
@dmitry_poliakov_ph
@dmitry_poliakov_ph 3 жыл бұрын
спасибо. доступно, позновательно
@garysplace1431
@garysplace1431 2 жыл бұрын
Hi, I had an issue with the encoder not incrementing and was wondering if you had any ideas for me on that issue. The push button works fine but when I turn the knob nothing happens.
@pradeeplaptop
@pradeeplaptop Жыл бұрын
Excellent explanation thanks I want make LCD menu for operate stepper motor with given speed and steps. thanks for your help.
@alexptvz1076
@alexptvz1076 Жыл бұрын
man its very clean code and and very structured video. I repeat the same steps, but sometimes when I turn encoder value on LCD not been changed, it's like freezing for little time or some like this. Maybe you have an idea why it happens?
@dilipsuthar1836
@dilipsuthar1836 2 жыл бұрын
Hi John I m new to Aurdino, saw ur vdo its very informative. want to have some more information on ur above vdo. Can we do preset counter using the above material. That is we set some count on LCD and when we rotate the encoder in reverse direction and as soon the counts reaches to "0" (zero) we can generate a flag which will operate a relay. Can u help me in this above project with its sketch and bill of material.
@echosoundlight
@echosoundlight 2 жыл бұрын
Thank for your video, can Rotary Encoder be connect to M5stack core 2 or Mstick C
@Minizom
@Minizom 2 жыл бұрын
Has anyone attempted with an Arduino mega, even adapting the code doesn't seem to work
@sumeshak3477
@sumeshak3477 3 жыл бұрын
Hi can you please explain how to modify this program for OLED display?
@brraam007
@brraam007 3 жыл бұрын
for me the lcd.begin(); does not work, but if i use lcd.init(); it does do you know why? very nice video btw.
@sarojpradhan4267
@sarojpradhan4267 3 жыл бұрын
HI John I built this project and worked fine. Now i want to realise menu system with the help from your code, where rotaryleft and rotaryright function will navigate up and down through menu items and encoder click event will select the menuitem. i tried one menu system using simple menu library.my problem is every function called in rotaryclick subroutine works perfectly but if i call same functions in rotaryleft and rotaryright subroutine it doesnot work. any idea?
@alaskanbullworm1632
@alaskanbullworm1632 3 жыл бұрын
Have you solved this?
@lexasolopow
@lexasolopow 2 жыл бұрын
Music box was enough complicated as your examples.
@robdavidowitz6428
@robdavidowitz6428 Жыл бұрын
John, I have copied and pasted this sketch Changed I2C adress to 0*27 and set the display 2 2*16 On compiling, I get the following error: C:\Users\ABCD\AppData\Local\Temp\.arduinoIDE-unsaved2023030-18628-fhzkzm.s5a15\sketch_jan30d\sketch_jan30d.ino: In function 'void initializeLcd()': C:\Users\ABCD\AppData\Local\Temp\.arduinoIDE-unsaved2023030-18628-fhzkzm.s5a15\sketch_jan30d\sketch_jan30d.ino:197:12: error: no matching function for call to 'LiquidCrystal_I2C::begin()' lcd.begin(); ^ In file included from C:\Users\ABCD\AppData\Local\Temp\.arduinoIDE-unsaved2023030-18628-fhzkzm.s5a15\sketch_jan30d\sketch_jan30d.ino:42:0: c:\Data\Dropbox\Arduino\Projects\Sous_Vide_001\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t) void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS ); ^~~~~ c:\Data\Dropbox\Arduino\Projects\Sous_Vide_001\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:58:8: note: candidate expects 3 arguments, 0 provided exit status 1 Compilation error: no matching function for call to 'LiquidCrystal_I2C::begin()' The compile stops at the lcd.begin() below void initializeLcd() { lcd.begin(); lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); lcd.print(F("Test LCD & Rotry")); } Can you please assist. Rob
@JoseRamos-su3ep
@JoseRamos-su3ep 2 жыл бұрын
Any chance your available for help?
@ChandranshuDwivedi
@ChandranshuDwivedi 2 жыл бұрын
aliexpress is banned in India.
How to use rotary encoders
14:12
FriendlyWire
Рет қаралды 28 М.
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 33 МЛН
бесит старшая сестра!? #роблокс #анимация #мем
00:58
КРУТОЙ ПАПА на
Рет қаралды 3,2 МЛН
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 78 МЛН
Phantom 4000 introduction
2:49
Apogee Components
Рет қаралды 114
How to use a Rotary Encoder with an Arduino - CODE EXPLAINED!
21:11
Arduino menu navigation with rotary encoder and LCD
31:19
Curious Scientist
Рет қаралды 38 М.
EP7 - How to Program Arduino - New Menu with Class and I2C LCD
1:41:21
#226 ROTARY ENCODER with no switch bounce 🤓 - you MUST use this
25:49
How to use  LCD LCD1602  with I2C module for Arduino - Robojax
13:12
Menu with voice & rotary encoder - Arduino
15:01
Electronoobs
Рет қаралды 100 М.
How to use Rotary Encoder with Arduino
14:44
Mario's Ideas
Рет қаралды 39 М.
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 33 МЛН