Pico-Clock-Green
| ||
Overview
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
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.
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.
- 5. Click on the STOP key, if "shell" outputs the following message, it indicates the firmware downloading and connection are successful. As shown below:
- 6. File -> pico-clock-green-python-main -> Select all to upload. As shown below:
- 7. Click on the "main.py" of the Pico file to run, as shown below:
- 8. After running it successfully, plug the pico board onto the Pico-clock-green, as shown below:
- 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.
- 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.
- 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.
- Celsius / Fahrenheit: Long-press the up button to switch between temperature display modes, °C and °F.
- AutoLight: Short-press the down button or AutoLight button to adjust.
Resources
Document
Demo
Datasheet
Development Software
- Zimo221.7z
- Image2Lcd.7z
- Font Library Tutorial
- Image Extraction Tutorial
- Thonny Python IDE (Windows V3.3.3)
Pico Getting Started
Firmware Download
Introduction
MicroPython Series
Install Thonny IDE
In order to facilitate the development of Pico/Pico2 boards using MicroPython on a computer, it is recommended to download the Thonny IDE
- Download Thonny IDE and follow the steps to install, the installation packages are all Windows versions, please refer to Thonny's official website for other versions
- After installation, the language and motherboard environment need to be configured for the first use. Since we are using Pico/Pico2, pay attention to selecting the Raspberry Pi option for the motherboard environment
- Configure MicroPython environment and choose Pico/Pico2 port
- Connect Pico/Pico2 to your computer first, and in the lower right corner of Thonny left-click on the configuration environment option --> select Configture interpreter
- In the pop-up window, select MicroPython (Raspberry Pi Pico), and choose the corresponding port
Flash Firmware
- Click OK to return to the Thonny main interface, download the corresponding firmware library and burn it to the device, and then click the Stop button to display the current environment in the Shell window
- Note: Flashing the Pico2 firmware provided by Micropython may cause the device to be unrecognized, please use the firmware below or in the package
- How to download the firmware library for Pico/Pico2 in windows: After holding down the BOOT button and connecting to the computer, release the BOOT button, a removable disk will appear on the computer, copy the firmware library into it
- How to download the firmware library for RP2040/RP2350 in windows: After connecting to the computer, press the BOOT key and the RESET key at the same time, release the RESET key first and then release the BOOT key, a removable disk will appear on the computer, copy the firmware library into it (you can also use the Pico/Pico2 method)
MicroPython Series
【MicroPython】 machine.Pin class function details
【MicroPython】machine.PWM class function details
【MicroPython】machine.ADC class function details
【MicroPython】machine.UART class function details
【MicroPython】machine.I2C class function details
【MicroPython】machine.SPI class function details
【MicroPython】rp2.StateMachine class function details
C/C++ Series
For C/C++, it is recommended to use Pico VS Code for development. This is a Microsoft Visual Studio Code extension designed to make it easier for you to create, develop, and debug projects for the Raspberry Pi Pico series development boards. No matter if you are a beginner or an experienced professional, this tool can assist you in developing Pico with confidence and ease. Here's how to install and use the extension.
- Official website tutorial: https://www.raspberrypi.com/news/pico-vscode-extension/
- This tutorial is suitable for Raspberry Pi Pico, Pico2 and the RP2040 and RP2350 series development boards developed by Waveshare
- The development environment defaults to Windows. For other environments, please refer to the official tutorial for installation
Install VSCode
-
First, click to download pico-vscode package, unzip and open the package, double-click to install VSCode
Note: If vscode is installed, check if the version is v1.87.0 or later
Install Extension
-
Click Extensions and select Install from VSIX
-
Select the package with the vsix suffix and click Install
-
Then vscode will automatically install raspberry-pi-pico and its dependency extensions, you can click Refresh to check the installation progress
-
The text in the right lower corner shows that the installation is complete. Close VSCode
Configure Extension
-
Open directory C:\Users\username and copy the entire .pico-sdk to that directory
-
The Copy is completed
-
Open vscode and configure the paths for the Raspberry Pi Pico extensions
The configuration is as follows:Cmake Path: ${HOME}/.pico-sdk/cmake/v3.28.6/bin/cmake.exe Git Path: ${HOME}/.pico-sdk/git/cmd/git.exe Ninja Path: ${HOME}/.pico-sdk/ninja/v1.12.1/ninja.exe Python3 Path: ${HOME}/.pico-sdk/python/3.12.1/python.exe
New Project
-
The configuration is complete, create a new project, enter the project name, select the path, and click Create to create the project
To test the official example, you can click on the Example next to the project name to select
-
The project is created successfully
-
Select the SDK version
-
Select Yes for advanced configuration
-
Choose the cross-compilation chain, 13.2.Rel1 is applicable for ARM cores, RISCV.13.3 is applicable for RISCV cores. You can select either based on your requirements
-
Select default for CMake version (the path configured earlier)
-
Select default for Ninjaversion
-
Select the development board
-
Click Complie to compile
-
The uf2 format file is successfully compiled
Import Project
- The Cmake file of the imported project cannot have Chinese (including comments), otherwise the import may fail
-
To import your own project, you need to add a line of code to the Cmake file to switch between pico and pico2 normally, otherwise even if pico2 is selected, the compiled firmware will still be suitable for pico
set(PICO_BOARD pico CACHE STRING "Board type")
Update Extension
-
The extension version in the offline package is 0.15.2, and you can also choose to update to the latest version after the installation is complete
Arduino IDE Series
Install Arduino IDE
-
First, go to Arduino official website to download the installation package of the Arduino IDE.
-
Here, you can select Just Download.
-
Once the download is complete, click Install.
Notice: During the installation process, it will prompt you to install the driver, just click Install
600px
Arduino IDE Interface
-
After the first installation, when you open the Arduino IDE, it will be in English. You can switch to other languages in File --> Preferences, or continue using the English interface.
-
In the Language field, select the language you want to switch to, and click OK.
Install Arduino-Pico Core in the Arduino IDE
-
Open the Arduino IDE, click on the file in the top left corner, and select Preferences
-
Add the following link to the attached board manager URL, and then click OK
https://github.com/earlephilhower/arduino-pico/releases/download/4.0.2/package_rp2040_index.json
Note: If you already have an ESP32 board URL, you can use a comma to separate the URLs as follows:https://dl.espressif.com/dl/package_esp32_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/4.0.2/package_rp2040_index.json
-
Click Tools > Development Board > Board Manager > Search pico, as my computer has already been installed, it shows that it is installed
Upload Demo at the First Time
-
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 after the computer recognizes a removable hard disk (RPI-RP2).
- Download the program and open D1-LED.ino under the arduino\PWM\D1-LED path
-
Click Tools --> Port, remember the existing COM, do not click this COM (the COM displayed is different on different computers, remember the COM on your own computer)
-
Connect the driver board to the computer using a USB cable. Then, go to Tools > Port. For the first connection, select uf2 Board. After uploading, when you connect again, an additional COM port will appear
-
Click Tools > Development Board > Raspberry Pi Pico > Raspberry Pi Pico or Raspberry Pi Pico 2
- After setting it up, click the right arrow to upload the program
- If issues arise during this period, and if you need to reinstall or update the Arduino IDE version, it is necessary to uninstall the Arduino IDE completely. After uninstalling the software, you need to manually delete all contents within the C:\Users\[name]\AppData\Local\Arduino15 folder (you need to show hidden files to see this folder). Then, proceed with a fresh installation.
Open Source Demos
MircoPython video demo (github)
MicroPython firmware/Blink demos (C)
Raspberry Pi official C/C++ demo (github)
Raspberry Pi official micropython demo (github)
Arduino official C/C++ demo (github)
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)