Raspberry Pi Pico Tutorial - DS1302 Real-time Clock

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 เม.ย. 2022
  • Welcome to the - Learn how to use the Raspberry Pi Pico Tutorial Series:
    This tutorial we look at the DS1302 module and how to connect it to the Raspberry Pi Pico.
    The DS1302 trickle-charge timekeeping chip contains a real-time clock/calendar. The real-time clock/calendar provides seconds, minutes, hours, days, dates, months, and year information.
    Knowing how this module work will be handy in future projects where time-keeping is important. I am planning to make a custom clock in future so make sure to subscribe not to miss that video.
    Check out my channel for other videos on the Raspberry Pi Pico, as I will regularly upload tutorials and projects related to the Raspberry Pi Pico.
    If you found this tutorial helpful, subscribe to the channel and leave a comment and welcome to the NerdCave.
    Code:
    github.com/Guitarman9119/Rasp...
    If you are new to the Raspberry Pi Pico I have made a Getting started video:
    • Raspberry Pi Pico Tuto...
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 39

  • @armand9910
    @armand9910 2 ปีที่แล้ว

    Good tutorial, thank you! :)

  • @OmidAtaollahi
    @OmidAtaollahi 7 หลายเดือนก่อน

    thank you, great tutorial.

    • @NerdCaveYT
      @NerdCaveYT  7 หลายเดือนก่อน

      Glad it was helpful!

  • @droneview1275
    @droneview1275 ปีที่แล้ว +1

    thanks 😁😁

  • @duxoxovak
    @duxoxovak ปีที่แล้ว

    Thank you for the video, NerdCave. Reversing the connection so that Receive of one device connects to Send of the other device and vice versa fixed the problem for me. Per the instructions Raspberry Pi Pico GPIO 0 (PIN 1) which is UART0 TX was connecting to HC-05 TXD. And the GPIO 1(PIN 2) which is UART0 RX was connecting to HC-05 RXD (1m 27s and 1m40s from the start of the video). Connecting TX to TX and RX to RX caused the first message to be b'\x00'. Nothing worked after that - toggling the switch to on or off did not produce any text and did not control the LED state. Was fixed once I reversed connected UART0 TX to HC-05 RXD and UART0 RX to HC-05 TXD.

    • @NerdCaveYT
      @NerdCaveYT  ปีที่แล้ว

      Thank you for the feedback, I usually make simple mistakes in the Fritzing Diagram. It might have been that I had it connected differently then the diagram, I am making sure now to check the diagrams multiple times before using them in a video

  • @jachimpetit470
    @jachimpetit470 2 ปีที่แล้ว

    thx help full video

    • @NerdCaveYT
      @NerdCaveYT  2 ปีที่แล้ว +1

      You're welcome!

  • @MrBobWareham
    @MrBobWareham ปีที่แล้ว

    I would love to build your clock but with a better display I have a st7735 display, but I am new to Pi Pico any chance of a tutorial on how to use the ST7735 display with it? Thanks

    • @NerdCaveYT
      @NerdCaveYT  ปีที่แล้ว

      I don't have one of those displays but usually if you search the display name and micropython you will find a GitHub repository where someone made a library

  • @adrianpuskas6996
    @adrianpuskas6996 2 ปีที่แล้ว +1

    This part of the code is wrong.
    if M < 10:
    hr = "0" + str(M)
    That's correctly
    if M < 10:
    M = "0" + str(M)
    But, very nice work! Thank you!

    • @NerdCaveYT
      @NerdCaveYT  2 ปีที่แล้ว +1

      Thanks yes I noticed that updated it on GitHub a while back, will look at putting a note in video through TH-cam studio

  • @carpiMusic
    @carpiMusic ปีที่แล้ว

    Hello, do you have any idea how to do it with an SSD1306 screen?

    • @NerdCaveYT
      @NerdCaveYT  ปีที่แล้ว

      You want to display the time on the ssd1306?I have done a video on the ssd1306 so basically it is just using this code along with the ssd1306 library to display the time on their

  • @max3734
    @max3734 หลายเดือนก่อน

    Hi, thank you for the tutorial. I have an issue when trying to run my main.py file;
    "Traceback (most recent call last):
    File "", line 29, in
    File "pico_i2c_lcd.py", line 22, in __init__
    OSError: [Errno 5] EIO"
    I'm not sure what's wrong, can I have assistance?

    • @NerdCaveYT
      @NerdCaveYT  หลายเดือนก่อน

      seems like the lcd screen giving problems can you double check the SCL and CLK pin connection

    • @max3734
      @max3734 หลายเดือนก่อน

      @@NerdCaveYT in the moment I had to connect a female wire to a male to the breadboard, as I didn’t have a female to male wire… could that extra extension cause issues?

    • @NerdCaveYT
      @NerdCaveYT  หลายเดือนก่อน

      it shouldn't be an issue the LCD screens will have pullup resistors and it will give a different error, did you try just getting the screen to work on its own.

    • @max3734
      @max3734 หลายเดือนก่อน

      @@NerdCaveYT Yes, so I followed your tutorial on just the LCD screen and it works, but I keep running into the same error here.

    • @NerdCaveYT
      @NerdCaveYT  หลายเดือนก่อน

      @@max3734 okay this is very strange if the LCD is working fine when you followed the other tutorial it should not give any problem here.
      Error 5 indicates a communication problem.
      For connection problems, check that
      - all four wires are place: GND, SDA, SCL and Vcc
      - and the LCD already have pull up.
      So let's try this, let's change the I2C pins
      connect the SDA pin to GP6 ( Physical Pin 9)
      connect the SCL pin to GP7 ( Physical Pin 10)
      and change the following in your code:
      i2c = I2C(1, sda=machine.Pin(6), scl=machine.Pin(7), freq=400000)

  • @burnsfamily1616
    @burnsfamily1616 9 หลายเดือนก่อน

    Will it work with DS3231SN?

    • @NerdCaveYT
      @NerdCaveYT  9 หลายเดือนก่อน

      Will need to use different library github.com/pangopi/micropython-DS3231-AT24C32

  • @ronen124
    @ronen124 2 ปีที่แล้ว +1

  • @Jai.zTechDomain
    @Jai.zTechDomain 4 หลายเดือนก่อน +1

    Is this tutorial still ok for me to follow as of 2024?

    • @NerdCaveYT
      @NerdCaveYT  4 หลายเดือนก่อน +1

      Yes still relevant

    • @Jai.zTechDomain
      @Jai.zTechDomain 4 หลายเดือนก่อน +1

      @@NerdCaveYT ok cool, is using it with an ssd1306 as simple as changing the libraries, or do I need to modify the code (complete beginner sorry)

    • @NerdCaveYT
      @NerdCaveYT  4 หลายเดือนก่อน +1

      Yes, you need the library for the ssd1306, I have made a video on it, then you can display the time on it using the code from the RTC@@Jai.zTechDomain

    • @Jai.zTechDomain
      @Jai.zTechDomain 4 หลายเดือนก่อน

      @@NerdCaveYT alright awesome thank you so much!!

  • @_____I_____
    @_____I_____ ปีที่แล้ว

    does anyone knows why my date is 165/165/21

    • @NerdCaveYT
      @NerdCaveYT  ปีที่แล้ว

      have you set the date? can you share your code in discord

    • @creekworks
      @creekworks ปีที่แล้ว

      You ever figure this out?

    • @_____I_____
      @_____I_____ ปีที่แล้ว

      Ok i fixed it some of the code is in comment

  • @carelhaasbroek1575
    @carelhaasbroek1575 ปีที่แล้ว

    i can hear the afrikaans in your voice.