# Introduction

The Lab has been looking for a suitably interesting ‘starter project’ for newcomers in order to let them
learn and utilise some of the key skills and concepts that make the Lab what it is.

The team discussed the various aspects of the project and decided it needed to cut across design, technology and science.
Each element should be customisable dependent on a persons skills or interests, and it must enable people to achieve
something tangible during their time in the Lab. Most of all the project must be ‘cool’, people must enjoy and have an
interest in what they are doing.

The Lego Mindstorms series of kits contain software and hardware to create customisable, programmable
robots. They include an intelligent brick computer that controls the system, a set of modular sensors and motors,
and Lego parts from the Technic line to create the mechanical systems.

Michael being the hoarder that he is, just happens to have a couple of these kits stashed away in a dark corner
of the Lab, complete with a Dexter Industries BrickPi. The BrickPi allows us to replace the default Mindstorms brick
computer with a Raspberry Pi, thus allowing us to add additional peripherals to the system and program
the robot using python.

We decided initially we would get the robot to move around on a table avoiding falling off the edges using some kind of
distance detection. This simple functionality could then be extended and altered to allow the robot to perform more complex
tasks. The design of the robot is completely customisable and can be tailored to the task as required.

For what is essentially a child’s toy the initial setup and configuration of the specific components we had was actually
quite involved so I’m going to give this short tutorial on how to get everything to play nicely together.

Firstly we followed this tutorial to get the image for the Raspberry Pi Operating System.
The image comes complete with a VNC server on it which must be started from the command line using $tightvncserver You may then open a basic VNC client connection to the pi by using$ open vnc://pi@:5901 We can then use the 'IR Receiver Setup' desktop application to disable the IR Receiver on the Pi.

### Flashing the BrickPi firmware

To use the Lego Mindstorm EV3 sensors with the BrickPi you must first flash the firmware of the BrickPi.
This step is relatively tricky and took us a while to complete successfully. For this you will need an Arduino.
We followed this tutorial which was fairly comprehensive but found some of the steps didn’t work
correctly for us! Also we didn’t actually have a ‘programmer cable’ so instead replaced this with 4 jumper cables.
You will see from the guide it says to cut the second wire of the programmer cable - after multiple attempts we actually
discovered the fifth wire is also unnecessary hence why 4 jumper cables was sufficient to carry out the flashing.
Also some of the directory structures within our OS were different which made some of the early moving of files operations
irrelevant. Take a look at the pictures below which should help you to know which pins to connect to which.

Original image courtesy of learn.sparkfun.com

### Gotchas

We found that occasionally the OS would get corrupted - re-flashing the SD card with the original image seemed to solve this.
We also realised that sensors on the BrickPi only work under certain power configurations - see the images below for
more detail on that.

Image courtesy of dexterindustries.com

Image courtesy of dexterindustries.com

### Let the fun begin

Once these steps are done you can start programming the robot to perform your given task.
Stay tuned to see what our guests come up with…