Introduction: Seven Segment Display : Rasberry Pi Pico WH With Arduino IDE
In this project, a simple display circuit was built using a Raspberry Pi Pico WH board, a common-anode 7-segment display, and a few basic electronic components. The display cycles through the digits from 0 to 9, updating the value every second.
This setup helps beginners learn how to control multiple digital output pins on the Pico WH and understand how to activate each segment of the 7-segment display independently.
------------------------------------------------------------------------------------------
Dans ce projet, un circuit d’affichage simple a été réalisé en utilisant une carte Raspberry Pi Pico WH, un afficheur 7 segments à anode commune et quelques composants électroniques. L’afficheur fait défiler successivement les chiffres de 0 à 9, en changeant de valeur chaque seconde.
Ce montage permet aux débutants de comprendre comment contrôler plusieurs sorties numériques du Pico WH et comment activer individuellement les différents segments de l’afficheur.
Supplies
-----------------------------------------------------------------------
- Raspberry Pi Pico WH development board
- USB-A to Micro-USB cable
- Breadboard
- 5161BS Common Anode 7-Segment Display
- Seven 220 Ohm resistors
- Jumper wires
-----------------------------------------------------------------------
- Carte de développement Raspberry Pi Pico WH
- Câble USB-A vers micro-USB
- Platine d'essai
- Afficheur 7-segments à anode commune 5161BS
- Sept résistances de 220 Ohm
- Fils de connexion
----------------------------------------------------------------------
Step 1: Common Anode 7-Segment Display / L’afficheur 7 Segments À Anode Commune
A common-anode 7-segment display is an electronic component made of seven LEDs (segments a, b, c, d, e, f, g) arranged in the shape of the digit “8”.
In a common-anode model, all LED anodes are connected together to the +3.3 V supply.
To turn on a segment, a LOW voltage level (0 V) must be applied to its cathode. This allows current to flow from +3.3 V through the LED, lighting it up.
In the wiring used here, each segment is represented by an individual LED.
The seven segments a to g are connected to the Raspberry Pi Pico WH pins as follows:
- a → pin 20
- b → pin 19
- c → pin 16
- d → pin 17
- e → pin 18
- f → pin 21
- g → pin 22
------------------------------------------------------------------------------------------
Un afficheur 7 segments à anode commune est un composant électronique composé de sept LED (segments a, b, c, d, e, f, g) disposées de manière à afficher les chiffres de 0 à 9.
Dans un modèle à anode commune, toutes les anodes des segments sont reliées ensemble au +3.3 V.
Pour allumer un segment, il faut appliquer un niveau bas (0 V) sur sa cathode : le courant circule du +3.3 V vers la broche du segment, ce qui éclaire la LED.
Dans le câblage utilisé ici, chaque segment est remplacé par une LED individuelle.
Les segments a à g sont connectés aux broches de Raspberry Pi Pico WH selon les correspondances suivantes :
- a → pin 20
- b → pin 19
- c → pin 16
- d → pin 17
- e → pin 18
- f → pin 21
- g → pin 22
Step 2: Circuit Diagram / Schéma
The circuit diagram is made using : thttps://www.wokwi.com/
------------------------------------------------------------------------------------------
Le schéma est réalisé via : thttps://www.wokwi.com/
Step 3: Powering the 7-segment Display / Alimentation De L’afficheur 7 Segments
Why I Powered the Common Anode Display with 3.3V (Raspberry Pi Pico WH)?
The Raspberry Pi Pico WH, just like many modern microcontrollers, uses 3.3V logic on its GPIO pins. For this reason, the safest and most compatible option is to power the common anode of the 7-segment display directly with 3.3V instead of 5V.
If the display were powered at 5V, each GPIO pin of the Pico WH would have to pull the segment down from 5V to 0V to turn it on. This would expose the pins to a voltage higher than they are designed to handle, potentially causing unstable behavior, excessive current, or even permanent damage to the microcontroller.
By powering the display at 3.3V, the Pico WH can drive each segment safely and directly, without the need for level shifters, transistors, or external driver chips. The brightness may be slightly lower compared to a 5V supply, but the wiring becomes simpler, safer, and perfectly matched to the Pico WH's 3.3V GPIO logic.
------------------------------------------------------------------------------------------
Pourquoi j’alimente l’afficheur à anode commune en 3,3 V (Raspberry Pi Pico WH) ?
Le Raspberry Pi Pico WH utilise des broches GPIO en logique 3,3 V, ce qui fait de l’alimentation de l’anode commune en 3,3 V la solution la plus sûre et la plus compatible.
Si l’afficheur était alimenté en 5 V, les broches du Pico WH devraient ramener chaque segment de 5 V à 0 V pour l’allumer. Cela exposerait les GPIO à une tension supérieure à ce qu’ils peuvent supporter, pouvant provoquer des comportements instables, une consommation excessive ou même endommager la carte.
En alimentant l’afficheur en 3,3 V, le Pico WH peut commander chaque segment directement, sans convertisseurs de niveau, sans transistors et sans CI pilote. La luminosité sera un peu plus faible qu’en 5 V, mais le montage devient plus simple, plus sûr et parfaitement compatible avec la logique 3,3 V du Pico WH.
Step 4: Installing Raspberry Pi Pico WH in Arduino IDE / Installation Du Raspberry Pi Pico WH Dans L'IDE Arduino
1- Open Arduino IDE, then go to File> Preferences
2- Enter the following into the “Additional Board Manager URLs” field:
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
Note: if you already have the ESP32 board URL, you can separate the URLs with a comma.
Then, click the “OK” button.
-------------------------------------------------------------------------------------------
1- Ouvrir l’Arduino IDE, puis va dans File> Preferences.
2- Dans le champ “Additional Board Manager URLs”, saisir l’adresse suivante :
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
Remarque: Si vous avez déjà l’URL de la carte ESP32, vous pouvez séparer les URLs par une virgule.
Ensuite, cliquer sur le bouton "OK".
Step 5: Libraries / Bibliothèques
1- Open Arduino IDE, then go to Tools > Board > Boards Manager , search for "Raspberry Pi Pico" in the Boards Manager window, and install the "Raspberry Pi Pico/RP2040/RP2350" package by Earle Philhower .
2- Once the installation is complete, add and select the Raspberry Pi Pico board you are using from the Tools > Boards menu.
3- Go to Tools > Port, and select the port corresponding to your board.
-------------------------------------------------------------------------------------------
1- Ouvrez l’Arduino IDE, puis allez dans ools > Board > Boards Manager . Dans la fenêtre du gestionnaire de cartes, recherchez "Raspberry Pi Pico" et installez le paquet "Raspberry Pi Pico/RP2040/RP2350" de Earle Philhower.
2- Une fois l’installation terminée, ajoutez et sélectionnez la carte Raspberry Pi Pico que vous utilisez dans le menu Tools > Boards.
3- Allez dans Tools > Port, puis choisissez le port correspondant à ta carte.
Step 6: Source Code / Code Source
You can find the full source code below, and you also have the option to simulate your program directly here. This allows you to test and understand how it works before running it on your actual Raspberry Pi Pico WH.
https://wokwi.com/projects/449328919260607489
-------------------------------------------------------------------------------------------
Vous trouverez le code source complet ci-dessous, et vous avez également la possibilité de simuler votre programme directement ici. Cela vous permet de tester et de comprendre son fonctionnement avant de l’exécuter sur votre Raspberry Pi Pico WH réel.





