Raspberry Pi Projects
Blog of many Pi related things. A lot of it is about my tank project TankPi, but I also document any Pi or electronics related projects that I do here on this blog.
Tuesday, 18 February 2014
Adafruit NeoPixel Ring
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
Sunday, 4 August 2013
XBMC and RaspBMC
Saturday, 22 June 2013
Automated / Motorized Curtains with a Raspberry Pi Part 1 - Smart Home Part I
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!
Friday, 12 April 2013
Another Little Side Project Complete!
Tuesday, 9 April 2013
A Side Note: The Arduino Came!
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
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
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
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)
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
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.
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
Sunday, 10 February 2013
1.5W Headlamp
Wheels and Tracks
Drive Motors for TankPi
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.
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
L298N
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!