- Where does the name Raspberry Pi come from?
Eben Upton: Raspberry is a reference to a fruit naming tradition in the old days of microcomputers. A lot of computer companies were named after fruit. There's Tangerine Computer Systems, Apricot Computers, and the old British company Acorn, which is a family of fruit. Pi is because originally we were going to produce a computer that could only really run Python. So the Pi in there is for Python. Now you can run Python on the Raspberry Pi but the design we ended up going with is much more capable than the original we thought of, so it's kind of outlived its name a little bit.
- Microprocessor
- ARM architecture
- RISC (Reduced instruction set computer)
- Assembly language
- Microcomputer
- Single-board computer (SBC)
- Integrated development environment (IDE)
- Comparison of integrated development environments
- Fritzing
- Raspberry Pi
- Free Software Foundation (FSF)
- GNU
- GNU Project
- GNU General Public License (GPL)
- GNU nano text editor
- List of compilers
- GNU Compiler Collection (GCC)
- Clang
- LLVM (low level virtual machine)
- mold
- List of operating systems
- Robot Operating System (ROS)
- Debian
- Debian logos
- Ubuntu
- APT (Advanced Package Tool)
- LXDE
- General-purpose input/output (GPIO)
- Breadboard
- Antistatic bag
- Sensor
- Actuator
- Serial communication
- Serial peripheral interface (SPI)
- Master/slave
- Inclusive language
- Chip select
- Main/microcontroller in secondary/sensor out (MISO)
- Main/microcontroller out secondary/sensor in (MOSI)
- Serial clock (SCLK)
- Chip enable (CE0/CE1)
- Inter-integrated circuit (I2C, I2C, or IIC)
- Serial data line (SDA)
- Serial clock line (SCL)
- 1-Wire
- Data input/output (DQ)
- Light-emitting diode (LED)
- Universal Serial Bus (USB)
- Webcam
- Microphone
1. Open a GNOME Terminal on macOS/Linux, Windows Terminal, or Git for Windows, run SSH to login Raspberry Pi, and make sure Raspberry Pi Serial Console is disabled
$ sudo nano /boot/cmdline.txt
- Delete "console=serial0,115200" if found
- Save the file with control-x y enter
$ sudo reboot
2. Serial loopback test
- Connect two serial pins (the 4th and 5th pins from the left of the top row) using one jump wires
- Run APT to install Minicom
$ sudo apt update
$ sudo apt install minicom
$ man minicom
$ minicom -b 115200 -o -D /dev/ttyS0
- Enable new line
control-a a
hello
- Enable echo
control-a e
hheelllloo
- Exit Minicom
control-a x
- Connect TX of a Raspberry Pi to RX of the other Raspberry Pi
- Connect RX of a Raspberry Pi to TX of the other Raspberry Pi
- Connect GND of both Raspberry Pi's
$ minicom -b 115200 -o -D /dev/ttyS0
- Enable new line and echo
control-a a
control-a e
hello
- Exit Minicom
control-a x
- Connect the SPI MOSI and MISO pins (the 10th and 11th pins from the left of the bottom row) using one jump wire
- Enter the following commands on a Terminal for spidev-test
- An alternative spidev-test
$ wget https://raw.githubusercontent.com/raspberrypi/linux/rpi-3.10.y/Documentation/spi/spidev_test.c
$ gcc -o spidev_test spidev_test.c
$ ./spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)
FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D
- Remove the jump wire and run spidev_test again
$ ./spidev_test -D /dev/spidev0.0
spi mode: 4
bits per word: 8
max speed: 500000 Hz (500 KHz)
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00 00 00 00 00
00 00
1. Shorter lead (−) of the LED to a 330-Ω resistor then to Ground, the 3rd pin from the left of the top row
pi@raspberypi:~ $ sudo su
root@raspberypi:/home/pi# echo 18 > /sys/class/gpio/export
root@raspberypi:/home/pi# cd /sys/class/gpio/gpio18
root@raspberypi:/sys/class/gpio/gpio18# echo out > direction
root@raspberypi:/sys/class/gpio/gpio18# echo 1 > value
root@raspberypi:/sys/class/gpio/gpio18# echo 0 > value
root@raspberypi:/sys/class/gpio/gpio18# cd /home/pi
root@raspberypi:/home/pi# echo 18 > /sys/class/gpio/unexport
root@raspberypi:/home/pi# exit
- Test I2C addresses with the preinstalled i2c-tools
- Connect an I2C device ADXL345 (3-axis accelerometer) to 3V3, GND, SDA, and SCL of a Raspberry Pi with two 4.7kΩ pull-up resistors
$ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
- Connect an I2C device BMP180 or BMP280 (barometric pressure sensor) to 3V3, GND, SDA, and SCL of a Raspberry Pi
$ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77
Connect a DS18B20 temperature sensor to Raspberry Pi as follows:
IC power-supply pin of BJT (bipolar junction transistor) and FET (field-effect transistor)
- GND to GND
- VDD to 3.3V or 5V
- DQ to GPIO 4 (the 4th pin from the left of the bottom row) and through a 4.7kΩ resistor to VDD
pi@raspberrypi:~ $ sudo modprobe w1-gpio
pi@raspberrypi:~ $ sudo modprobe w1-therm
pi@raspberrypi:~ $ cd /sys/bus/w1/devices
pi@raspberrypi:/sys/bus/w1/devices $ ls
28-0000064dc293 w1_bus_master1
pi@raspberrypi:/sys/bus/w1/devices $ cd 28*
pi@raspberrypi:/sys/bus/w1/devices/28-0000064dc293 $ cat w1_slave
8f 01 4b 46 7f ff 01 10 14 : crc=14 YES
8f 01 4b 46 7f ff 01 10 14 t=24937
pi@raspberrypi:/sys/bus/w1/devices/28-0000064dc293 $ cd
pi@raspberrypi:~ $
Connect a USB webcam to Raspberry Pi, install fswebcam, and save images:
$ sudo apt update
$ sudo apt install fswebcam
$ fswebcam image.jpg
$ fswebcam -r 1280x720 image2.jpg
$ fswebcam -r 1280x720 --no-banner image3.jpg
$ man arecord
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
$ arecord --device=hw:1,0 --format S16_LE --rate 44100 -c1 test.wav
control-c
$ aplay test.wav