A beginner-friendly electronics project for students
🧠 What You’ll Learn
What a 7-segment display is
How to control it using Raspberry Pi Pico
How to display numbers from 0 to 9
How to write and run MicroPython code
Basic GPIO and coding skills
🧰 Materials Required
Item
Quantity
Raspberry Pi Pico
1
Breadboard
1
7-Segment Common Cathode Display
1
Jumper Wires
10+
Resistors (220Ω recommended)
8
USB Cable for Pico
1
Computer with Thonny IDE
1
🔎 What is a 7-Segment Display?
A 7-segment display is an electronic component made up of 7 LEDs arranged to form digits. Each segment is labeled a–g, and an optional dot (dp) can be used too.
There are two types:
Common Cathode (CC): All LEDs share ground, and a segment turns ON with a HIGH signal (1).
Common Anode (CA): All LEDs share VCC, and a segment turns ON with a LOW signal (0).
👉 In this project, we’re using a Common Cathode display.
🔌 Wiring Diagram
Here’s how you connect the Pico to the 7-segment display:
Segment
GPIO Pin (Pico)
a
GP0
b
GP1
c
GP2
d
GP3
e
GP4
f
GP5
g
GP6
dp
GP7
COM
GND
ℹ️ Use resistors (220Ω) between each GPIO and segment pin to limit current and protect your board.
🔢 Single-Digit 7-Segment Display Counter with Raspberry Pi Pico
💻 MicroPython Code (Single-Digit Counter)
Open Thonny IDE, connect your Pico, and paste this code:
segments[0].value(1) # Turn ON Pin 0 segments[1].value(1) # Turn ON Pin 1 segments[2].value(1) # Turn ON Pin 2 segments[3].value(1) # Turn ON Pin 3 segments[4].value(0) # Turn OFF Pin 4 segments[5].value(0) # Turn OFF Pin 5 segments[6].value(1) # Turn ON Pin 6 segments[7].value(0) # Turn OFF Pin 7
✨ So,
The line seg.value(val) is just a short and smart way to run all these .value() commands one by one for each segment.
🧪 Try This
Change utime.sleep(1) to 0.5 to make it faster.
Modify the segment patterns to show letters like A, b, C, E, F.
Add a push-button to control the number manually.
🧰 Troubleshooting Tips
Problem
Solution
Segments not lighting
Check wiring and pin numbers
Wrong number showing
Double-check your segment order and patterns
Display too dim
Try powering Pico from USB or use lower resistors
🎯 Conclusion
This single-digit counter project is a great introduction to microcontrollers, digital displays, and MicroPython programming. Once you’re confident, you can expand this into:
An easy electronics project for students 🧠 What You’ll Learn 🧰 Materials Required Item Quantity Raspberry Pi Pico 1 Breadboard 1 2 x 7-Segment Common Cathode Display 1 Jumper wires (Male–Male) 20+ Resistors (220Ω) 8 (optional but recommended) USB cable for Pico 1 Computer with Thonny IDE 1 🔎 What is a 7-Segment Display? A…