DeskPi PicoMate User Manual
DeskPi PicoMate User Manual
Designed for Raspberry Pi Pico & Pico W V1.0
Table of contents
- Revision history
- Introduction
- Key Features
- What's included
- Pinout Diagram
- Getting Started With Python
- Installing CircuitPython
- Installing Mu Editor
- Python Examples
- Blink RGB LED
- Button
- Rotary Encoder
- Buzzer
- 0.96” 128x64 OLED Display
- PDM Microphone
- Digital PIR Sensor
- 6-Axis IMU Sensor
- 3-Axis Magnetometer
- Digital Optical Sensor
- Temperature & Humidity Sensor
- Appendix A: DeskPi PicoMate Pinout Diagram
Introduction
DeskPi PicoMate is an all-in-one and versatile prototyping kit designed for Raspberry Pi Pico and Pico W. It includes one expansion dock for Raspberry Pi Pico and Pico W, 12 detachable modules and all in one- piece of PCB design. All modules are pre-wired to the Pico Dock, no soldering and wiring required and out-of-box. Of course, you can also detach the modules and connect them using the cables included in the box.
Key Features
Designed for Raspberry Pi Pico and Pico W
All modules are pre-wired, no soldering and wiring required and out-of-box
12 detachable and easy-to-use modules:
- Push Button
- WS2812 RGB LED
- Rotary Encoder
- Buzzer
- Digital Microphone (ZTS6531S)
- Digital PIR Sensor (AS312)
- 6-Axis IMU Sensor (LSM6DS3TR-C)
- Digital Optical Sensor (LTR-381RGB-01)
- 3-Axis Magnetometer (MMC5603NJ)
- Temperature & Humidity Sensor (SHT30-DIS)
- 0.96” 128x64 OLED Display (SSD1315)
- 204 Pins Breakout Board
- All Pico GPIOs available via headers and up to 11 Grove connectors available
- Built-in battery connector for on-the-go projects
- MicroPython libraries support for all modules
- 3.3V IO operating voltage
What's included
- 1x DeskPi PicoMate
- 1x Raspberry Pi Pico with pre-soldered pin headers
- 1x 3*AA Battery Holder with On/Off Switch
- 6x Grove Cable
- 1x Micro USB Cable
Pinout Diagram
Getting Started with Python
The DeskPi PicoMate can be programmed using the popular Python programming language. Raspberry Pi Pico is supported by CircuitPython, which is based on MicroPython, and features unified Python core APIs and a growing list of device libraries and drivers that work with it.
This section describes how to set up CircuitPython on DeskPi PicoMate. Examples are also provided to help you to get started in a very short time.
Installing CircuitPython
Download the official CircuiPython for Raspberry Pi Pico. Choose the latest stable release and then download the .uf2 file.
Then go ahead and:
- Push and hold the BOOTSEL button and plug your Pico into the USB port of your Release the BOOTSEL button after your Pico is connected.
- It will mount as a Mass Storage Device called RPI-RP2.
- Drag and drop the CircuitPython UF2 file onto the RPI-RP2 Your Pico will reboot. A new drive named CIRCUITPY should appear.
Installing Mu Editor
Mu Editor is a simple Python code editor for beginner programmers. Go to Mu Editor Download page, choose your Operational System and follow the instructions.
Once the Mu Editor is installed, open it, go to Mode menu, select CircuitPython and press OK.
In the text editor, try some Python code:
print('Hello, DeskPi PicoMate!') |
Select Save on Top Menu. A window will appear. Give the name code.py for your code and save it on the CIRCUITPY drive. Your code will run as soon as the file is done saving.
The Serial button opens a serial data connection to the Pico. This will result in a new panel between the text editor and Mu s footer, which prints the data from the Pico.
If you need to drop into the CircuitPython REPL you should make sure the panel has keyboard focus (just click it!) and then type CTRL+ C.
Now that you have the Python prerequisites installed, it is time to explore more examples for the DeskPi PicoMate.
Python Examples
This section consists of several example codes. The examples are organized in different levels of codes to demonstrate the Python API usage.
Blink RGB LED
DeskPi PicoMate has a WS2812 RGB LED pre-wired to GP22 on the Pico. We can use the NeoPixel library to blink the RGB LED.
Download the NeoPixel library and copy neopixel.py into the CIRCUITPY/lib folder. This should give you the following folder structure:
Copy and paste the following code to the Mu Editor and press Save:
Your code will run as soon as the file is done saving. Observe that the RGB LED starts to blink. For more details about the Neopixel API reference, please check out Read the Docs.
Button
DeskPi PicoMate has a Push Button pre-wired to GP26 on the Pico. The example prints a message to the console each time the state of the button changes. When the button is pressed, the input level of GP26 will be low (False).
Copy and paste the following code to the Mu Editor and press Save:
Press the button and observe the Serial Console, you will see the message printed each time the state of the button changes:
Rotary Encoder
DeskPi PicoMate has an incremental rotary encoder pre-wired to the Pico, which converts the motion of the switch (clockwise or counterclockwise) into an output signal that can be used to determine what direction the knob is being rotated.
The table below shows the connections of each pin of the rotary encoder:
Copy and paste the following code to the Mu Editor and press Save:
Now, open the Serial Console, then try rotating the knob slowly clockwise or counterclockwise, and try pressing down on the knob.
Buzzer
DeskPi PicoMate has a buzzer pre-wired to GP27 on the Pico. To control the buzzer from CircuitPython we will use its built in PWM, or pulse-width modulation, signal generation capabilities.
Copy and paste the following code to the Mu Editor and press Save:
The music playback will immediately start as soon as the code is done saving.
0.96” 128x64 OLED Display
DeskPi PicoMate has a 0.96" 128x64 OLED Display module, which is pre-wired to the Pico using I2C0 with the device address 0x3C.
The table below shows the connections of each pin of the OLED:
Before we can use the display module, we need the following modules installed:
- adafruit_register
- adafruit_framebuf
- adafruit_ssd1306
Copy the libraries into the CIRCUITPY/lib folder. This should give you the following folder structure:
Then, copy and paste the following code to the Mu Editor and press Save:
Try to change the display text and observe what is printed on the OLED.
PDM Microphone
DeskPi PicoMate has a high quality, low power PDM digital output top-ported omni-directional MEMS microphone.
The PDM microphone is pre-wired to the Pico. The table below shows the connections of each pin of the PDM microphone:
As PDMIn is built into CircuitPython, no separate libraries are necessary for this example!
Copy and paste the following code to the Mu Editor and press Save:
On Serial Console, you will see the Normalized RMS value of the audio captured by the Microphone. Try to make some sound. You will see the magnitude changes. You can also use the plotter for data inspection. Press the Plotter button on the top menu.
Digital PIR Sensor
DeskPi PicoMate has a Digital PIR sensor pre-wired to GP28 on the Pico. The Digital PIR sensor allows you to sense motion, almost used to detect whether a human has moved in or out of the sensors range.
The Digital PIR sensor acts as a digital output. When the sensor is triggered, the input level of GP28 will be high (True).
Copy and paste the following code to the Mu Editor and press Save:
Try moving your body and see messages printed on the Serial Console.
6-Axis IMU Sensor
DeskPi PicoMate has a 6-Axis IMU sensor (LSM6DS3TR-C) featuring a 3D digital accelerometer and a 3D digital gyroscope. The sensor is pre-wired to the Pico using I2C1 with the device address 0x6A.
The table below shows the connections of each pin of the sensor:
Before we can use the sensor, we need the following modules installed:
- adafruit_register
- adafruit_lsm6ds
Copy the libraries into the CIRCUITPY/lib folder. This should give you the following folder structure:
Then, copy and paste the following code to the Mu Editor and press Save:
Press the Plotter button on the top menu, and try moving your board and see the changes in plotter.
3-Axis Magnetometer
DeskPi PicoMate has a 3-Axis Magnetometer (MMC5603NJ) that can measure magnetic fields surrounding the device.
The sensor is pre-wired to the Pico using I2C1 with the device address 0x30.
The table below shows the connections of each pin of the sensor:
Before we can use the sensor, we need the following modules installed:
- adafruit_register
- adafruit_mmc56x3
Copy the libraries into the CIRCUITPY/lib folder. This should give you the following folder structure:
hen, copy and paste the following code to the Mu Editor and press Save:
Press the Plotter button on the top menu, and try moving your board and see the changes in plotter.
Digital Optical Sensor
DeskPi PicoMate has a Digital Optical Sensor (LTR-381RGB-01) that integrates an ambient light sensor (ALS) and a color sensor (CS). With the advanced RGB color sensor, this sensor converts light (Red, Green, Blue, and IR) intensity to a digital output signal capable of direct I2C interface. The ALS provides a linear response over a wide dynamic range, which is well suited to applications under very low or bright ambient brightness.
The sensor is pre-wired to the Pico using I2C1 with the device address 0x53.
The table below shows the connections of each pin of the sensor:
Before we can use the sensor, we need the following modules installed:
- adafruit_register
- ltr381rgb
Copy the libraries into the CIRCUITPY/lib folder. This should give you the following folder structure:
Then, copy and paste the following code to the Mu Editor and press Save:
On Serial Console, you will see the the calculated lux of ambient light. Try to lit up or dim the sensor. You will see the value changes. You can also use the plotter for raw data inspection. Press the Plotter button on the top menu.
Temperature & Humidity Sensor
DeskPi PicoMate has a temperature and humidity sensor (SHT30-DIS), which is pre-wired to the Pico using I2C1 with the device address 0x44.
The table below shows the connections of each pin of the sensor:
Before we can use the sensor, we need the following modules installed:
- adafruit_register
- adafruit_sht31d
Copy the libraries into the CIRCUITPY/lib folder. This should give you the following folder structure:
Then, copy and paste the following code to the Mu Editor and press Save:
On Serial Console, you will see the temperature and humidity printed every 2s.