Hide a Raspberry Pi Zero inside an XBox controller

Terence Eden is a self-confessed tinkerer based in Oxford, UK. His wife picked him up a copy of The MagPi with a Zero on the front of it and he decided to embed it inside an XBox controller. He cut a few bits and pieces out of the controller and slotted the Zero in, hot-wiring the USB connection from the inside. He loaded up the RetroPie gaming emulator and lo and behold, he’d created a self-contained gaming machine/control device. Take a look on his blog for how he did it.

Adding wifi to the Raspberry Pi Zero with a hack

raspi_edimax_hack_2-1

Shintaro decided he wanted to add wi-fi to his Zero. Rather than mess about with converter cables and adapters, he has instead taken apart the dongle and soldered it directly to the correct lines on the Pi. He carefully kept the two USB data line wires the same length to avoid messing up the signal and then wrapped the whole thing in clear insulation. You can see from the picture above what he did to the dongle (which is an Edimax). Using the raw 5V output from the power supply can be a bit dodgy, so caution is advised.

Tracking your pet in an office environment with a Raspberry Pi

Matt Reed is blessed with working in a pet-friendly office. However, it has been known for him to completely lose track of his dog, Bean, and so he set about working out a method for tracking him. To do it, he attached a bluetooth beacon to his dog’s collar and then installed 3 Raspberry Pis to trianguate (or pi-angulate) the position of the beacon. It’s an ingenious system and he’s written an iOS app to visualise the floor plan and Bean’s position. Read more here.

GPIO Zero for the Raspberry Pi – by George, I think I’ve got it!

When Ben Nuttall announced his GPIO Zero Python library a few weeks ago, I was very sceptical. It seemed to me to be dumbing-down the flexibility of RPi.GPIO. I didn’t like it. The truth is, I’d got so comfortable (and, perhaps, complacent) with RPi.GPIO that I was resistant to the idea that Python could be used in a different way to control the GPIO pins of the Pi.

However, Cat Lamin, who came up with the idea of Coding Evenings, asked on Twitter whether someone could help her to understand GPIO Zero and whether it could be used to teach slightly younger children (year 6, I believe it was) about the basics of Python in an exciting way where they could interact with the real world. So, spurred on by Tim Richardson (who had attended a Peterborough Coding Evening where Ben spoke about the new library), I decided to take the plunge. I took the robot I’d built using CamJam EduKit 3 and installed GPIO Zero on it. I then looked at the documentation for the library and within about half an hour (some of which was me being really stupid) I had a working robot with very few lines of code:

from gpiozero import Robot
import time
robot = Robot(right=(10,9), left(8,7))

robot.forward()
time.sleep(1)
robot.left()
time.sleep(1)
robot.right()
time.sleep(1)
robot.backward()
time.sleep(1)
robot.stop()

The above is a simple ‘demo’ script that moves the robot in all four directions and then stops it. It’s so blindingly easy!

RPi.GPIO still has its place (in fact, it’s what GPIO Zero is built on) if you want to do complicated things or if you want to drill down into the lower level stuff. But for just doing things like interacting with simple electrical components, and doing it in a clear, concise manner, GPIO Zero is tough to beat.

From an education point of view, it’s got great possibilities. If a child is moving from a visual programming language like Scratch to text-based programming in Python, GPIO Zero is a healthy stepping-stone.

So, I guess that teaches me a valuable lesson – don’t jump to conclusions if you haven’t tried something!

If you’d like to install and try out the library yourself, go to this page and follow the instructions. If you want a concise presentation showing you what you can do with it at a basic level, check out the SpeakerDeck slides below (these are what Ben used at the Peterborough Coding Evening):

I really commend Ben and Dave Jones for the development of this new library – it’s easy-to-use and has a commendable clarity. There are some exciting developments coming up in future versions, too, which is sure to make it more widely used. The future is bright for GPIO Zero.