Arduino OLED Clock Project (tutorial for beginners, u8g2, Arduino UNO, OLED display, SH1107,SSD1306)

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • Do you like the video? Please consider buying me a coffee, thank you! www.buymeacoff...
    Source Files: github.com/upi...
    PCBWay - www.pcbway.com...
    WOKWI - wokwi.com/proj...
    ------------------------------------------------------------------------------
    In this tutorial, I will show you how to create simple analog clock with Arduino UNO and OLED display with 128x128px resolution, using the u8g2 library and WOKWI online emulator. The display uses SH1107 chip, but we will be using the SSD1306 128x64 OLED display for testing inside the WOKWI.
    ------------------------------------------------------------------------------
    Links from the video:
    128x128 SH1107 OLED Display: s.click.aliexp...
    128x64 SSD1306 OLED Display: s.click.aliexp...
    Arduino UNO: s.click.aliexp...
    Arduino breadboard prototyping shield: s.click.aliexp...
    Photopea (online Photoshop-like tool): www.photopea.com/
    u8g2 documentation: github.com/oli...
    Related videos:
    Arduino Parking Sensor - • DIY Parking Sensor wit...
    Turbo pressure gauge with Arduino and OLED display - • Turbo pressure gauge w...
    Arduino Car Cluster with OLED Display - • Arduino Car Cluster wi...
    Knob over OLED Display - • Knob over OLED Display...
    Arduino + OLED = 3D ? - • Arduino + OLED = 3D ?
    Arduino OLED Gauge - • Arduino OLED Gauge
    Smaller & Faster Arduino - • Smaller & Faster Arduino?
    ------------------------------------------------------------------------------
    PCBWay is a service for manufacturing custom PCBs. If you click the link above, you will get a coupon for $5, which is exactly the price of 10 pieces of custom PCBs. In that case, you will only pay for shipping. Do you have any experience doing this? Please let me know in the comment section!
    ------------------------------------------------------------------------------
    Hashtags:
    #OLED #arduino
    ------------------------------------------------------------------------------
    Do you have any questions? Suggestions for the next video? Please put those down in the comment section. I try to answer as many questions as I can. Thank you for watching and reading the video description, and I hope to see you next time. Good luck with your projects!
    ------------------------------------------------------------------------------

Комментарии • 69

  • @upir_upir
    @upir_upir  8 месяцев назад

    Do you like the video? Please consider buying me a coffee, thank you! www.buymeacoffee.com/upir

  • @Chilternflyer
    @Chilternflyer 6 месяцев назад

    I'm a visual learner and only have limited c++ experience. This is a very clear and detailed explaination without drifting off the task. I find this easy to follow and also learning about the libraries at the same time :-) Subbed!

    • @upir_upir
      @upir_upir  6 месяцев назад

      Thank you for your nice words, I’m glad it was helpful! Please feel free to also check my other videos and good luck with your projects.

  • @kickbaktube
    @kickbaktube Год назад +3

    I think I understand how to use Modulus in code now. Thank you.😀

    • @jorgeestefania3184
      @jorgeestefania3184 Год назад +1

      It can also be used to set the seconds back to 0 every time it hits 60. If you set the seconds to seconds % 60, if the seconds are 60 it will be set to 0, so you can save yourself an if statement. 19:00

    • @upir_upir
      @upir_upir  Год назад

      I’m glad it was helpful! As for the other comment, yes, you can do that for seconds, but you would still need the if statement to increment minutes and hours..

  • @LeventeDaradici
    @LeventeDaradici Год назад +9

    I don't know if I've ever seen anything so well explained! Greetings and thanks!

    • @upir_upir
      @upir_upir  Год назад +1

      Thank you for your nice comment, I´m glad it was helpful and good luck with your projects!

  • @gerhardachrainer6116
    @gerhardachrainer6116 Год назад +1

    Since it‘s just black and white, I‘d draw the hands in black using previous time (to erase it), then in white again. That would avoid drawing the background each time.

    • @upir_upir
      @upir_upir  Год назад

      Yes, that should be possible, but sometimes the hands are displayed over tickmarks, so you would have to also keep track of that and “repair” any damaged tickmarks. I mean all of this is possible, but it would probably not affect performance that much.

    • @gerhardachrainer6116
      @gerhardachrainer6116 Год назад +1

      @@upir_upir So now you got me curious: what direction would you think of when optimizing performance in this specific scenario?

    • @upir_upir
      @upir_upir  Год назад

      @@gerhardachrainer6116 The u8g2 library supports partial redraw/update of the screen, so I would start there. Also switch the IIC display for a SPI version, that would speed things up as well. And if nothing works, switch to UNO R4, any other faster Arduino clone or ESP32.

    • @wibbley1
      @wibbley1 Месяц назад

      Yep, draw the second hand in black, before redrawing it in white in the new position.
      Then redraw in white the minute & hour hand to repair any damage.
      (if using different colour for second hand, redraw it again, as it should be above other hands)
      Only need to draw minute & hour hand in black, then new position in white, once per minute.
      Make the hands shorter than the clock markings, so they do not need to be re-drawn.
      You will find the clock hands look much smoother.

  • @martinvasilev9809
    @martinvasilev9809 Год назад +1

    great job :)

    • @upir_upir
      @upir_upir  Год назад +1

      Thank you, I’m glad you like it!

  • @iamkian
    @iamkian Год назад +1

    Hello. Thank you for sharing.
    Can you please do a howto for a "Waveshare 2.9 inch E-Ink E-Paper Display - 3 Colors" using a Nano or Uno?
    Thank you.

    • @upir_upir
      @upir_upir  Год назад +1

      You are welcome. I can take a look. Is there any particular project that you would like to use this display for?

  • @noggin73
    @noggin73 Год назад +1

    Nice

  • @petermoore9504
    @petermoore9504 Год назад +1

    I made a digital clock using a similar 1.5 inch display (maybe the same one) and the burn-in was terrible. After only a few months it became unusable, maybe take the brightness down? Cheers.

    • @upir_upir
      @upir_upir  Год назад

      That’s interesting. I will keep it running and see how it looks in a few months. I have other oled displays on for weeks and I don’t see any burnout pixels yet.

  • @BinuMadhav.NetWork
    @BinuMadhav.NetWork Год назад +1

    Nice, why don't you use images for dial and needles?

    • @upir_upir
      @upir_upir  Год назад

      You can. There are multiple ways how to achieve the same result..

  • @yupingliao4078
    @yupingliao4078 4 месяца назад +1

    Without the RTC (1307/3231) module installed, will the Arduino ino’s time in seconds be accurate? Will the time remain the same when you turn off the power and turn it back on again?

    • @upir_upir
      @upir_upir  4 месяца назад

      It will most likely not be accurate. If you don´t want to use an external RTC, you can use microcotroller that has already RTC build-in, for example Arduino UNO R4.

  • @AutoRevLife
    @AutoRevLife 7 дней назад +1

    If the power is cut off to the Arduino, will the time reset, will it start up from the last time in the memory, or will it auto adjust to the correct time? I'm guessing it's one of the first two?

    • @upir_upir
      @upir_upir  5 дней назад +1

      It will start most likely back from zero. That´s the reason for having this coin battery that keeps the realtime clock module alive.

  • @upir_upir
    @upir_upir  Год назад +5

    soo... have you used this 128x128 display for any project?

    • @Shamanestr
      @Shamanestr Год назад

      i don`t. 128X64 is way cheaper. For that money you can buy 1 pcs "128x64" + "1.8" LCD Display TFT Screen Module SPI Interface 128*160"

  • @jumbo999614
    @jumbo999614 7 месяцев назад +1

    Can I use the code with SSD1327?

    • @upir_upir
      @upir_upir  7 месяцев назад +1

      Yes, the u8g2 library should support this display.

  • @roostertechchan
    @roostertechchan Год назад +3

    17:24 wouldn't it be easier if you just draw a rectangle instead of two triangles? You know the 4 points already.

    • @upir_upir
      @upir_upir  Год назад +3

      It would, but there is no function to draw rotated rectangle in the library.

    • @roostertechchan
      @roostertechchan Год назад +1

      @@upir_upir ah, I didn't know that

  • @driss25
    @driss25 7 часов назад

    سربي سربي لكار يدا عليا

  • @masterdeki
    @masterdeki Год назад +2

    Do some video for drawing on 3.5 inch displays, lets say some car gauges :-)

    • @upir_upir
      @upir_upir  Год назад

      Which exact display do you have in mind?

  • @pekevi2
    @pekevi2 2 месяца назад +1

    Ndee radore

  • @paazz7865
    @paazz7865 6 месяцев назад +1

    Good work thax. How i can contact you. I have few dbt pls

    • @upir_upir
      @upir_upir  6 месяцев назад

      Sure, the email is on the about page of this channel, but sometime it only shows on desktop, and not on mobile version.

  • @phakalanep7241
    @phakalanep7241 Год назад +2

    A very good project - But please slow down your explanation you are very fast it's hard to see what you are trying to explain

    • @hiperformance71
      @hiperformance71 Год назад +3

      😂, he is very fast, you can slow down the video too, he need to cover a lot in those tutorials.

    • @upir_upir
      @upir_upir  Год назад +2

      Thank you for your comment. Could you perhaps use the playback speed to slow it down?

  • @rayansattarkhan6807
    @rayansattarkhan6807 Год назад +1

    Wow! I learned lots of new things from this video. Really great. Please keep creating.

    • @upir_upir
      @upir_upir  Год назад

      Happy to hear that! I´m glad it was helpful, and I will surely try to record more...

  • @EasyOne
    @EasyOne Год назад +1

    nice

  • @Wokwi
    @Wokwi Год назад +1

    Great again!
    What if Wokwi had 128x128 SH1107 ?

    • @upir_upir
      @upir_upir  Год назад +1

      Well, that would be really great and it would also mean that for many of my future projects would be my preferred display 🙂 however, it would be enough to have support for any 128x128 display supported by u8g2 library, because at that point, switching the initialization should be simple.

    • @Wokwi
      @Wokwi Год назад +1

      @@upir_upir Thanks for the feedback! It's possible to add new displays (like the SH1107) using the Custom Chips API. Are you interested in trying it?
      There's a complete example of an IL9163 SPI display implementation in the Chips API documentation.

    • @upir_upir
      @upir_upir  Год назад +1

      @@Wokwi That all sounds great, but I´m worried that I don´t have enough knowledge yet for something like that. Has anyone created any custom display for WOKWI already?

    • @Wokwi
      @Wokwi Год назад +1

      @@upir_upir Yes, there are three examples so far: SSD1306, ILI9163, WS29V2 (2.9" epaper) display. RUclips won't allow links here, but you can find the first two in the documentation site under "Chips Api" -> "Getting Started". There's a "Chip Examples" section with "Displays" category.

    • @upir_upir
      @upir_upir  Год назад +1

      Thank you for your reply, I did take a look and the documentation is really great, especially with all the custom chips already made. That said, unfortunately right now, it’s beyond my knowledge. But maybe someone else would be about to add that bigger display, that would be great.

  • @빛날휘-e8u
    @빛날휘-e8u Год назад +1

    try rotary radar display, it will be awesome

    • @upir_upir
      @upir_upir  Год назад

      That´s an interesting idea. Do you have any examples of how that might look like?

    • @빛날휘-e8u
      @빛날휘-e8u Год назад

      @@upir_upir just like green screen sonar radar in submarine movies :) most important thing is scanning & spinning something like second hand... someday i will build rf radar for sailboat

  • @NicleT
    @NicleT Год назад +1

    That was a real class. Bravo!

    • @upir_upir
      @upir_upir  Год назад +1

      That´s great to hear, thank you for your nice comment!

  • @VANMINH84
    @VANMINH84 Год назад +1

    Nice ❤🎉

  • @davidpelegrin9619
    @davidpelegrin9619 Год назад +1

    Awesomeeee ♥♥

    • @upir_upir
      @upir_upir  Год назад +1

      Thank you, I’m glad you like it!

  • @Ju2tR1zz
    @Ju2tR1zz 8 месяцев назад +1

    dost propracovane ! :D