If you’ve seen me at one of the many Raspberry Jams this year, you’ve probably had a spin of my PiRobot that I bring to most events. A lot of people have asked me how I made it and where I got it, so I thought it was worthwhile writing a post on my particular model.
If you haven’t seen my robot, let me explain. Most people reading this are quite likely to have a smartphone/tablet and a Raspberry Pi. What if I told you that you could use both of them together to make a really cool robot Pi project, with lots of learning opportunities bundled in for good measure?
I’m talking about a Raspberry Pi Robot – controlled by your iPad, smartphone or any other device with a modern browser!
I can’t take credit for designing it or writing the code as I bought the kit from the clever folks from Dawn Robotics who provide everything you need, however I will be modifying it as the chassis and open-source code gives you a ‘canvas’ to change absolutely every element of this robot.
A ‘Raspberry Robot’ is a popular project for the credit-card sized computer, but one that I had put off for a while as it initially felt a little ‘too much’ for me, and somewhat out of my range of skills – especially considering my confusion around motor control, amperage, power limits and so on.
After having a chat with the Dawn Robotics team, it was clear that their kits were mostly foolproof with ready-to-go downloadable images and step-by-step instructions on their site (and on paper in the kit). That’s all the convincing I needed – I left the event with their bundle box and headed home to put it all together!
My Robot Chassis Bundle
Why This Kit?
The ‘maker’ market offers a lot of different robot kit options. All needs are very well covered and there’s a robot kit out there for everyone, whether your key requirement is price, speed, size, ease of use, camera control and so on.
The ‘Camera Robot Chassis Bundle’ that I have here is almost a mix of a lot of those requirements. No it isn’t the cheapest robot kit out there, but by no means the most expensive. It’s neither the fastest or slowest, and It’s somewhere in the middle in terms of size. Looking at the build, I’d say it’s medium complexity.
What separates this kit from the crowd (in my opinion) is the camera mount and excellent software that streams the camera image to your tablet/smartphone. You have to try it to see how cool this is, but I’ll try and show you this in the images later on.
What’s In The Box?
You get everything you need to make the robot – apart from the Raspberry Pi (+SD card), Camera Module and WiFi adapter. This includes:
- A Dagu 2 wheel drive robot chassis (2 chassis plates, 2x pre-soldered motors with crimped 2.54mm connectors)
- A Dagu Pan/Tilt kit (2x 9 gram servos, metal mounting brackets and fixings)
- A Dagu Arduino Mini Driver (motor/robot controller board)
- Raspberry Pi fixing set (spacers and fixings for fitting the Pi to the chassis)
- A fixing set for the pan/tilt kit
- 6xAA Battery holder (with crimped connectors)
- A sensor fixing set (for mounting the camera and/or other sensors)
- A mini-USB cable
- A 3 Amp UBEC for the Raspberry Pi (If powering the Pi on batteries)
- Printed instructions
The boxed Robot Chassis Bundle – packed with bags of bits!
Building The Robot
This bit I really enjoyed. Anyone who used to enjoy Lego, Meccano or RC cars (or who still do) will have a great time putting all the parts together. What I really like here is the fact that the build instructions provide a ‘recommended’ layout, but by no means a compulsory setup.
I initially built the robot as per the instructions that come with the kit, however after noticing that you can choose to power the robot (and Pi) with a power bank, I quickly pulled it to pieces again and started planning what I consider the perfect layout. I did this two or three times until I was really happy with my design (adding some custom parts as well).
My first layout attempt
I decided that I would mount the Raspberry Pi upside down inside the chassis plates, rather than on top. This allowed me to mount the power bank on top (after pulling it apart and adding stand-offs) which makes it really easy to charge, and also acts as a good handle to pick it up with.
Opening up the power bank to fit some stand-offs
The Power Bank mounted on top of the chassis
The important thing here, no matter how you choose to set your layout, is to make sure the electrics are correct first! I got my motors round the wrong way round the first time, which gave me a bit of a ‘drunk’ robot!
Controlling The Robot
This is the really cool bit, and one of the reasons I was so drawn to this kit at the Cambridge Raspberry Jam. The robot is controlled using the browser in your tablet or smartphone, using your WiFi connection. Once connected you get two thumb sticks to play with – left for movement control, right for camera control:
Robot control interface on my Samsung Galaxy Note II
One thing that’s been clear from the events that I’ve taken this robot to, is that all ages get on with this control system very well. I guess it’s a bit like the Playstation analogue thumbsticks – it just comes naturally (after 30 seconds or so!). It can be tricky to get accurate control as touch screens don’t give you any feedback, however the sensitivity can be changed in the code (or you can add simple HTML buttons for control).
The way it all works behind the scenes is very clever. Dawn Robotics provide a downloadable image for you to install directly to your SD card and pop into your Pi. Part of this sets up your Pi as a WiFi access point – and to control the robot you simply connect your device to the same WiFi Access Point created by the Pi. It works very well and rarely drops out.
I initially had reservations about how fast the stream would be to my phone, as other camera software with the Pi had been quite ‘laggy’, but I was pleased to find that the video is pretty much real-time.
Upgrade, Customise and Learn
A lot of you might be thinking “Hey that’s cheating, what have you learnt?” and I do understand that statement.
However, my learning style is somewhat backwards, but it works for me as someone who doesn’t get on well with ‘contextless’ classrooms and books. I like to learn by copying projects and code, and then going back and changing/breaking that code to learn how it works. I find things ‘sink in’ a bit better this way.
Tinker and change to your hearts content!
This robot kit is no exception. The kit comes ready to go, and feeds your initial desire to have a Raspberry Pi robot up and running. Once you’ve got to that point, you can go back into the open-source code and have a tinker. You can change the speed of turning, set up Python scripts to automate the robot, change the HTML interface and add buttons/sliders or anything else you can think of.
Let’s not forget the obvious addition of the many sensors that are applicable to wheeled robots, and other hardware you might want your robot to include.
I added this handy Adafruit micro-USB breakout board
So think of it as a guaranteed success, with masses of learning potential!
If you get really good at the coding and hardware, you can then look to enter competitions such as the upcoming ‘Pi Wars‘ being held in Cambridge by the same friendly chaps that brought us the ‘CamJam’ Cambridge Raspberry Jam.
Pi Wars – A bit like TV’s ‘Robot Wars’ but without the aggression!
There are lots of tests and courses that will require you to have mastered your robot’s hardware, code and controls. I’ll be there as a ‘roving’ judge this year – no flamethrowers on my watch! Dawn Robotics are competing too – however I’m not sure if they’re using this kit as a base or not.
After initially avoiding robotics projects with the Raspberry Pi due to the lack of confidence in my abilities, what I wanted to get across today is that it really is reasonably easy to get started with robotics using a kit like this.
The almost foolproof nature of the build and code means you’re pretty much guaranteed to get it up and running, which avoids any disappointment. Whilst this seems a little too easy at times, the open and very customisable nature makes this an excellent learning tool as well – especially for children (and adults) that might get bored with the usual hardware such as LEDs and switches.
All in all – a great Christmas present for the curious maker in your life – young or old!