
The course goal is to build C++ projects on Raspberry PI Pico. Through learning about:
LEDs
WS2812B LEDs
Switches
Rotary Encoder
HC-SR501 PIR Module
Introduction to Dr Jon Durrant your tutor.
The approach that the course takes. Resources included with the course and where to find them. The pre-knowledge required by the course.
Summary and resources for this section.
Review raspberry PI Pico tool setup to be able to compile and deploy binaries onto the Pico. Testing this with the Blink test project.
Review other RP2040 devices you could also use.
Review the "Tool chain" needed for the course.
Describes the two binary deployment methods Boot Select and SWD.
A test project to blink the onboard LED.
Consider some other RP2040 devices that we could also target.
Section summary and resources.
What is a LED
Connecting LED to Pico
Operating the LED
Fading the LED
Review the common types of LED and the ones we will use in this course.
Looks at the approaches for LED to be connected to the Pico. Using the sourcing or sinking pattern.
How the value of the resistor is calculated, though generally, we can use a cheat sheet.
Using PWM to control the brightness of an LED.
Animating the brightness of an LED to fade.
Section summary
What is a WS2812B
Connecting WS2812B to Pico
Operating the WS2812B
Animating the WS2812B
What is the WS2812B and types available.
How we connect the WS2812B to the Pico.
We will use a library to connect to drive the WS2812B.
A simple example to drive the LED Ring to show the colours of the rainbow.
An animation of a chaser pattern around the LED Ring.
Three animation demos on the LED Ring.
Section summary.
Review types of switches
Pull-up and Pull-down switch configuration
Connecting switch to RP2040
Software strategies: Polling and Interrupt
Reset Switch
Review the common types of switches available.
Circuits for connecting a switch to the Pico.
Two patterns were introduced in connecting a switch to the Pico, Pull Up and Pull Down. This lecture dives deeper into the theory and choice of resistors in these patterns.
C++ example to poll the switch and take some action. In this example latch an LED.
C++ example to act on a switch press via an interrupt. In this example latch an LED.
How to add a reset switch to the Pico.
Section Summary.
Review types of Rotary Encoders
Connecting to RP2040
Software strategy: Polling
Review types of rotary encoders, though this course, will focus on mechanical rotary encoders.
Circuits for connecting the Rotary Encoder to the Pico.
Rotary Encoder uses two channels A and B to allow the detection of Clockwise and Counterclockwise motion. We need to understand these signal before we consider the software.
An example of using a polling strategy to read the Rotary Encoder and act on rotations. Moving the illuminated LED on the LED RIng around the ring based on the Rotary Encoder movement.
Section Summary
Review types of PIR
Connecting to RP2040
Software strategy
This course focuses on the HC-SR501 but in this lecture considers some alternatives.
Connecting the HC-SR501 PIR module to the Pico.
C++ Example to turn on the LED when the PIR detects motion.
C++ Example to turn on the LED when the PIR detects motion and remains active for 10 seconds following the last detect event.
Section Summary.
Build the Big Project
Rotary Encoder configured Animations
PIR Activated Animations
Extend as an assignment by adding speed control
The project is centrally about displaying animation sequences on the LED ring. Instead of just displaying these in the sequence we will now allow the animation to be selected through the rotary encoder.
Introduce the components and connections in the schematic and on the breadboard.
C++ Example of the three animations and using the Rotary Encoder to move between them.
Adding the PIR to the example to only turn on the LED Ring when someone is in the room.
Section Summary
Congratulations on completing the course. Thank you for taking part and please do leave me a review.
The Raspberry PI Pico is a cheap microcontroller (RP2040) board ideal for embedded projects be they commercial or hobby. Its sister board to the Pico W now adding WIFI, allowing IoT projects to be built.
In this course, you will learn about building projects for the Pico or Pico W in C++. We learn about common components, how to connect them to the Pico and build programs to effectively use them. The course covers:
·LED and RGB LEDs
·WS2812B LEDs and a 12 LED Ring
·Switches
·Rotary Encoders
·HC-SR501 PIR Module
Bringing all of these components together into a project that can animate patterns on the LED Ring. You can select the pattern, colour and speed of the animation using the Rotary Encoder.
The course looks at hardware electronics and software separately. People are often more comfortable with one of these than the other. Separating them allows you to skim through the bits you are comfortable with and take your time where you are not.
The course is suitable for those with very little electronics knowledge. Basic C++ knowledge is assumed as the course will not teach syntax, though will explain what the code is doing.
The course follows the knowledge my students would have gained in the Introduction to C Development Environment for Raspberry PICO course on Udemy. I will assume that you have a development environment setup and can compile C or C++ code for the Pico and copy the binary over onto the Pico to run. If you don’t feel confident with that, please do take my introductory course as that will set you up for this one.
The course includes all the code examples and my answers to the assignment problems. I also provide recommendations for further reading on each of the topics. So everything you need to start developing for the Pico and keep going.