- Voltage: 3C ~ 5.5V
- Output Type: TTL
- Dimension: 53.0mm * 18.0mm
- Fixed Hole Dimension: 2.00mm
- Shake detection
- Guard alarm
- Smart car
- Electric bricks
- VCC ↔ 3.0V ~ 5.5V
- GND ↔ power supply ground
- DOUT ↔ MCU.IO (digital output)
Get Started at Pico
If you are the first time o use the Pico, you need to first learn how to get started at the Pico before you run other examples.
The Pico supports C and the Micropython which requires different firmware.
In most of the examples archives (Demo codes), we provide a Micropython firmware (uf2 file), we recommend you to use the provided firmware to test the board. Because the codes may run abnormally with different firmware.
If the board is tested to be workable, you can also download the newest firmware from Raspberry Pi and do further programming.
- If you want to use C codes, please refer to the C/C++ Guides
- If you want to use Micropython codes, please refer to the Micropython Guides.
- The link of the newest Micropython firmware of Pico
- Official Guides of Raspberry Pi Pico
Use the Raspberry Pi as the host device. Open a terminal and run the following commands to download the example.
sudo apt-get install p7zip-full cd ~ sudo wget https://www.waveshare.com/w/upload/b/b6/Tilt-Sensor-code.7z 7z x Tilt-Sensor-code.7z -o./Tilt-Sensor-code
- Go into the c directory
- Add the path of SDK
- Note that if the path of your SDK is different, you need to modify the command and use the correct path to export
- Generate Makefile and build
cmake .. make -j9
- After building, a uf2 file is generated
- Press and hold the button of Pico, connect it to Raspberry Pi then release the button.
- Copy/Drag the uf2 file to the protable disk (RPI-RP2) recognized
cp main.uf2 /media/pi/RPI-RP2/
- Flash the Micropython firmware first
- Open the Thonny IDE (Menu->Programming->Thonny Python IDE).
- 【Optiional】If the Thonny IDE in the Raspberry Pi is not the new version which supports Pico, please upgrade it first.
sudo apt upgrade thonny
- Configure Interpreter, choose Tools->Options... -> Interpreter, choose MicroPython(Raspberry Pi Pico) and the ttyACM0 port.
- Click File -> Open.. and browser the micropython codes (Tilt Sensor.py) to run the codes
- When the module is shaken or tilted, the signal indicator on the module is on, and when the module is placed in parallel, the signal indicator on the module is off.
The STM32 examples are based on the STM32F103RBT6 and the STM32H743. The connection provided below is based on the STM32F103RB. If you need to use other STM32 boards, you may need to change the hardware connection and port the code yourself.
The examples are developed based on the HAL libraries. Download the Demo codes archive to your PC. Unzip and find the STM32 project from Tilt-Sensor-code\STM32\STM32F103RB\MDK-ARM.
- Open the Tilt Sensor.uvprojx file by Keil
- Build and the project
- Program the project to your STM32 board.
- Connect the UART1 of your STM32 board to the PC and check the serial data by SSCOM software.
The Arduino example is written for the Arduino UNO. If you want to connect it to other Arduino boards, you may need to change the connection.
- Download the demo codes to your PC and unzip
- Install the Arduino IDE in your PC
- Go into Tilt-Sensor-code/Arduino/Tilt_Senso
- Run the Tilt_Sensor.ino file
- Select the correct Board and the Port
- Build the project and upload it to the board.
- Open the serial monitor of the Arduino IDE or the SSCOM software and check the serial data.
If you require technical support, please go to the Support page and open a ticket.