Pico-Clock-Green

From Waveshare Wiki
Jump to: navigation, search
Pico-Clock-Green
Pico-Clock-Green

Rectangle Electronic Clock For Raspberry Pi Pico
Accurate RTC, Multi Functions, LED Digits
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Overview

This product is available in Chinese and English versions and is hardware and software compatible.

Precautions before use: When plugging into the Raspberry Pi Pico, the module's pogo pin needs to be positioned to the TP3 (D+) and TP2 (D-) of the Raspberry Pi Pico.

Introduction

The Pico-Clock-Green is an LED-digit electronic clock designed for Raspberry Pi Pico. It incorporates high-precision RTC chip DS3231, I2C communication interface, photosensor, buzzer, and buttons, and features multiple functions including an accurate electronic clock, temperature display, auto-brightness adjustment, alarm, and button config. The important part is that rich open-source codes and development tutorials are also provided to help you fast get started with Raspberry Pi Pico and make your original electronic clock.

Features

  • Standard Raspberry Pi Pico header, supports Raspberry Pi Pico series. Reserved 40PIN headers and distinguished the usage of GP (general-purpose) pins for this product, making it easier for users to connect to other modules.
  • Support communication through the pogo pins, providing external peripheral programming interfaces for PICO.
    • Onboard high precision RTC chip DS3231, with backup battery holder.
    • Real-Time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap-year compensation valid up to 2100.
    • Optional format: 24-hour OR 12-hour with an AM/PM indicator.
    • 2 x programable alarm clock.
    • Embedded accurate digital temperature sensor and support reading from I2C.
  • Onboard two SM16106 LED display driver chips and one SM5166PLED display control chip on board, which are used to control the display of 8 x 24 matrix LEDs.
  • Support AutoLight adjustment, with embedded photosensor for auto brightness adjustment due to the ambient light.
  • Multifunction status bar: the status bar indicates scrolling, clock, countdown timer, ℉ or ℃.
  • Smart control: 3 x buttons for configuration.
  • Comes with online development resources and manual (Raspberry Pi Pico C/C++ and MicroPython examples).
  • The status bar can indicate the following: scroll mode active, alarm active, countdown timer active, Celsius/Fahrenheit, stopwatch active, hourly chime, automatic brightness, AM/PM status when displaying in 12-hour format.

Specification

  • Operating Voltage: 3.3V~5V
  • Backup battery voltage: 2.3V ~ 5.5V
  • Operating temperature: -40°C ~ +85°C
  • Power consumption: 100nA

Product Size

Pico-clock-PCB.jpg

Setup environment

1. For the Raspberry Pi environment setting, please refer to link.
2. For the Windows environment setting, please refer to link.
Related resource: Raspberry Pi Pico C/C++ SDK Manual

Raspberry Pi

  • Open a terminal of Raspberry Pi by SSH or press Ctrl+Alt+T at the same time while using the screen to open the terminal.
  • Download and unzip the demo codes to the directory Pico C/C++ SDK. Reference for users who have not yet installed the SDK.
#Note that the directory of SDK may be different for different users, you need to check the actual directory. Generally, it should be ~/pico/.
wget  -P  ~/pico   https://files.waveshare.com/upload/a/ab/Pico-Clock-Green.zip
cd  ~/pico  
unzip Pico-Clock-Green.zip 

C

  • Hold the BOOTSEL button of Pico, and connect the USB interface of Pico to Raspberry Pi then release the button.
  • Compile and run the pico-rtc-ds3231 examples.
cd ~/pico/Pico-Clock-Green/build/
cmake ..
make
sudo mount /dev/sda1 /mnt/pico && sudo cp Pico-Clock-Green.uf2 /mnt/pico/ && sudo sync && sudo umount /mnt/pico && sleep 2

Windows

  • Download and unzip the demo to your Windows desktop, refer to Raspberry Pi's guides to set up the Windows software environment settings.
  • Find the Pico-Clock-Green.uf2 file under the build file under the demo directory, press and hold the BOOTSEL button of Pico, connect the USB of Pico to the PC with a MicroUSB cable, and drag the uf2 file into Pico, and then the Pico will run the demo directly.
  • 【Note】 If some users want to modify the demo, after debugging, you can use the following method to generate a .uf2 file:

1. Copy the Pico-Clocd-Green folder to your pico-examples file directory, and then modify the CMakelists.txt configuration file in the pico-example directory as shown in the figure below.
2. Open Visual Studio Code, open your pico-examples folder, select Pico-Clocd-Green, and click Generate, you can find the Pico-Clock-Green.uf2 file in the build folder.
3. Drag the uf2 file into Pico, and then Pico will run the demo directly.

Pico-Clock-Green002.png

Pico-Clock-Green003.png

Demo Function Descroption

  • Time display interface: The week, hour, and minute can be displayed under the time display interface, supporting the 12/24 hour format.
  • Status bar: The status bar can display the Scroll switch, Alarm switch, Countdown, Temperature (Celsius/Fahrenheit), Timing, Hourly ring, Automatic brightness, and the AM/PM status display will be turned on when the 12-hour clock is displayed.
  • Scrolling display: After the scrolling is turned on, it will scroll every three minutes, and the scrolling will display the year, month, day, hour, and temperature.
  • Temperature display: Display after scrolling on, you can choose Celsius or Fahrenheit display.
  • Alarm clock settings: The alarm clocks are set by week (set the alarm time, select the day of the week on which the alarm will sound).
  • Button sound: You can turn on or off the button sound, bp: ON or bp: OF.
  • Timekeeping: up to 59 minutes and 59 seconds of timekeeping, a beeping sound will be heard when the countdown is connected.
  • Auto Light: After turning on auto-brightness, you can adjust the brightness according to the environment.

Function instructions

  • Button description: There are three buttons from top to next. We define them as Config mode switch, Up-adjusting button, Down-adjusting/Exit button. The short-press time range: <=300ms; the long-press time range >300ms.
  • Button function description:
    • Config mode switch button: short press to switch Setting mode; long press to enter Alarm setting.
    • Up-adjusting button: short press to switch State; long press to enter Timekeeping setting.
    • Down-adjusting/Exit button: short press to switch state; long press to exit to Time display state.
  • Short press the Config mode switch button to switch the normal mode setting. When the status is being switched, the current position will flash 【Including Time, Button sound switch (BP: ON or BP: OF), Scroll switch (DP: ON or DP: OF), Time display mode (MD:1 12-hour system or MD:2 24-hour system), Hourly ring signal switch (FT: ON or FT: OF)】
  • The Time Setting: Enters the year, month, day, hour, and minute in the normal setting mode. When selected, the current position will flash. Set the time through the Up-adjusting button or Down-adjusting button. When the setting mode is switched/press the Exit button/no operation exit (10 seconds without any operation), the current position value will be written to RTC, if the value has never been changed, it will not be overwritten. Note that the second will be cleared when setting.
  • Alarm setting: Long presses the Config mode switch button to enter the Alarm setting; A0/A1: ON/OF, short press the Up-adjusting and Down-adjusting button to select which alarm clock to set; short press the Config mode switch button to enter the hour and minute setting, and then select the day of the week on which the alarm will sound (the Week state will jump to Monday, select the day of the week through the Up-adjusting and Down-adjusting button), short press the Config mode switch button again, and the alarm will be set successfully.
  • Timekeeping setting: Long press the Up-adjusting button to enter the Time Setting, and select TM.OF/UP/DN through the Up-adjusting button and Down-adjusting button, (OF: off/UP: up counting/DN: down counting);
    • Up counting: The timing result is updated every 3 seconds. When the Config mode switch button is pressed, the counting result will be displayed. Press the Config mode switch button again to return to the time display state;
    • Down Counting: After finishing the time setting, the countdown will start. After the timer expires, the buzzer will be triggered automatically.
  • Celsius/Fahrenheit selection: In the time display state, short press the Up-adjusting button to switch the temperature display mode.
  • Auto Light: In the time display state, short press the Down-adjusting to turn on or off the auto brightness mode.

Micropython

  • 1. Press the BOOTSET key of the Pico board, connect the Pico to the PC with a Micro USB cable, and then a removable hard drive (RPI-RP2) shows on the PC, and then you can release the key.
  • 2. Copy the rp2-pico-w-20230219-unstable-v1.19.1.uf2 file on the sample demo file directory to the removable hard drive (RPI-RP2).
  • 3. Open the Thonny IDE (Note: Please use the latest version, otherwise, there is no PICO support package).
  • 4. Click on Tool -> Setting -> Interpreter, as shown below, and select the Pico board and the corresponding port.

Pico-clock-green 14.png

  • 5. Click on the STOP key, if "shell" outputs the following message, it indicates the firmware downloading and connection are successful. As shown below:

Pico-clock-green 02.png

  • 6. File -> pico-clock-green-python-main -> Select all to upload. As shown below:

Pico-clock-green 03.png

  • 7. Click on the "main.py" of the Pico file to run, as shown below:

Pico-clock-green 04.png

  • 8. After running it successfully, plug the pico board onto the Pico-clock-green, as shown below:

Pico-clock-green 06.jpg

  • For more latest demos and description, you can refer to github demo.

Sample Demo Description

  • Time Display Interface: The time display interface can show the day of the week, hour, and minute, supporting both 12-hour and 24-hour formats.
  • Status Bar: The status bar can display a countdown timer, temperature (Celsius/Fahrenheit), and automatic brightness. When in 12-hour format, it will also show AM/PM status.
  • Scrolling Display: Short press the scroll button to start scrolling, which will display the time and temperature.
  • Temperature Display: After scrolling, it is activated and will display the temperature, which can be shown in either Celsius or Fahrenheit.
  • Countdown Timer: You can set a countdown duration, and it will start counting down when you press the start button.
  • Adjust Brightness: Short press the adjustment button to cycle through brightness levels from high to low.
  • Auto Light: When auto light is enabled, it will adjust the brightness according to the ambient light.

Function Description

  • Button Description: From top to bottom: Setting/Switch Button, Up/Temperature Adjustment Button, and Down/Brightness Adjustment Button. Short-press duration: <=500ms; Long-press duration: 500ms.
  • Button function: three buttons support long-press and short-press functions. Setting/Switch button (short-press: switch to time display; long-press: enter switch mode); Up Button (short-press: scrolling the display; long-press: switching Celsius or Fahrenheit); Down/Brightness Adjustment Button (short-press: brightness adjustment and automatic brightness).
  • Set/Switch key: short press: display the current time 【Hour, Minute, Week】; long press: enter switch mode (display time, set time and countdown timer); and you can switch it through up/down button, confirm it by pressing the setting button.

Pico-clock-green 05.jpg Pico-clock-green 07.jpg Pico-clock-green 09.jpg

  • Time Setting: In the time setting mode, the year, month, day, hour, and minute can be adjusted. The currently selected parameter will blink. Use the up or down buttons to adjust the value. When you press the confirm button, it will move to the next parameter to be set. After all parameters are set and "DONE" is displayed, the values will be written to the RTC.

Pico-clock-green 08.jpg

  • Countdown Timer: Enter the countdown setting mode. Use the up or down buttons to adjust the countdown time. Once set, press the confirm button to start the countdown.

Pico-clock-green 12.jpgPico-clock-green 13.jpg

  • Celsius / Fahrenheit: Long-press the up button to switch between temperature display modes, °C and °F.

Pico-clock-green 06.jpgPico-clock-green 10.jpg

  • AutoLight: Short-press the down button or AutoLight button to adjust.

Pico-clock-green 11.jpg

Resources

Document

Demo

Datasheet

Development Software

Pico Quick Start

Download Firmware

  • MicroPython Firmware Download

MicroPython Firmware Download.gif

  • C_Blink Firmware Download

C Blink Download.gif

Video Tutorial

  • Pico Tutorial I - Basic Introduction

  • Pico Tutorial II - GPIO

  • Pico Tutorial III - PWM

  • Pico Tutorial IV - ADC

  • Pico Tutorial V - UART

  • Pico Tutorial VI - To be continued...

Text Tutorial

Introduction

MicroPython Series

C/C++ Series

Arduino IDE Series

Install Arduino IDE

  1. Download the Arduino IDE installation package from Arduino website.
    RoArm-M1 Tutorial II01.jpg
  2. Just click on "JUST DOWNLOAD".
    Arduino IDE Pico.png
  3. Click to install after downloading.
    RoArm-M1 Tutorial II02.gif
  4. Note: You will be prompted to install the driver during the installation process, we can click Install.

Install Arduino-Pico Core on Arduino IDE

  1. Open Arduino IDE, click the File on the left corner and choose "Preferences".
    RoArm-M1 Tutorial04.jpg
  2. Add the following link in "Additional boards manager URLs", then click OK.
    https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

    RoArm-M1 Tutorial II05.jpg
    Note: If you already have the ESP32 board URL, you can separate the URLs with commas like this:

    https://dl.espressif.com/dl/package_esp32_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
    
  3. Click on Tools -> Board -> Board Manager -> Search for pico, it shows installed since my computer has already installed it.
    Pico Get Start 05.png
    Pico Get Start 06.png

Upload Demo At the First Time

  1. Press and hold the BOOTSET button on the Pico board, connect the Pico to the USB port of the computer via the Micro USB cable, and release the button when the computer recognizes a removable hard drive (RPI-RP2).
    Pico Get Start.gif
  2. Download the demo, open the D1-LED.ino under arduino\PWM\D1-LED path.
  3. Click Tools -> Port, remember the existing COM, do not need to click this COM (different computers show different COM, remember the existing COM on your computer).
    UGV1 doenload02EN.png
  4. Connect the driver board to the computer with a USB cable, then click Tools -> Ports, select uf2 Board for the first connection, and after the upload is complete, connecting again will result in an additional COM port.
    UGV1 doenload03EN.png
  5. Click Tools -> Board -> Raspberry Pi Pico/RP2040 -> Raspberry Pi Pico.
    Pico Get Start02.png
  6. After setting, click the right arrow to upload.
    Pico Get Start03.png
    • If you encounter problems during the period, you need to reinstall or replace the Arduino IDE version, uninstall the Arduino IDE clean, after uninstalling the software you need to manually delete all the contents of the folder C:\Users\[name]\AppData\Local\Arduino15 (you need to show the hidden files in order to see it) and then reinstall.


Open Source Demo

Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)