You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/arduino-pico/_index.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ title: Embedded programming with Arduino on the Raspberry Pi Pico
3
3
4
4
who_is_this_for: This is an introductory topic for software developers interested in embedded programming.
5
5
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.
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/arduino-pico/app_stack.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ layout: "learningpathall"
12
12
13
13
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.

Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/arduino-pico/arduino_sketch.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,7 +246,7 @@ If successful, you should see the LED on your board light up. If you wave your h
246
246
247
247
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.
248
248
249
-

249
+

250
250
251
251
Congratulations! You have successfully programmed your microcontroller and built a working, if simple, smart device.
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/arduino-pico/arm_embedded.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ layout: "learningpathall"
12
12
13
13
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!

16
16
17
17
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.
18
18
@@ -26,7 +26,7 @@ As you know, these small, cheap, development prototyping boards have been around
26
26
27
27
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!

30
30
31
31
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.
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/arduino-pico/embedded_stack.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ layout: "learningpathall"
12
12
13
13
While the embedded computing stack looks similar to an application stack, there are some important differences.
14
14
15
-

15
+

Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/arduino-pico/raspberrypi_pico.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,24 +12,24 @@ layout: "learningpathall"
12
12
13
13
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/).

16
16
17
17
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).
18
18
19
19
## Accessories
20
20
21
21
For interacting with the physical world you can use two cheap commodity components.
22
22
23
-

23
+

24
24
25
25
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.

29
29
30
30
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.
31
31
32
-

32
+

33
33
34
34
Finally, you can use a breadboard to connect the components together without having to do any soldering.
35
35
@@ -39,39 +39,39 @@ If you're not familiar with a breadboard, the image above shows you how all of t

43
43
44
44
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.
45
45
46
46
### Step 2: PIR ground
47
47
48
-

48
+

49
49
50
50
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.
51
51
52
52
### Step 3: PIR input voltage
53
53
54
-

54
+

55
55
56
56
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.
57
57
58
58
### Step 4: PIR data
59
59
60
-

60
+

61
61
62
62
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.
63
63
64
64
Note that this is GPIO #28, even though it's physical pin #34. Physical pin number and GPIO numbers are not the same.
65
65
66
66
### Step 5: Buzzer ground
67
67
68
-

68
+

69
69
70
70
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.
71
71
72
72
### Step 6: Buzzer input
73
73
74
-

74
+

75
75
76
76
Then, connect the buzzer's input pin to pin #25 on your Pico. This is another GPIO pin, this time GPIO #19.
0 commit comments