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.

Pimoroni unveils future add-on boards for the Raspberry Pi Zero

Just been listening to Pimoroni’s excellent Bilge Tank video cast. They’ve announced a few things to keep an eye on. First of all, the pHATs currently displayed on their website are not actually in stock yet and are due Monday/Tuesday, so get ready to order! They’re awesome 🙂 Secondly, they unveiled some future pHATs as well as a full-sized HAT.

The first was a card to power the Pi from a LIPO (at the top of the screen below).

tinylipo

The first version will not have a charging circuit but a later version, already planned, will. But you can get something like a USB charger for LIPOs which will do nicely. I think I’ll get one of these when I re-tool the Picorder to make it extra small!

The next one is the Enviro pHAT which contains various sensors including a barometer, a light/colour sensor and an accelerometer. Here it is in prototype format:

enviropHAT

Next up is the IoT pHAT which is a way of connecting to the Internet through a little add-on card via an ESP8266 chip. It’s not designed as an ‘Internet connection’ but you will be able to do things like “get me this URL” and have it respond. Ideal for Internet of Things projects where you are polling an API.

iot phat

The next thing was the “Cheepy” which is a low-resolution GPS pHAT for around £20:

GPS cheepy

Another one in the melting pot is the POV pHAT that can be used to write messages in the air!

pov phat

And remember: all these pHATs can be used with the normal Raspberry Pi. So much excellent Pi goodness coming out of Sheffield!

They also showed (again) their STS Pi which is a very imminent robotics kit with custom parts and a mini chassis that works with the Explorer HAT Pro.

sts pi

And lastly, they showed off a new normal-sized HAT – the DrumHAT! Presumably similar to the PianoHAT with capacitive pads to create a mini electronic drum kit!

drum HAT

All that and I won a Pi Zero! (I know, I know, rotten veg is being thrown at the screen now!)

Really great show as always, pirates!

They will be doing another live show tomorrow (with more chances of winning a Zero!) at 3pm. So, head over to their channel.