Tuesday, 18 February 2014

Adafruit NeoPixel Ring

The NeoPixel ring I ordered in the Pimoroni sale came this morning, and oh, I love it. We love LEDs here at Raspberry Pi Projects and this is certainly one of our favourites! Adafruit do a great tutorial on how to use their library over at http://goo.gl/lK5CqX .

First program I did with it was make a single pixel 'run' around the ring, then modified this to make the 'on' pixel a random colour. After this one got a little boring to watch (not too boring, you can never get that bored with LEDs ;) ) I made the whole ring turn on with each pixel again being randomly coloured, and change every 100ms. This was preeetty cool!

Now, while I'm writing this up, it's running a ring chase program with the chase LED being orange and the others being blue.

Had to switch the camera to manual to get this pictured!

(Check out the video! http://youtu.be/bGtcuBwdITg it isn't too good, the FPS of the NeoRing was too high for the camera..)



Jamie

Friday, 7 February 2014

New Year!

As they say, new year, new beginning; I think this year (even though it's already February now!) I'm going to try and most more often, now I've got back into Pi stuff after Christmas. It won't be quite as often as I'd like due to exams and coursework but I'll try my best.

Here's a few things to look forward to:
PiLite Pi Plate (LoL Sheild)
PiGlow Animation and Effects
Strip Light Drivers and Network Control
Air Play and Mirroring
Pi as Chromecast
IR Remote Interfacing
Portable Power
aaaand anything else that looks like either it's great fun, or uses stupidly large quantities of LEDs ;) (they're always good fun!)

Happy (a little late) New Year!

Jamie

PiLite

So,  I bought a PiLite a while back and as awesome as using it was using it as a message ticker over serial, I wanted to do a bit more with it. I'm not particularly fluent in python and so this is going to be a little tricky as writing scripts in python of simple text output on the serial out are fairly easy. As a bit of a learning curve, especially as I needed to know how to assign each LED individually I made this for a bit of fun.

https://www.youtube.com/watch?v=OcVTdnuIJSE

Apologies for the poor video quality, it was taken on the tablet as a spur of the moment thing and not with the actual camera.

Enjoy!
Jamie

(If anyone wants the code, leave a comment and I'll post a link up!)

Monday, 26 August 2013

Twitter!

We now have Twitter! Come over and join us @RaspPiProjects

Jamie

Sunday, 4 August 2013

XBMC and RaspBMC

Whilst in Florida last week, I discovered that Walmart sell really cheap removable media (well cheap everything really, shame they are not in the UK yet) and I got some new SD cards and decided to stick RaspBMC, a version of XBMC (Xbox Media Centre, it was developed originally for Xbox's but now has many uses) specifically ported for the Raspberry Pi. Unfortunately, I found that it lags a bit on the 256MB version of the Pi, I think it runs fine on the 512MB version, I'll let you know when I test it.

Anyway, it is fantastic. Especially as my freeview box refuses to output signal through HDMI to a DVI monitor, even though I get the box boot screen show up which is a little unhelpful as I don't particually want to sit a TV on my desk. It functions as a sort of replacement as with a few ad-ons, I can get internet radio, YouTube, content from my servers and even has the possibility of viewing live TV with a PVR to feed the coax signal in. Brilliant! :D

Plan is to have one of my desktop monitors to be hooked up through a VGA switch and have one of the feeds to my desktop, and the other to a VGA to HDMI converter for the Pi, then at the press of a button I can switch from desktop to XBMC and still use my desktop through the other monitors. I really need to buy a few more Pis, that would be helpful. Within the next week I should be getting a little monitor for project debugging to sit at the end of the new desk. (Place is currently a bit of a mess as I'm getting a new BIG desk and some decent storage units for the miles and miles of cable strewn everywhere. It also gives me plenty of space to work on projects (You'll be pleased to hear I've got a few more to come soon which should be good fun) repair and clean PCs, and do work on.) 

One of the best things about new workspaces I find, has got to be the almost endless list of possibilities for little Pi and micro-controller projects. I have a few ideas for that, especially lighting. I'll document it all here for you! :)

Hope you're all having a good summer!
Jamie

Saturday, 22 June 2013

Automated / Motorized Curtains with a Raspberry Pi Part 1 - Smart Home Part I

Its waaaay to much effort to open curtains yourself, so why not get your Pi to do it for you? And thats exactly what I did. Luckily I already had all the parts I would need to build it, which is why I chose motorized curtains as the first port of call on my smart home list.

I salvaged some parts from old printers earlier this week, yielding some rather good motors and gears besides other good parts like IR optical break sensors. The only other major things I needed was my Pi, a motor driver (see previous posts for that) and some software to drive it all, oh and of course the curtains! (plus electrical tape, no project is complete without a bit of tape ;) ).

First off, to start any smart home project, you need a stable way to control all your devices. Hardware and software. Before I started any hardware, I wrote a little python script using the python library that comes with the new update of WebIOPi 0.6.0, and a webpage to go with it. The python code can be made to be executed at boot, hosting the server which is the back end of the system. This server also hosts the webpage which gives the front end to the whole system. The webpage has a secure log in to increase security and to stop other people using it.


Once logged in, you have access to the main page where you can control the system. In order for this to work, your browser must support JavaScript (or have it enabled), which is pretty good as most browsers support this so I can control it via my phone too! (Note: Make app in future!)


Open is for starting the motor which pulls the curtains open. Close does the opposite, and stop stops both motors (even though it isn't possible to have both on at once with this, because then it enables H-Bridge use). Code for this is taken from the demo code from the makers of WebIOPi (http://webiopi.googlecode.com) and from Issues 9 and 10 of the MagPi magazine. I ended up re-writing a fair lot of it to fit my ideas. (Eventually, the buttons will enable the motor when held down, like a pulse). The code I used can all be found over at my GitHub Repo. (https://github.com/Jamie-/SmartHome) (The webpage UI over at GitHub looks slightly different to the screenshot above, but does exactly the same thing)

Part 2 will be up at some point, as the curtains came down, they have gone for a wash so I'm waiting on them to post about the hardware side of things, as this post is mainly software based.

Jamie

Friday, 21 June 2013

Smart Homes - Home Automation Control!

Now, one excellent use of the Raspberry Pi, is to turn your home into a smart home. One of the simplest projects that can be done in this field is turning on and off sockets. This can be done either with a wireless set of sockets and modifying the remote for them, or with a relay. Like this.


That way, you can control lights and similar objects. I however, decided to start somewhere a little more adventurous; with motorized curtains. This is a bit more tricky than sockets, but I had all the parts I needed already.

In the next post, I'll go through how I made a fancy web front end and how I put it all together.

Jamie

Friday, 12 April 2013

Another Little Side Project Complete!

Not long after waking up this morning, did I find that the postman had delivered my new DHT11 temperature and humidity sensor. Obviously, the first thing I did was try to get that working. First I tried it with the Arduino, and got it to report the temperature and humidity over it's serial interface. (The numbers do change really ;) )



After playing about with that, I plugged my 16x2 LCD in too, and after a bit of code playing and experimentation, got this.



This simply reads the current temperature and humidity off of the sensor, stores it in a variable, prints to the LCD, and goes round again. You can get the degrees symbol fairy easily but for now, I haven't bothered. It is currently sitting next to my desk, updating the current info about every 1/2 a second to 1 second.

You can guess the next plan for this sensor... Getting it to data log on the Pi for me ;)

If you want the code and a brief simple wiring guide, grab it off my GitHub here: https://github.com/Jamie-/DHT-Sensor-With-LCD 

Jamie

Tuesday, 9 April 2013

A Side Note: The Arduino Came!

I ordered an Arduino Uno from CPC a few days ago and it came late yesterday afternoon with UPS. It is fantastic  It has 14 digital I/O on it, so it can drive the cube easily.

The box was much smaller than I expected...


And a picture of the actual thing itself connected to the computer and the cube.


But my favorite part by far was the fact it came with these...


Thats right, stickers! :D


See it in action.


Jamie

Friday, 29 March 2013

Drive Motors for TankPi

After a bit of testing, I found that the old cordless drill motors I was intending to use for this project have too much speed and not enough torque. I am going to have to either gear them, or alter the voltage/current to make this better as it is currently not geared at all.
We'll see what happens...

In order to get the belt to actually move, without the back drive wheel bending, I found I needed to put a bracket on the drive wheel as shown below.


I'll post again soon with another small mini-project I've been working on, and to share updates on how TankPi is doing!

Jamie

Saturday, 23 March 2013

TankPi Update

After spending an entire afternoon scouring the internet last week for a method of live control over the GPIO, I found that some amazing person had written a little app using Node.js for a similar project (link to her GitHub code https://github.com/mirceageorgescu/raspi-tank). There are no instructions with the code so it was very much fiddle and guess but I got it all working in the end, with the exception of a broken motor driver board, and after blowing up 4 D cell batteries by accident.

The main chassis has hardly changed, but I now have the first track prototype on, its a bit hit and miss as it's covered in electrical tape at the moment and the track doesn't stay in the wheels just yet as I haven't cut the rubber to size in case this just doesn't work.

So all in all things are getting underway. As some side projects, I am still trying to get my LCD screens to work over I2C but there's a chip and code issue to sort out somewhere. The LED cube board is built onto a board now which is good but I need to get an Arduino to drive it, and in the future, a custom built board with a ATMega chip on it (same as on the Arduino).

Jamie

LED Cube Board

After using the LED cube by taping wires to the legs, I made a board which has 13 pins on (9 columns, 3 layers, and ground) and is all wired up for use.


Each layer on the cube had each LED's cathodes linked up together, and then to a transistor and then to ground. The transistors and ground connected to the 4 pins on the right (3 layers + ground) and each column connected to one of 9 pins on the left. The soldering and wiring underneath is a complete mess and it doesn't sit flat on the table so I'll need to stick some feet on it. Once the camera's charged (I left it plugged into the computer on, d'oh) I'll stick some more pictures up, some of the wiring and a circuit diagram.

Jamie

Saturday, 9 March 2013

Blue LCD Display (x2)

Yesterday evening, my 2 new LCD displays arrived from China! I couldn't get it working until today because I needed a 10k potentiometer that I didn't have. After Googling which household items have potentiometers in, I found that there were 2 100k ones in an old joystick I had lying about. That got the screen working :D


Unfortunately using the GPIO to control the LCD meant that there was no way to use the spare ports as they were in the wrong mode (LCD uses GPIO.BCM and I need GPIO.BOARD). To get around this so I can use the LCD on TankPi, and use the other GPIOs, was to use the I2C ports on the Pi (it meant I'd used the only one up, but I think that's not a problem on this project :) ). I'm now waiting for the I2C chip to be delivered from CPC, then we'll see how that works out.




Jamie

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