Skip to content

Commit c832f95

Browse files
Merge pull request #3096 from madeline-underwood/ard
Ard
2 parents 8b8ff61 + c980bcb commit c832f95

6 files changed

Lines changed: 16 additions & 15 deletions

File tree

content/learning-paths/embedded-and-microcontrollers/arduino-pico/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Embedded programming with Arduino on the Raspberry Pi Pico
33

44
who_is_this_for: This is an introductory topic for software developers interested in embedded programming.
55
minutes_to_complete: 60
6+
description: Learn how to build a motion-detection device with Raspberry Pi Pico (RP2040 Cortex-M0+) using Arduino IDE, PIR sensors, and interrupt-driven programming on baremetal.
67

78
learning_objectives:
89
- Understand the basics of embedded programming

content/learning-paths/embedded-and-microcontrollers/arduino-pico/app_stack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ layout: "learningpathall"
1212

1313
Application developers will be familiar with this traditional computing stack, whether their target devices are desktops, mobile phones, or the cloud, it would be the same.
1414

15-
![Traditional stack](_images/traditional_stack.png)
15+
![Diagram showing the traditional application computing stack with four layers from bottom to top: hardware, firmware/BIOS, operating system, and application. The firmware layer provides hardware abstraction that allows a single OS image to run on different hardware configurations, a key difference from embedded systems.#center](_images/traditional_stack.png)
1616

1717
## Hardware
1818

content/learning-paths/embedded-and-microcontrollers/arduino-pico/arduino_sketch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ If successful, you should see the LED on your board light up. If you wave your h
246246

247247
You can further check that your code is running properly by opening the `Serial Monitor` from the `Tools` menu of the Arduino IDE. There you should see all of the output messages, including count of detected motion events, coming from your sketch.
248248

249-
![Debug output](_images/output.webp)
249+
![Screenshot of the Arduino IDE Serial Monitor window displaying debug messages from the motion detection sketch. The output shows repeated "Motion detected" messages followed by motion event counts, confirming that the PIR sensor is triggering correctly and the sketch is processing the interrupts.#center](_images/output.webp)
250250

251251
Congratulations! You have successfully programmed your microcontroller and built a working, if simple, smart device.
252252

content/learning-paths/embedded-and-microcontrollers/arduino-pico/arm_embedded.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ layout: "learningpathall"
1212

1313
Now that you know the differences between application and embedded programming, as well as the differences in the hardware and software stack, it's time to take your first steps into embedded software development!
1414

15-
![Arm Embedded stack](_images/embedded_arm_stack.png)
15+
![Diagram showing the typical Arm embedded software stack with three layers: Cortex-M CPU at the bottom hardware layer, Mbed OS RTOS in the middle, and C application code with supporting libraries at the top. This illustrates the standard architecture for Arm microcontroller projects where the RTOS sits directly on hardware without a firmware abstraction layer.#center](_images/embedded_arm_stack.png)
1616

1717
A typical embedded project for Arm devices looks like this. For microcontrollers, you'll have a CPU in the Cortex-M family and, as your RTOS, you'll use something like Mbed OS, which is provided by Arm and used by default in Arm Developer Studio and Keil MDK.
1818

@@ -26,7 +26,7 @@ As you know, these small, cheap, development prototyping boards have been around
2626

2727
But they're so much more than just a toy for making lights flash. They're a really great way to get started with embedded programming!
2828

29-
![Arduino stack](_images/embedded_arduino_stack.png)
29+
![Diagram showing Arduino's simplified embedded stack with Cortex-M0+ CPU at the hardware layer, Arduino core package in the middle providing hardware abstraction, and Arduino sketch written in C++ at the application layer. This shows how Arduino makes embedded development more accessible by hiding low-level hardware details behind the core package.#center](_images/embedded_arduino_stack.png)
3030

3131
The latest generations of Arduino use Arm Cortex-M microprocessors, such as the Cortex-M0+ in the Arduino Nano RP2040, making that more powerful and capable than before, while still providing a very simple and straightforward programming experience.
3232

content/learning-paths/embedded-and-microcontrollers/arduino-pico/embedded_stack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ layout: "learningpathall"
1212

1313
While the embedded computing stack looks similar to an application stack, there are some important differences.
1414

15-
![Embedded stack](_images/embedded_stack.png)
15+
![Diagram showing the embedded computing stack with hardware at the bottom, RTOS in the middle, and application at the top. Unlike traditional application stacks, there is no firmware layer abstracting the hardware, meaning embedded software must be built specifically for the target hardware and include all necessary drivers.#center](_images/embedded_stack.png)
1616

1717
## Hardware
1818

content/learning-paths/embedded-and-microcontrollers/arduino-pico/raspberrypi_pico.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ layout: "learningpathall"
1212

1313
To get started on your first embedded project, you can use a cheap and widely available device: the [Raspberry Pi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/).
1414

15-
![RaspberryPi Pico](_images/raspberry_pi_pico.jpg)
15+
![Photo of a Raspberry Pi Pico development board showing its compact rectangular shape with dual rows of GPIO pins along both edges and a micro-USB port. The board features an RP2040 microcontroller with dual Cortex-M0+ cores, the same chip used in Arduino Nano RP2040, making it compatible with Arduino core packages.#center](_images/raspberry_pi_pico.jpg)
1616

1717
You were probably expecting an Arduino board, rather than a Raspberry Pi board but it turns out that the Arduino core package that supports the Arduino Nano RP2040 will also support the Raspberry Pi Pico, because they use the exact same RP2040 microprocessor. Plus the Pico is less expensive, currently retailing for less than $5 USD (you can also use the Raspberry Pi Pico with other programming environments, such as MicroPython).
1818

1919
## Accessories
2020

2121
For interacting with the physical world you can use two cheap commodity components.
2222

23-
![PIR Sensor](_images/pir-sensor-pinout.png)
23+
![Diagram showing PIR motion sensor pinout with three pins labeled from left to right: VCC for power input, OUT for data signal output that goes high when motion is detected, and GND for ground. Understanding this pinout is essential for wiring the sensor correctly to the Pico's 3.3V power, ground, and GPIO pins.#center](_images/pir-sensor-pinout.png)
2424

2525
First a PIR motion sensor. This sensor reacts to infrared photons emitted by a warm moving object, like a person or animal. The interface is simple, it has one pin for input voltage, one pin for ground to complete the circuit, and a third pin that will have the same voltage as the input pin when motion is detected, and the same voltage as the ground pin when it isn't.
2626

2727

28-
![Electric Buzzer](_images/buzzer-pin-diagram.png.webp)
28+
![Diagram showing piezo-electric buzzer pinout with two terminals: a positive terminal marked with a plus sign that connects to a GPIO pin for signal input, and a negative terminal that connects to ground. When voltage is applied to the positive terminal, the buzzer emits a high-pitched beep to signal motion detection.#center](_images/buzzer-pin-diagram.png.webp)
2929

3030
Second, a very simple electric buzzer. You could get fancy with one of these and make it play different sounds with something called Pulse Width Modulation (PWM) but, for simplicity, you can give it a constant voltage which will result in a high-pitched beeping noise.
3131

32-
![Breadboard](_images/breadboard.jpeg)
32+
![Diagram showing standard solderless breadboard layout with color-coded connection patterns. Holes in each column are connected vertically, while the center divider isolates left and right sides. Power rails along the edges run horizontally for distributing voltage and ground. This layout allows you to connect multiple components to the same Pico pins by plugging wires into holes on the same connected column.#center](_images/breadboard.jpeg)
3333

3434
Finally, you can use a breadboard to connect the components together without having to do any soldering.
3535

@@ -39,39 +39,39 @@ If you're not familiar with a breadboard, the image above shows you how all of t
3939

4040
### Step 1: Seat your Raspberry Pi
4141

42-
![RaspberryPi Pico](_images/pico_on_breadboard.webp)
42+
![Photo showing Raspberry Pi Pico seated on a breadboard with its dual rows of GPIO pins straddling the center divider. This placement ensures that each pin has its own column of connected holes on either side, allowing you to wire components to the Pico's GPIOs without creating short circuits across pins.#center](_images/pico_on_breadboard.webp)
4343

4444
Seat your Raspberry Pi Pico on the breadboard so that its rows of pins sit on either side of the center divider. Make sure that it's firmly pressed all the way down but be careful not to bend any of the pins.
4545

4646
### Step 2: PIR ground
4747

48-
![PIR ground](_images/pir_sensor_1.webp)
48+
![Photo showing a black jumper wire connecting the PIR sensor's ground pin to physical pin 38 on the Raspberry Pi Pico. Pin 38 is one of the Pico's ground pins that completes the circuit for powering the PIR sensor. Using black wire for ground connections is a common convention that makes circuits easier to troubleshoot.#center](_images/pir_sensor_1.webp)
4949

5050
Using a black jumper wire, connect the ground pin of your PIR sensor to pin #38 on your Pico. This pin is a ground voltage pin on the Pico.
5151

5252
### Step 3: PIR input voltage
5353

54-
![PIR voltage](_images/pir_sensor_2.webp)
54+
![Photo showing a red jumper wire connecting the PIR sensor's VCC power pin to physical pin 36 on the Raspberry Pi Pico. Pin 36 provides 3.3V output to power the PIR sensor. Using red wire for voltage connections follows standard wiring conventions and helps distinguish power connections from ground and signal lines.#center](_images/pir_sensor_2.webp)
5555

5656
Using a red wire, connect the input voltage pin of your PIR sensor to pin #36 on your Pico. This pin is a 3.3 volt pin on the Pico and will supply power to your PIR sensor.
5757

5858
### Step 4: PIR data
5959

60-
![PIR data](_images/pir_sensor_3.webp)
60+
![Photo showing a jumper wire connecting the PIR sensor's data output pin to physical pin 34 on the Raspberry Pi Pico. This pin corresponds to GPIO 28, which your code will monitor to detect when the PIR sensor signals motion. Note the distinction between physical pin numbering and GPIO numbering, which is important when writing your Arduino sketch.#center](_images/pir_sensor_3.webp)
6161

6262
The last step to connecting the PIR sensor is to connect the middle data pin to pin #34 on your Pico. This is a GPIO pin that you can use to either read or write data.
6363

6464
Note that this is GPIO #28, even though it's physical pin #34. Physical pin number and GPIO numbers are not the same.
6565

6666
### Step 5: Buzzer ground
6767

68-
![Buzzer ground](_images/piezo_1.webp)
68+
![Photo showing a jumper wire connecting the piezo-electric buzzer's negative terminal to physical pin 23 on the Raspberry Pi Pico. Pin 23 is a ground pin that completes the buzzer circuit. With both ground and power connections in place, the buzzer will emit a tone when the GPIO pin provides voltage to signal detected motion.#center](_images/piezo_1.webp)
6969

7070
Next, it's time to connect the buzzer. Start by connecting the buzzer's ground pin to pin #23 on your Pico. This is another ground pin that is build into your board.
7171

7272
### Step 6: Buzzer input
7373

74-
![Buzzer input](_images/piezo_2.webp)
74+
![Photo showing a jumper wire connecting the piezo-electric buzzer's positive terminal to physical pin 25 on the Raspberry Pi Pico. This pin corresponds to GPIO 19, which your Arduino code will control to trigger the buzzer when motion is detected. By setting this GPIO pin high, you provide voltage that causes the piezo element to vibrate and emit a beep.#center](_images/piezo_2.webp)
7575

7676
Then, connect the buzzer's input pin to pin #25 on your Pico. This is another GPIO pin, this time GPIO #19.
7777

0 commit comments

Comments
 (0)