Category: Raspberry Pi Pico
-
How to use MG90S Servo Motor with Raspberry Pi Pico using micropython
I have this MG90S small servo motor. It is supposed to go from 0° to 180°. Because of their low cost, they have a short range which is less than 180°. Some go to 135°, 100° or 150°. PWM signal required by servo to move. Frequency = 50HzTime Period = 0.02 Second or 20 mili…
-
How to Use C SDK to Create UF2 file which Interface Ultrasonic Sensor with Raspberry Pi Pico
Hardware setup HC-SR04 Raspberry Pi Pico VCC VSYS GND GND Trig GP2 ECHO GP3 I am using raspberry pi model 3 b+ for the code compilation. If everything worked, you will have your ulf2 file in your build directory
-
Interfacing a 5V Ultrasonic Sensor with 3.3V GPIO of Raspberry Pi Pico: A Voltage Divider Solution
I have an old HC-Sr04 ultrasonic sensor. I don’t know if it’s GPIO voltage compatible with the 3.3V microcontroller. On the internet, I found that the old sensors work with 5V. So, I used a voltage divider made of 1K ohm and 1.5K ohm Surface mount resistors. To bring down the 5V to a suitable…
-
Raspberry Pi Pico Internal Temperature Sensor Based Fan Speed Control using PID Algorithm with Anti-Windup Logic
This system uses the Raspberry pi pico development board which has an RP2040 microcontroller. The RP2040 microcontroller has an internal temperature sensor. Using its internal temperature sensor I have devised a very simple setup that demonstrates the PID algorithm. Using PID Algorithm control technique I am controlling the fan speed by changing the PWM duty…
-
How to use Neo 6m GPS Module with Raspberry Pi Pico
Connect the GPS module to the Raspberry Pi Pico as follows: Note: Since Raspberry Pi Pico operates at 3.3V logic level, you can directly connect the GPS module without voltage level shifting. The module will output something like this $GPRMC,103255.00,V,,,,,,,180523,,,N*70 $GPVTG,,,,,,,,,N*30 $GPGGA,103255.00,,,,,0,00,99.99,,,,,,*66 $GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30 $GPGSV,1,1,01,18,,,31*73 $GPGLL,,,,,103255.00,V,N*4A These are the NMEA messages. by decoding these messages we…
-
Interfacing an external +5V power supply with Raspberry Pi Pico
From the section 4.5 Powering Pico of the official Raspberry Pi Datasheet. I have decided to use the first method which is suggest to use a schottky diode with the VSYS pin. I have used 1N5819 Schottky diode.which hasVRRM = 40V,Maximum average forward rectified current IF(AV) = 1A The schottky diode and the diode on…
-
How to use button with Raspberry Pi Pico using micropython
The Pico has internal pull up /down circuits inside it. I have made this simple circuit for demonstration. Button could be connected in two ways. In the schematic i connected a button to GP22 using a external pull up of resistor 10k. I also used a capacitor in parallel with the button to debounce the…
-
How to use GPIO of Raspberry Pi Pico as Output Pins
One of the most important features of the Raspberry Pi Pico is its General-Purpose Input/Output (GPIO) pins. These pins can be used to control external devices, such as LEDs, motors, and relays. The Raspberry Pi Pico has 26 GPIO pins, numbered from GP0 to GP25. Each pin can be individually programmed to perform a specific…
-
Raspberry Pi Pico Symbol in KiCad 7 Project Library
This project has all the files necessary to make a project using it. In this project i have included a symbol library and a footprint library. It is a custom library. You can use this in another project by adding it into the project library list. This project is made using the KiCad 7. Symbol…
-
Handling errors with strings in MicroPython on Raspberry Pi Pico
When working with strings in MicroPython on Raspberry Pi Pico, it is important to handle errors that may occur during string operations. Errors can occur for a variety of reasons, such as invalid input or incorrect syntax. Fortunately, MicroPython provides several built-in mechanisms for handling errors with strings. One of the most common errors that…