Book review – Learn Robotics with Raspberry Pi (by Matt Timmons-Brown)

Sometimes, a book comes along that exceeds your expectations. When I saw that Matt Timmons Brown (“The Raspberry Pi Guy”) had teamed up with No Starch Press and that he had a very well-known and respected (though he’d never admit it) Technical Editor in Jim Darby, my expectations were sky high.

TL;DR – If you want a book on Raspberry Pi robotics, this is an excellent introduction, and much more.

Contents

Following a rather nice foreword from Raspberry Pi’s Eben Upton, the book is split into 8 chapters. They are:

  1. Getting up and running
    All about setting up your Pi and getting to a screen where you can start programming.
  2. Electronics basics
    A great chapter to help you understand basic components, how to light up LEDs, how to read button presses, etc. All basic knowledge for your journey into inputs, outputs and command-and-control.
  3. Building your robot
    Takes you through the physical construction using the components you’ve purchased. This includes making the Raspberry Pi and the robot run from the same power source using a cheap buck converter and running the motors using a cheap motor controller board.
  4. Making your robot move
    Includes sections on rudimentary, autonomous movement along a pre-defined route and, happily, turning your robot into a remote-controlled vehicle using a Wiimote.
  5. Avoiding obstacles
    A section about using an ultrasonic sensor to detect obstacles and autonomously drive away from them.
  6. Customising with lights and sound
    A fun chapter showing how to add LEDs and a speaker to your Raspberry Pi to make your robot more attractive and, well, loud!
  7. Line following
    This is all about using a purchased line detector module to follow a black line autonomously.
  8. Computer vision
    This chapter uses a Raspberry Pi camera module and OpenCV to detect and follow a coloured ball.

There are also appendices with a GPIO diagram, a guide to resistors and welcome tutorials on soldering and how to run code on start-up.

The tone of the book

I want to congratulate Matt and his editors on striking just the right tone with this book. It’s conversational, without being “chummy” and has detailed explanations, without getting so technical that you can’t understand anything.

Layout and quality

Remember those “high expectations” I mentioned earlier? As I said, this is a No Starch Press book, and it’s in full-colour, which really makes the diagrams “pop” out of the page. Congratulations to the publishers for producing a really excellent publication.

Here’s a sample page. You can see the quality I’m talking about:

Does it do what it sets out to do?

TL;DR: Yes.

The chapters of the book are well-ordered and their contents well-structured to take you, step-by-step, through the “bread and butter skills” you need as a robot creator. Each component is explained in detail (but not too much detail, as I said before) so that you learn why things work as well as how they work. In other words, it doesn’t tell you what to do to get something working without first telling you about the basic building blocks to get there. It’s a great approach, although it may prove too much for younger readers without adult guidance. I think that’s fine, though – robotics tends to be something which young people don’t get into until they are aged 11+, by which time the tone and content of the book should be within their grasp, albeit with a lot of concentration.

The remote-control section using a Wiimote is, of course, slightly basic (although it does get into using the on-board accelerometer to change the driving speed) but I’m glad it’s there – it will be something people will want to do.

The “meat” of the book, though, is those autonomous sections – distance sensing, line sensing and object following. These are excellent additions as it pulls you into the basic skills that you will need to take part in something like Pi Wars and also prepares you for taking your skills into professional industry.

Conclusion

This book really is an excellent introduction to Raspberry Pi robotics but is also for people who have built their robot already and want to move into autonomous sensing and movement. It is well-written and very accurate, thanks to Matt’s efforts and Jim’s technical editing and is stunning to look at, thanks to No Starch Press. Bravo to all concerned!

Buying it

In the UK, you can pick it up for around £17 at Amazon.

In the USA, you can pick it up for around $25 from No Starch Press (or Amazon).

Review of the 4tronix Pi2Go Mk 2 – an exquisite Raspberry Pi robot packed with features and fun

Back in 2014, robotics specialist 4tronix released the Pi2Go and the Pi2Go Lite, great robotics kits using PCBs as the robot chassis, surrounding a Raspberry Pi.

Now, 5 years (and many products, including this year’s Pi Wars badge!) later, Gareth has designed the follow-up to the Pi2Go, conveniently called the Pi2Go Mk 2. He sent me one to put together and play with, so here goes.

TL;DR – It’s fabulous, it has everything and costs £72 (inc VAT). Get one from the 4tronix website. You can get 10% off everything at 4tronix by using code 4TXPARTY10.

What’s in the box?

The Pi2Go Mk 2 comes in an attractive retail box and contains all the components you need, apart from a Raspberry Pi (all main, 40-pin models are supported – the Zero is usable if you get yourself some extra spacers), an SD card and some rechargeable AA batteries.

The central piece of the puzzle is the Pi2Go main board. It has all the mounting points for the support structure, the motors etc and also has push-fit headers for the extra bits and pieces. It also houses the DRV8833, a standard motor controller, but a very reliable one.

The other big part of the structure is the battery pack. The battery pack comes in several flavours. The default one that comes with the Pi2Go is for 6 rechargeable AA batteries. There is also an option for 7 AAs to give a bit of extra grunt and also a board for two 18650 rechargeable lithium cells which are more resilient to the current used for the motors and, specifically, for the Raspberry Pi 4 (if that’s what you’re using) which uses more juice.

Bit by bit, step by step, putting it together

I decided to put together my Pi2Go using the 7-battery plate, just because.

A full assembly instruction guide is available on the 4tronix website. I followed the guide to the letter. I got a little confused at one point because there were some extra screws provided, but I soldiered on. Everything fitted together “just so” – I would suggest children who are lacking in fine motor skills would need some assistance, but slightly older children with more control would have no problem. It comes with a screwdriver and a hex-nut tool, which was handy.

I particularly like the little motor mounts that hold the motors/wheels to the assembly. Speaking of which, the included wheels are of a new type – very nice, very grippy. I also liked the way that power is delivered to the main board – through the pillar stand-offs – and I really appreciated that no soldering was involved – I could do the whole thing on the kitchen table without worrying about scorch marks!

In about 45 minutes to an hour I’d built up the robot which looked as below:

Another option available is to convert the base model into a 4-wheel drive vehicle by adding two extra motors and wheels. I’ll no doubt do that later, so for now here’s a picture of the made-up 4-wheel drive robot:

Features

The battery boards all have 10 Neopixel-compatible LEDs (SK6812-3535) on them, all programmable. This is a nice addition – everyone likes blinkies, after all 🙂 It just goes to show how much thought is given by Gareth to his designs. He’s even added an on-off switch for the battery pack, which is very convenient!

The main Pi2Go board has, as I mentioned before, push-fit headers for “extra bits”. These are “edge connectors” and there are three of them. In the pack, you’re given an Ultrasonic sensor breakout and an IP address read-out. These plug in as you can see above. The spare edge connector is a great addition because it’s compatible with the Pimoroni Breakout Garden I2C boards. What a terrific idea, and I would say that the 6DoF Motion Sensor Breakout is the one to go for so that you know how the robot is orientated.

Also on-board the robot are 2 infra-red obstacle sensors (on the front corners), 4 light sensors (on all four corners) and 2 line-follower sensors (tucked under the ball-caster assembly on the front).

Handily, Gareth’s added a tactile switch, which I would suggest should be used to safely shut the Raspberry Pi down, although obviously it has other uses, such as starting a series of robot movements. Other features of the robot include 20-slot encoder wheels attached to the motors (and optical wheel sensors to track them) and also four servo connectors on the side of the robot.

This robot kit really does have everything!

In use

After building the kit, I slipped the SD card in, which I had already set-up with SSH and wifi and switched it on. I knew what the IP address was already (I’d paid attention) and SSH’d in from my laptop. I followed the instructions to install the software. The software is a Python library (Python 2, but one can’t have everything) and a collection of scripts. Most importantly, you get a script pre-installed that starts up on boot that shows the IP address on the plug-in display. Other scripts include demos to control the robot using the cursor keys, using the wheel encoders (and without). The scripts basically go through all the capabilities of the main board, but don’t put it together in “one neat package” for you. This is great, because it encourages you to learn how to do it yourself. Documentation is on this page and on there it shows you how to use all the functions in the library.

You can also use Simon Walters’ ScratchGPIO to program the robot – you’ll need to go to his website to find out more, but it’s great that it has that support already!

The costs

The Pi2Go is currently only available from the 4tronix website and costs £72 (including VAT). You’ll need to add a 40-pin Pi, batteries and an SD card on top of that. You may already have all those, though!

As the robot is compatible with all 40-pin models of Raspberry Pi, if you have a spare original B+ knocking around, that’ll do the job, or you can do what I did and use a Raspberry Pi 3A+ to keep the costs down a bit.

The verdict

I am so impressed. Gareth has greatly improved upon his original, already-great Pi2Go series, added feature upon feature, blinky upon blinky and come up with an awesome product. The PCB chassis concept is as good as it ever was and the no-solder assembly is easy enough to do. The use of the edge connectors is a great idea and the compatibility with Pimoroni’s Breakout Garden is a nice addition, giving lots of scope for expansion. The sheer variety of sensors on-board should provide a lot of learning opportunities and the software, in the way it gives pointers rather than full solutions, is a good accompaniment.

The price is, in my opinion, about right. It’s not a cheap kit but it is a sturdy, well-manufactured robot platform sure to give a lot of joy to whoever buys it. I cannot recommend it highly enough as either an introduction to robotics, or as that next move from a simpler kit.

Get your Pi2Go kit here. Don’t forget: For the time being, you can get 10% off everything at 4tronix by using code 4TXPARTY10.

Marvel fan re-creates the famous E.D.I.T.H. specs from Avengers and Spider-man using a Raspberry Pi Zero

Mike Darby, over at 314Reactor, has carried out an impressive make by re-creating the E.D.I.T.H. glasses from Spider-man Far From Home. If you haven’t seen Avengers: Endgame or Far From Home yet, stop reading and get thee to your nearest screen to check out these wonderful movies. I’ll leave a bit of a gap so that you don’t see anything you don’t want to!

.

.

.

.

.

.

.

.

E.D.I.T.H. (I’m not going to spoil the acronym!) is a set of glasses worn by Tony Stark in Avengers: Endgame and which are eventually given to Spider-man (played by Tom Holland). They carry an artificial intelligence which allows the wearer to control all sorts of Stark Tech and also see an enhanced version of the real world.

Mike Darby has taken a Raspberry Pi Zero, an Adafruit Powerboost, a LiPo battery, a camera and some other bits and pieces and re-created the glasses. The software uses Python and various libraries to do the text-to-speech and information look-ups, including a very nice tie-in to knowledge-provider Wolfram Alpha.

Sure, the glasses a bit bulkier than he would like and, because it’s a single-core Zero, it’s a bit slower than is ideal, but the concept is terrific. Kudos, especially, for the use of necessary Blutack to hold the glasses on his nose! You can find out more about the project by viewing the video below (which is, possibly intentionally, very funny, especially at the beginning, unless that’s just my sense of humour!) and by reading his blog.

New camera module targets A.I. algorithms and is compatible with the Raspberry Pi (and others)

China-based electronics manufacturer DFRobot has just launched a new Kickstarter to fund the HuskyLens, an A.I.-enhanced camera module. Built into the camera circuit is a Kendryte K210 chip, a 400MHz dual core RISC-V 64bit processor which facilitates the following algorithms:

  • Object tracking
  • Facial recognition
  • Object recognition
  • Line tracking
  • Colour recognition
  • Tag recognition

It should be popular with robotics people, especially, as a platform for solving tasks. It has the ability to detect spacial gestures, too, which means that your Minority Report-style interfaces or art projects are possible using the module.

The Kickstarter has a fairly punchy goal of over £18k, but hopefully it’ll get there (as I’ve just backed it myself!).

There are two flavours of camera – a standard, 2 megapixel module and an enhanced, 5 megapixel module for higher resolution pictures/videos.

One of the most intriguing features in on the back of the circuit – a 2-inch IPS screen. This means that you’ll be able to easily see what the camera module is doing while it is doing it without looking at another screen. The full specs are below:

You can get the Standard HuskyLens for about £20 or $20 at the moment with reasonable shipping costs. Costs go up after the first 200, so get in quick if you want one 🙂

The HuskyLens is compatible with the Raspberry Pi, Arduino, LattePanda and micro:bit.

Take a look at the Kickstarter here.

LEGO Apollo Lunar Lander hooked up to a Raspberry Pi is a thing of beauty

Spotted this one in amongst all the 50th Anniversary celebrations of the Apollo Moon Landings.

Richard Hayler purchased the LEGO Lunar Lander set and built it up. He decided that he wanted a permanent enclosure to display it in and cut some perspex for the job. He then moved on to more hacky endeavours and decided to add lighting and button-controlled sound clips of the Apollo missions. The sound clips are played using a Pimoroni Speaker pHAT and some simple “Neopixel” strips were used to provide the illumination. He added three switches to control the lighting “moods” and three potentiometers (run through an MCP3008 analog-to-digital chip) to control RGB values. All the components were wired to a Raspberry Pi Zero:

The result is a very nicely-conceived project build with some simply-achieved, but very beautiful lighting effects:

You can read more about the project and see more photos on his blog. You can read more about the Apollo space programme over on the NASA website.

Control a Raspberry Pi / CamJam EduKit 3: Robotics kit using two micro:bits

Young programmer Luke Spademan has built up a CamJam EduKit 3: Robotics kit and, after first of all using the excellent worksheets written by Tim Richardson, then converted it so that the Raspberry Pi inside the box can be controlled by a pair of micro:bits. You can read how he did it here and see the code on GitLab here.

I reckon there’s a way to control the Raspberry Pi over Bluetooth from the micro:bit, so I’ve asked Luke about it and will look further into it as I think this is an excellent control method using the accelerometer chip on the micro:bit to control direction.

Edit: Indeed, there is a way to control the Pi over Bluetooth. Barry Byford sent over this link which you could add to Luke’s work to just use a single micro:bit.