Saturday 23 February 2013

3x3x3 LED Cube

I had a day of nothing to do (makes a change) today and after seeing some pretty awesome LED cubes on YouTube, I though I'd give it a go. Unfortunately, I only had 9 green LEDs and I needed 27. There's a pretty obvious problem there so I had to make a quick trip to the nearest Maplin to pick up a load more and a few resistors.

To make the cube, I needed to make the 3 layers of LEDs first. To do this, I made a jig. My jig consisted of a bit of wood with holes drilled in where the LEDs will sit while soldering. To do this, I opened SolidWorks and created my jig template.


I then printed this out on a 1:1 scale, and stuck it on top of a piece of scrap wood and drilled the 5mm holes.



I also drew on arrows as to which way each of the LED cathodes would be pointing. The cathode on an LED is the negative leg, definable by a segment of of the circular shape of the LED cut off, or by the shorter leg. I pushed all the LEDs into the jig, bent the legs and soldered then together.


When pushed out...


To make sure all of my connections worked, I used 2 1.5V AA batteries, connected one lead to the ring of cathodes, and used the other lead to connect to each of the anodes (positive longer leg) in turn to check they all worked.


Once I had made all 3 layers, and tested each, it was time to assemble the cube, and that, was not an easy job by any means. It took rather a long time and a lot of crocodile clips... but it finally came together.


And worked...


There was however a big problem with using the Pi to control it, the Pi has 7 GPIO pins for me to use for this, and I needed 12. One for each column of LEDs and one for each layer. I only have on face of LEDs working at the moment, using 6 pins (I might have to move this project onto an Arduino at a later date..) The 9 LEDs that I am using I have programmed to move in an S shape repeatedly. With every LED cube out there, you can only ever have 1 LED on at any set time. To make more appear on, you have to flash the LEDs on and off faster than the eye can detect. This also works on 1 face with 6 pins.

To control only 1 LED without turning the others on, the positive AND ground need to be turned on as needed to light the desired LED. I used 3 NPN BC547B transistors and 3 22kΩ resistors to turn ground on and off on each layer, and each of the 3 columns of LEDs I was using went straight onto the GPIO (they could do protection by resistors really). It all went on to my breadboard.



Jamie

Monday 11 February 2013

Chassis Change

In order to fit the tracks onto TankPi, I needed to set out the mounting points for the wheels that support the tracks, like this.


So I re designed the chassis to have mounting points for each wheel and it turned out like this.


Its a little unclear but there are 5 mounting holes, a row with 3 holes, and a row with 2 holes. I need to get 4 4mm diameter rods that are 280mm or there about long for my axles then I can laser cut some more wheels and build the tank track mounting and install the tracks.

Jamie

Sunday 10 February 2013

1.5W Headlamp

A few days ago, I discovered one of my old torches' batteries had leaked and as the battery died, couldn't be replaced. This was actually rather good news. I removed the head from the torch along with the LED and it's mounting plate then re-soldered the connecting wires so that they were much longer than the original 2cm wires. After a test with some BC547B transistors, a 27kΩ resistor and the Raspberry Pi, the LED is really bright at 5V. So this became the main headlamp for TankPi and was mounted on the front.



Jamie

Wheels and Tracks

The idea is for TankPi to move about on tracks, and to do this, it needs to be held out by wheels. One wheel on each side will be directly joined to one of the motors (this is the current theory, they might need gearing. I have yet to decide...). Using only a 3 metre tape measure (the calipers are on order), I attempted to make a wheel which had a nine tooth gear hole in the centre in SolidWorks (wheel diameter of 50mm)

Once made, I exported it as a DXF and then sent it to the laser cutter to be cut out of acrylic. This worked extremely well considering each tooth was 1mm wide and the laser's accuracy is 0.2mm. The finished wheel prototype was fantastic and fitted on both motors. One a tight fit and one a loose fit so I may need to superglue later on...


And on the motor.


Result!

Jamie


Drive Motors for TankPi

TankPi is hopefully going to be a pretty hefty machine, and for this, I needed some pretty hefty motors. It turns out in amateur robotics competitions, many people use old cordless drill motors which have a lot of torque and speed, but can also be easily battery driven. I managed to get my hands on 2 old cordless drills, whose motors I extracted. That's one problem sorted :D


Next I needed to mount them onto TankPi's main chassis. This proved to be relatively easy as I had screws that fitted the motors, and the holes were perfect distance apart for mounting onto the mecanno chassis.






(They worked with the motor driver too after an hour of hunting for a 12v power unit.. with no luck so 15v had to do for a quick test. Luckily the motors are meant for 14.4v so they survived ;) )

Jamie

Slice of Pi

Before I got my hands on a Pibow and a Pi Cobbler, I had one of these, an Adafruit Slice of Pi.


If you don't have access to a bread board or a cobbler, this is fantastic. Each port is labeled and the holes in the middle are for prototyping on (solder on). When you order it, you get the board and the sockets, then you solder it yourself (oh I do like a bit of soldering ;) ).

Jamie

Saturday 9 February 2013

Pi Cobbler

If you haven't got one already, get yourself one of these, and Adafruit Pi Cobbler. It's fantastic, especially if you have a Pibow case.


And with the Pibow...


The Pibow is fantastic, looks beautiful and even has a ribbon cable slot (get one, its awsome!)

Jamie

L298N

To drive TankPi, I needed to get a pretty decent motor driver that will drive my motors, yet to be decided.

I decided to get the L298N motor driver chip on a board off Ebay. It drives motors up to 35v and takes 5v logic power. Sounds perfect!

The L298N is great, meant for Arduino, but it works great with the Raspberry Pi GPIOs. 


That's it. Small and awesome.

The terminal connector on the far left bottom is the first of the 2 motor outputs, and top right is the second motor out. The 3 port terminal in the middle is VCC (motor power) GND (common ground) and +5VDC (logic power). The pins in the middle are the Pi connection pins that go to the GPIO. 

This is eventually going to be mounted on the underside of the TankPi chassis (picture to come).

Jamie

TankPi

The blog is now up and running!

I'll get posting very soon about my first proper project with the Pi... TankPi.

TankPi is a all terrain robot/tank that will be controlled over wifi with a Raspberry Pi. This is one of my first projects, and there are many more to come...
Jamie