Third party cookies may be stored when visiting this site. Please see the cookie information.
PenguinTutor YouTube Channel

Book: Learn Electronics with Raspberry Pi (Second Edition)

This is the second edition of the book. My first book sold well and was even translated into Chinese. This new edition is a significant rewrite, bringing it up-to-date, but also improving the educational style, adding more projects and a new chapter on understanding Digital Logic Circuits.

Book - Learn Electronics with Raspberry Pi by Stewart Watkiss

The book provides a fun way to learn electronics and physical computing using a Raspberry Pi and electronic components. It is designed for beginners to intermediate makers starting with Scratch, developing further with Python gpiozero and even covering how to design your own circuit and have it made as a custom PCB.

When coming up with ideas for the book it started out as a projects book, but then I thought it would be useful for it to be educational rather than just covering projects. I added descriptions on how the projects worked and how to design your own projects, but it was mainly centered around projects. In this second edition I've been able to develop that further and provide more structure. In doing so I've expanded on the existing chapters and added new ones such as how different kinds of motors work. As well as explaining DC motors as I did before, it now also covers servo motors and stepper motors which are popular for use in electronic circuits. I also expanded the robots section to include some new robots that are now on the market including the STS-Pi robot, a tank robot and a mecanum wheel based robot that I 3D printed.

Here is a quick introduction to the main focus for each of the chapters.

Chapter 1 - Getting Started with Electronic Circuits

Basics on creating an electronic circuit. Create a circuit using crocodile clips (alligator clips) and breadboards. Make simple circuits using batteries, buzzers and switches.

Chapter 2 - All About Raspberry Pi

Understanding the Raspberry Pi, Raspberry Pi OS and how it can be interfaced with electronics through the GPIO pins.

How to setup your Raspberry Pi ready for the future projects.

Chapter 3 - Starting with the Basics: Programming with Scratch

Controlling simple electronic circuits using Scratch. Adding an LED and switches and creating a Robot Soccer game.

Chapter 4 - Using Python for Input and Output with gpiozero

Using the Mu editor to create programs in Python. Using transistors to increase the current. Learning about schematic diagrams and switching larger loads using darlington transistors and MOSFETS. This includes switching large loads including Disco lights.

Related project:

Chapter 5 - PIR, light and infrared remote control

Covering various aspects to do with light and infrared. Detecting light levels and knowing when someone is near using a PIR sensor. How to send infrared signals to control other devices.

Related videos:

Chapter 6 - Interfacing with Other Devices

Interfacing with other devices using level-shifters, I2C and SPI. Including interfacing with an I2C LCD display to create a True or False Game.

Related videos:

How to convert between analog and digital using an external chip and PWM. How to control a DC motor, servo motor and stepper motor.

Chapter 7 - Adding Control in Python and Linux

Controlling electronics using program code written in Python. How to create light sequences for the disco lights, create network applications to control a model railway using a web browser on a smart phone, and creating a graphical user interface using pygame zero.

Related videos:

Chapter 8 - Using the Raspberry Pi Camera

How to connect the Raspberry Pi camera to take images. It includes an automatic camera using PIR and how to create stop animation videos using a camera controlled by an external switch. It also includes a pan and tilt camera so that you can control the direction of the camera.

Chapter 9 - Rolling Forwards: Designing and Building a Robot

Design and build your own roving robot. Using commercial chassis or design your own for 3D printing. It also includes a robot based around mecanum wheels which allows it to move in every direction (even sideways). Control the robots using a keyboard, a games controller, or let it find it's own way using ultrasonic sensor for collision avoidance.

Related videos:

Chapter 10 - Customize your Gameplay: Minecraft Hardware Programming

Create your own arcade style games console and use it to interact with Minecraft.

Chapter 11 - Understanding Digital Logic

Learn about digital electronics by understanding logic gates. This is a new chapter that explains how basic logic gates work and how they can be used as building blocks for more complicated circuits. Understand flip-flops and how the can be combined to make memory latches and shift registers. Create a 7-segment LED display using shift registers.

Related videos:

Chapter 12 - Making Your Circuits Permanent

Learn about soldering and how to create circuits on stripboard or prototyping boards. Also learn about test tools including a multimeter and a computer based oscilliscope.

Related videos:

Chapter 13 - Let the Innovation Begin: Designing Your Own Circuits

Learn how to combine the different circuits and components together and design your own circuits. Use Fritzing to create a schematic diagram and then make that into a PCB design to create your own custom circuit boards.

After following through the book you should have learnt enough skills to continue your journey through learning electronics and physical computing using the Raspberry Pi.

The main area that I've added is a new chapter on digital electronics based around understanding logic gates. Whilst it's now rare to use logic gate ICs to create circuits, they form the basis of all digital electronics. As such I thought it was important to explain this including how flip-flops work and then how they can be used to make latches, registers and a shift register. This is used to create a project using 7-segment LED displays with data sent serially from the Raspberry Pi stored in a shift-register.

You can buy the book directly from the publisher Apress, or from your favourite book supplier. The ISBN for the softcover version is: 978-1-4842-6347-1 or click the link below to go to the Apress website. The Apress website also links to the github site where the source code for the projects is included.

Buy the book

You can buy the book direct from Apress. Or from other book sellers. If ordering from an independant seller then quote ISBN 978-1-4842-5649-7.

If you do order through Amazon then please leave a review and let me know what you think. It's very useful to have feedback when working on future books.

I've already covered some of the projects on the PenguinTutor YouTube channel and I'll be adding some more videos soon, so please subscribe to my channel if you haven't already.

Other books

Future projects

I've always working on new projects
To find out about the updates please:
Subscribe to the PenguinTutor YouTube Channel
Follow @penguintutor on Twitter

Previous Beginning Game Programming Book
Beginning Game Programming Book
Next Robots and Robotics
Robots and Robotics