SunFounder Thales Kit User manual

SunFounder Thales Kit for Raspberry
Pi Pico
Release 1.0
Jimmy, SunFounder
Jun 04, 2021


CONTENTS
1 Introduction to Raspberry Pi Pico 3
1.1 Features .................................................. 3
1.2 Pico’s Pins ................................................ 4
2 What is Included in This Kit 7
2.1 Components List ............................................. 9
2.2 Components Introduction ........................................ 10
3 For MicroPython User 39
3.1 Geting Started with MicroPython .................................... 39
3.2 Thonny Python IDE ........................................... 42
3.3 Your First MicroPython Program .................................... 45
3.4 Projects .................................................. 49
3.5 MicroPython Basic Syntax ........................................ 109
4 For Arduino User 137
4.1 Getting Started with Arduino ...................................... 137
4.2 Projects .................................................. 143
5 FAQ 161
5.1 Q1: NO MicroPython(Raspberry Pi Pico) Interpreter Option on Thonny IDE? ............. 161
5.2 Q2: Cannot open Pico code or save code to Pico via Thonny IDE? ................... 162
5.3 Q3: Can Raspberry Pi Pico be used on Thonny and Arduino at the same time? ............ 162
5.4 Q4: Code upload failed in Arduino IDE? ................................ 162
6 Copyright Notice 163
i

ii

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
SunFounder Thales Kit is a basic learning kit based on Raspberry Pi Pico.
The kit contains various types of components, such as displays, sounds, drivers, controllers, and sensors, allows you
to learn electronic devices comprehensively.
we have prepared many interesting and practical projects for you, and collected a lot of authoritative related informa-
tion, just turn on your computer and you can complete programming learning in one stop.
In addition, we provide 2 programming languages: MicroPython and Arduino (C/C++). You can view different
tutorials according to your needs
If you want to learn another projects which we don’t have, please feel free to send Email and we will update to our
online tutorials as soon as possible, any suggestions are welcomed.
Here is the Email: cs@sunfounder.com.
CONTENTS 1

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
2 CONTENTS

CHAPTER
ONE
INTRODUCTION TO RASPBERRY PI PICO
The Raspberry Pi Pico is a microcontroller board based on the Raspberry Pi RP2040 microcontroller chip.
Whether you want to learn the MicroPython programming language, take the first step in physical computing, or want
to build a hardware project, Raspberry Pi Pico – and its amazing community – will support you every step of the way.
In the project, it can control anything, from LEDs and buttons to sensors, motors, and even other microcontrollers.
1.1 Features
• 21 mm × 51 mm form factor
• RP2040 microcontroller chip designed by Raspberry Pi in the UK
• Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz
• 264KB on-chip SRAM
• 2MB on-board QSPI Flash
• 26 multifunction GPIO pins, including 3 analog inputs
• 2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels
• 1 × USB 1.1 controller and PHY, with host and device support
3

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
• 8 × Programmable I/O (PIO) state machines for custom peripheral support
• Supported input power 1.8–5.5V DC
• Operating temperature -20°C to +85°C
• Castellated module allows soldering direct to carrier boards
• Drag-and-drop programming using mass storage over USB
• Low-power sleep and dormant modes
• Accurate on-chip clock
• Temperature sensor
• Accelerated integer and floating-point libraries on-chip
1.2 Pico’s Pins
Name Description Function
GP0-GP28 General-purpose input/output
pins
Act as either input or output and have no fixed purpose of their
own
GND 0 volts ground Several GND pins around Pico to make wiring easier.
RUN Enables or diables your Pico Start and stop your Pico from another microcontroller.
GPxx_ADCx General-purpose input/output
or analog input
Used as an analog input as well as a digital input or output –
but not both at the same time.
ADC_VREF Analog-to-digital converter
(ADC) voltage reference
A special input pin which sets a reference voltage for any ana-
log inputs.
AGND Analog-to-digital converter
(ADC) 0 volts ground
A special ground connection for use with the ADC_VREF pin.
3V3(O) 3.3 volts power A source of 3.3V power, the same voltage your Pico runs at
internally, generated from the VSYS input.
3v3(E) Enables or disables the power Switch on or off the 3V3(O) power, can also switches your
Pico off.
VSYS 2-5 volts power A pin directly connected to your Pico’s internal power supply,
which cannot be switched off without also switching Pico off.
VBUS 5 volts power A source of 5V power taken from your Pico’s micro USB port,
and used to power hardware which needs more than 3.3V.
4 Chapter 1. Introduction to Raspberry Pi Pico

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
The best place to find everything you need to get started with your Raspberry Pi Pico is here
Or you can click on the links below:
•Raspberry Pi Pico product brief
•Raspberry Pi Pico datasheet
•Getting started with Raspberry Pi Pico: C/C++ development
•Raspberry Pi Pico C/C++ SDK
•API-level Doxygen documentation for the Raspberry Pi Pico C/C++ SDK
•Raspberry Pi Pico Python SDK
•Raspberry Pi RP2040 datasheet
•Hardware design with RP2040
•Raspberry Pi Pico design files
•Raspberry Pi Pico STEP file
1.2. Pico’s Pins 5

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
6 Chapter 1. Introduction to Raspberry Pi Pico

CHAPTER
TWO
WHAT IS INCLUDED IN THIS KIT
The following is a list of this kit, after you receive the goods, you can check the contents of the list first.
Some of the components on the kit are very small and look the same, the worker may omit or send it wrong when
packing. Please do not hesitate to send us the picture of the kit and the names of the missing or wrong components via
email.
Here is the Email: cs@sunfounder.com.
7

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
8 Chapter 2. What is Included in This Kit

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
2.1 Components List
2.1. Components List 9

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
2.2 Components Introduction
2.2.1 Breadboard
A breadboard is a construction base for prototyping of electronics. Originally the word referred to a literal bread
board, a polished piece of wood used for slicing bread.[1] In the 1970s the solderless breadboard (a.k.a. plugboard, a
terminal array board) became available and nowadays the term “breadboard” is commonly used to refer to these.
It is used to build and test circuits quickly before finishing any circuit design. And it has many holes into which
components mentioned above can be inserted like ICs and resistors as well as jumper wires. The breadboard allows
you to plug in and remove components easily.
The picture shows the internal structure of a breadboard. Although these holes on the breadboard appear to be inde-
pendent of each other, they are actually connected to each other through metal strips internally.
If you want to know more about breadboard, refer to: How to Use a Breadboard - Science Buddies
Example
Hello, Breadboard!
10 Chapter 2. What is Included in This Kit

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
2.2.2 LED
Semiconductor light-emitting diode is a type of component which can turn electric energy into light energy via PN
junctions. By wavelength, it can be categorized into laser diode, infrared light-emitting diode and visible light-emitting
diode which is usually known as light-emitting diode (LED).
Diode has unidirectional conductivity, so the current flow will be as the arrow indicates in figure circuit symbol. You
can only provide the anode with a positive power and the cathode with a negative. Thus the LED will light up.
An LED has two pins. The longer one is the anode, and shorter one, the cathode. Pay attention not to connect them
inversely. There is fixed forward voltage drop in the LED, so it cannot be connected with the circuit directly because
the supply voltage can outweigh this drop and cause the LED to be burnt. The forward voltage of the red, yellow, and
green LED is 1.8 V and that of the white one is 2.6 V. Most LEDs can withstand a maximum current of 20 mA, so we
need to connect a current limiting resistor in series.
The formula of the resistance value is as follows:
R = (Vsupply – VD)/I
Rstands for the resistance value of the current limiting resistor, Vsupply for voltage supply, VD for voltage drop and
Ifor the working current of the LED.
Here is the detailed introduction for the LED: LED - Wikipedia.
Example
•Hello, Breadboard! (For MicroPython User
•Fading LED (For MicroPython User
2.2. Components Introduction 11

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
•Fading LED (For C/C++(Arduino) User
•Hello LED (For C/C++(Arduino) User
2.2.3 RGB LED
RGB LEDs emit light in various colors. An RGB LED packages three LEDs of red, green, and blue into a transparent
or semitransparent plastic shell. It can display various colors by changing the input voltage of the three pins and
superimpose them, which, according to statistics, can create 16,777,216 different colors.
RGB LEDs can be categorized into common anode and common cathode ones. In this kit, the latter is used. The
common cathode, or CC, means to connect the cathodes of the three LEDs. After you connect it with GND and plug
in the three pins, the LED will flash the corresponding color.
Its circuit symbol is shown as figure.
12 Chapter 2. What is Included in This Kit

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
An RGB LED has 4 pins: the longest one is GND; the others are Red, Green and Blue. Touch its plastic shell and you
will find a cut. The pin closest to the cut is the first pin, marked as Red, then GND, Green and Blue in turn.
2.2. Components Introduction 13

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
Example
Colorful Light
2.2.4 Resistor
Resistor is an electronic element that can limit the branch current. A fixed resistor is a kind of resistor whose resistance
cannot be changed, while that of a potentiometer or a variable resistor can be adjusted.
Two generally used circuit symbols for resistor. Normally, the resistance is marked on it. So if you see these symbols
in a circuit, it stands for a resistor.
is the unit of resistance and the larger units include K, M, etc. Their relationship can be shown as follows: 1 M=1000
K, 1 K = 1000 . Normally, the value of resistance is marked on it.
When using a resistor, we need to know its resistance first. Here are two methods: you can observe the bands on the
resistor, or use a multimeter to measure the resistance. You are recommended to use the first method as it is more
convenient and faster.
14 Chapter 2. What is Included in This Kit

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
As shown in the card, each color stands for a number.
Black Brown Red Orange Yellow Green Blue Violet Grey White Gold Silver
0 1 2 3 4 5 6 7 8 9 0.1 0.01
The 4- and 5-band resistors are frequently used, on which there are 4 and 5 chromatic bands.
Normally, when you get a resistor, you may find it hard to decide which end to start for reading the color. The tip is
that the gap between the 4th and 5th band will be comparatively larger.
2.2. Components Introduction 15

SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
Therefore, you can observe the gap between the two chromatic bands at one end of the resistor; if it’s larger than any
other band gaps, then you can read from the opposite side.
Let’s see how to read the resistance value of a 5-band resistor as shown below.
So for this resistor, the resistance should be read from left to right. The value should be in this format: 1st Band 2nd
Band 3rd Band x 10^Multiplier () and the permissible error is ±Tolerance%. So the resistance value of this resistor is
2(red) 2(red) 0(black) x 10^0(black) = 220 , and the permissible error is ±1% (brown).
You can learn more about resistor from Wiki: Resistor - Wikipedia.
2.2.5 Potentiometer
Potentiometer is also a resistance component with 3 terminals and its resistance value can be adjusted according to
some regular variation.
Potentiometers come in various shapes, sizes, and values, but they all have the following things in common:
• They have three terminals (or connection points).
• They have a knob, screw, or slider that can be moved to vary the resistance between the middle terminal and
either one of the outer terminals.
• The resistance between the middle terminal and either one of the outer terminals varies from 0 to the maximum
resistance of the pot as the knob, screw, or slider is moved.
Here is the circuit symbol of potentiometer.
16 Chapter 2. What is Included in This Kit
Table of contents
Popular Microcontroller manuals by other brands

NXP Semiconductors
NXP Semiconductors S32K324 quick start guide

Energy micro
Energy micro EFM32-G2XX-DK user manual

Dialog Semiconductor
Dialog Semiconductor DA1469 PRO series user manual

Freescale Semiconductor
Freescale Semiconductor MC9S12XE Series Reference manual

Arduino
Arduino ABX00032 Product reference manual

Sino Wealth
Sino Wealth SH79F7416 manual

DAVE
DAVE DIVELK quick start guide

NEC
NEC V850E/CA2 JUPITER Preliminary user's manual

NXP Semiconductors
NXP Semiconductors MCUXpresso SDK user guide

Fujitsu
Fujitsu Cremson Series user manual

Microsemi
Microsemi AcuEdge Development Kit for Amazon AVS... Quick start card

Infineon
Infineon XMC7000 Series quick start guide