Categories
Geekery Raspberry Pi

Controlling Lego motors with the Ryanteck Raspberry Pi board

I’ve reviewed a few Raspberry Pi add on boards before, including the PiFace which includes a multitude of inputs and outputs, and the minimalistic LEDborg which has a very bright single multicoloured LED.

The Ryanteck Raspberry Pi Motor Controller Board Kit is a GPIO add on board that allows you to control 2 motors with your Raspberry Pi. Although it’s much simpler than the PiFace it’s cheaper (about £12) and is easy enough to assemble yourself. In fact it makes a nice introduction to soldering, and is an ideal project if you want to take the plunge and have a go at making your own hardware.

With the motor controller board you can build a simple Raspberry Pi based rover – you just need 2 motors driving side by side sets of wheels or tracks. Driving the motors in opposite directions allows you to turn on the spot. The Ryanteck board can control motors up to 12 volts to you could always re-purpose a toy or build your own.

There’s some documentation available here, but I thought I’d share my build guide. If you’ve never soldered before check out the Soldering is Easy guide, and try to buy some leaded cored solder. Lead has (quite rightly) been removed from the solder used in commercial products to prevent it ending up in landfill when electronics are thrown away. However lead-free solder is much harder to work with (it’s fine if you’re a robot) and for hobbyist applications it’s easier to work with the leaded variety. Just make sure you don’t throw your electronics projects away once you’ve finished with them.

Build guide

In the kit are 3 sets of 2 pin headers, 3 sets of blue terminal blocks, a GPIO connector pin header and a chip carrier and controller chip.

Don't panic.
Don’t panic.

 

Holding everything in place when you’re soldering is tricky – so my tip here is to use the GPIO header block to hold the parts in place while you solder them. So first we have the set of 3 2 pin headers:

The spacing is just right!
The spacing is just right!

Next we’ll solder the chip holder into place, using the GPIO header plugged into one of the sets of 2 pin headers – orientate the cut out to the left hand side of the board:

Chip holder next, held in place with the GPIO header
Chip holder next, held in place with the GPIO header

Next comes the blue terminal pins. These are a tighter fit so easier to just rest the board on the blocks and solder away. Finally comes the GPIO header. Remember to solder this facing down – you’ll need something to rest the board on. Fortunately I discovered this was exactly one lego minifigure knee in height, so I used the lego workman as a rest:

Soldering is Awesome!
Soldering is Awesome!

 

Finally comes connecting it all up and testing. The board is rated for a range of motor voltages. Surprisingly as I seem to have a lot of Lego around I thought I’d test it with a vintage Lego technic motor. Lego motors come in different voltages – the very old ones are 4.5v and the newer ones tend to be 9v. My motor is 9 volts but I’m running it off a 5 volt USB power supply, which I’m using in my Lego rover project. The motor runs a bit slower but is fine for my purposes. Attach the power supply for the motor to the J1 blue terminal with positive on the left hand side.

It lives!
It lives!

There’s a test program included in the instructions to switch the motor on, and change it’s direction for a set period of time.

Create the program with:

sudo nano motortest.py

 

copy the following code:

##Simple motor script for the RTK-000-001
import RPi.GPIO as GPIO
import time
#Set to broadcom pin numbers
GPIO.setmode(GPIO.BCM)
#Motor 1 = Pins 17 and 18
#Motor 2 = Pins 22 and 23
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
#Now loop forever turning one direction for 5 seconds, then the other
while (True):
#Sleep 1 second then turn 17 on
 GPIO.output(18, 0)
 time.sleep(1)
 GPIO.output(17, 1);
 time.sleep(5);
#And now the other way round
 GPIO.output(17, 0)
 time.sleep(1);
 GPIO.output(18, 1);
 time.sleep(5);
 #And loop back around
#And final cleanup
GPIO.cleanup()

 

and then run it using:

sudo python motortest.py

 

You’ll need to use sudo as you’re using the GPIO pins.

Finally here’s a picture of the almost completed Lego Rover: all that’s to do next is to write some software and add a PiCam:

Curiosity killed the cat..
Curiosity killed the cat..

The Ryanteck Raspberry Pi board is a nice kit, easy to put together and get going straight away, and works with Lego motors so there’s quite a range of interesting things you can try. Ryanteck has now launched a complete robot kit that includes a chasis as well. For more info check out their GitHub project page. It’s a bargain way of making your Pi control things.

Categories
Gadgets Geekery Raspberry Pi

Raspberry Pi LED scrolling sign

I’ve been playing around with LED scrolling signs for a while now and have been looking for an affordable sign to use for a project. Some LED signs are really expensive but I’ve recently come across this one from Embedded Adventures:

It’s a 80×8 display with three colours – Red Green, and Red/Green mixed to produce Orange. It measures about 35x4cm in size so is ideal for something eye catching.

Best part is that it’s available for just £20 from the Embeded Adventures website. It’s ready assembled so you don’t have to get out your soldering iron.

To connect to your Pi’s GPIO follow the instructions on this page – which includes a handy python script by Pete Goss. For the wiring guide note that the numbers refer to the number of the pins as you count across, not the GPIO number. This is also for the Rev 2 board model A or B (if you have mounting holes, your Pi is fine).

Raspberry Pi pin number (GPIO pin label) LDP-8008 pin number (label)
3 (GPIO 2) 2 (A row address)
5 (GPIO 3) 4 (B row address)
6 (GND) 5 (GND)
7 (GPIO 4) 6 (C row address)
8 (GPIO 14) 7 (EN enable display)
10  (GPIO 15) 8 (D row address)
11 (GPIO 17) 9 (red LED)
12 (GPIO 18) 10 (green LED)
13 (GPIO 27) 14 (latch)
15 (GPIO 22) 16 (shift)

There’s a slight errata on the page as you have to type:

sudo python scroll “Raspberry Pi” 1

to get it to work.

I found that it will work powered just from the GPIO of the Pi, but if you need a brighter display you can just hook up a 5 volt power supply (e.g. a spare USB charger) to the central pins – this doesn’t need to be connected to anything else. The lower pin (with the printed text on the back the right way up) is ground – I used the cable off a novelty LED light from Poundland.

For the cable you can use jumpers or for something more permanent I found this Maplin GPIO breakout board available for £3.49 to be ideal. The LDP8008 comes supplied with a ribbon cable you can use.

Here’s a closeup of my cable – by cutting the grey cable different lengths you can make it quite neat. I also added a plastic cover cut from a spare toolbox divider.

underside of the maplin breakout board
underside of the maplin breakout board

and the cable attached to the GPIO on the Raspberry Pi (make sure you get pin 0 on the right side!)

I was surprised at how neat this turned out...
I was surprised at how neat this turned out…

Note that in my case, the labels on the Maplin GPIO breakout board were incorrect – make sure you double check everything before plugging it into your PI so you don’t break it!I also found the display a little sluggish if anything else is running.

For extra neatness I mounted the whole setup in a box frame – the one I used came from Wilkinson’s and was £6.

endless office fun...
endless office fun…
Categories
Raspberry Pi

Raspberry Pi retro text browser

If you visited the Raspberry Pi foundation’s website yesterday (April 1st), you will have spotted their spoof website redesign featuring a text interface and binary numbering on the menus:

This was what the web used to be like...
This was what the web used to be like…

They even had some lovely ASCII art. If you missed it, you can recreate the effect for any site on the web using the Lynx browser.

The Lynx browser is currently the oldest web browser still in use – it dates from 1992 and runs completely in the terminal. Despite it’s old age, it’s still regularly updated and actually works quite well. For sites with lots of text and forms Lynx is all you really need, and if you have limited access to the web where you work you can SSH into your Pi and browse the web remotely, all from the terminal.

Usage:

sudo apt-get install lynx

then just type:

lynx http://raspberrypi.org

to visit the site of your choice! – the newly launched redesign of the Raspberry Pi website looks like this:

No school like the old school
No school like the old school

enjoy!

Categories
Code Gadgets Raspberry Pi

Add a Raspberry Pi temperature gauge to your blog

At the moment I have a Raspberry Pi sat in the kitchen at home, running a Ghost blog – you can usually find it a ghostpi.org (BT broadband connection permitting).

As I don’t usually leave computers running 24 hours a day, 7 days a week I was curious as to how warm the Raspberry Pi gets with use, so I’ve found a handy way of keeping track of the temperature of the CPU. Admittedly the blog isn’t driving massive amounts of traffic – it was mentioned on Reddit once which generated a spike of activity, but the plucky little Pi held up very well. There are heat sink kits available for the Pi that add a block of metal – either aluminium or copper to dissipate heat. At the more extreme end of the spectrum someone’s even created a water cooled Pi.

The snowman still isn't getting in the least bit warm
The snowman still isn’t getting in the least bit warm

Realistically, although they look nice, heat sinks are a bit like go faster stripes or fluffy dice – in use the biggest impact on my Raspberry Pi was what time of day it was, and if the sun was shining on the kitchen shelf. Famous last words, perhaps this will get slashdotted and I’ll come home to find a smouldering pile of molten plastic.

If you’re interested in hosting a Ghost blog I’ve posted some instructions here – it is a beta blogging platform based on node.js which launched last year – it generally works well on the Pi, although for slightly complicated reasons logging in takes about 3 minutes (enough time for a cup of tea).

I’ve been using RRDTool to track the temperature of my Pi’s CPU – every 5 minutes this updates a nice little graph of the last 24 hours as a PNG which is then copied to the images directory on my GhostPi.org blog:

This might get cached so click on the image for the latest version

This can then be added to a page on the Ghost blog giving some stats on how hard the Pi is working.

In putting this together I used the information on this blog with a few alterations to get it to work for me.

First install the RRD  (Round Robin Database) tool:

sudo apt-get install rrdtool

 

Then run this script to set up the database. I created a folder in my home/pi directory called ‘scripts’ and then used nano to edit the script.

#!/bin/bash
#
# update .rrd database with CPU temperature
#
# $Id: update_cputemp 275 2013-05-16 05:20:56Z lenik $
cd /home/pi/scripts
# create database if not exists
[ -f cputemp.rrd ] || {
/usr/bin/rrdtool create cputemp.rrd --step 300 \
DS:cputemp:GAUGE:1200:U:U \
RRA:AVERAGE:0.5:1:3200 \
RRA:AVERAGE:0.5:6:3200 \
RRA:AVERAGE:0.5:36:3200 \
RRA:AVERAGE:0.5:144:3200 \
RRA:AVERAGE:0.5:1008:3200 \
RRA:AVERAGE:0.5:4320:3200 \
RRA:AVERAGE:0.5:52560:3200 \
RRA:AVERAGE:0.5:525600:3200
}

 

Run the script with the bash ‘name of your script’ command.

Now create a script which will update the graph: – you might want to edit the line cd /home/pi/scripts to point in the right location. The last line starting cp copies the png file to the content folder on the ghost server. Again you might want to edit that.

#!/bin/bash
#
# update .rrd database with CPU temperature
#
# $Id: update_cputemp 275 2013-05-16 05:20:56Z lenik $
cd /home/pi/scripts
# read the temperature and convert .59234. into .59.234. (degrees celsius)
TEMPERATURE=`cat /sys/class/thermal/thermal_zone0/temp`
TEMPERATURE=`echo -n ${TEMPERATURE:0:2}; echo -n .; echo -n ${TEMPERATURE:2}`
/usr/bin/rrdtool update cputemp.rrd N:$TEMPERATURE
/usr/bin/rrdtool graph cputemp.png DEF:temp=cputemp.rrd:cputemp:AVERAGE LINE2:temp#00FF00
cp /home/pi/scripts/cputemp.png /home/pi/ghost/content/images/

Test this script with bash ‘name of your update script’ – run it a few times and you should see the green line start to grow on the png graph.

Finally because you don’t want to keep having to run the script manually you need to add it to crontab:

crontab -e

 

and then add the line:

*/5 * * * *   ./scripts/CPU_temp.sh

 

the */5 bit means run every 5 minutes, and again you might need to edit the location and name of the script.

RRDtool is quite simple – there are projects out there that use external sensors to track temperatures outside the Pi. Part of me is wondering if running RRDtool a lot and reloading the PNG file will then start increasing the temperature of the CPU in a sort of observer effect feedback loop…

 

Categories
Comment Gadgets Geekery Raspberry Pi

Kano the Raspberry Pi go mainstream?

Since its launch the Raspberry Pi has been phenomenally  successful – with over 2 million units of the little computer sold around the world, it’s arguably kick-started a revolution in cheap, educational computing.

The only slight worry about this is how many Raspberry Pi computers have landed in the hands of kids (who it was really intended for) as opposed to 30-something computer nerds who are re-living their 8-bit computing childhoods, or networking the family toaster. Arguably there’s nothing wrong with that as the enthusiasts provide a ton of support but sometimes it’s easy to lose site of the goal of the project in the first place.

Then there’s the Raspberry Pi’s biggest competitor – the tablet computer. Many kids will be given tablets as they’re ‘educational’ devices – and given the choice of an instant on, readily usable ipad that can play games as well, the Raspberry Pi has its work cut out to avoid the drawer of forgotten devices.

So enter the Kano project – a kickstarter that raised over 1 million dollars, and effectively bundles the Raspberry Pi up with some nice hardware and some trendy design. Marketed as the computer you can build, it’s taking aim at the educational market in the hope that the kids will put down their iPads and have a go.

The Beta version of the Kano OS software part of the project launched this week so here are some first impressions.

In order to prepare your SD card Kano requires a burner program to run on a PC or Mac – although this does the job, it’s not quite as elegant as the NOOBS drag and drop method which has now become the standard for most Raspberry Pi software.

It did work on the first attempt
It did work on the first attempt

On bootup you get asked a few questions in the terminal, in the style similar to a text adventure. This is actually a rather nice touch. It neatly introduces the idea of the text interface and entering commands, and makes typing startx rather exciting (there’s a countdown!). I can imagine this being fun with a classroom of kids trying out the Raspberry Pi for the first time.

Not the command line you know
Not the command line you know

This first person theme continues as you use the computer – one nice touch is the bundled wi-fi setup app asks you to test your internet connection with the ping command (thus introducing the idea for later).

Once you get past this you’re presented with the Kano desktop. It’s beautifully designed with nice flat icons for the various apps. Chromium is the default web browser and it runs at a decent speed, and there are some bundled apps for creating programs.

Even as a Beta it feels quite polished.

Overall Kano OS is much simpler and less cluttered than other Raspberry Pi distributions and everything you really need is still there.

The tabletty desktop
The tabletty desktop

Lots of things here will be already familiar to anyone who’s used a Pi before – the command line is still accessible, so despite its user friendly interface there’s still the option to type proper linux commands.

The apps that have had the most work done to them are the programming tutorials – these allow you to mess around with a game of snake or pong using the drag and drop interface of scratch, and there’s also a split screen Minecraft app that is quite clever. It doesn’t take long at all to start really using the Pi and trying out different projects.

Here's pong with garish colours!
Here’s pong with garish colours!

It’ll be interesting to see how this software progresses – there are definitely some good points, and as something I could load onto a Raspberry Pi and give to some kids to play with it perfectly fits the bill; and it does still include the vital command line for anyone that gets curious as to what’s running their computer behind the scenes – something that a tablet computer lacks.

One thing I wonder though is exactly how the Kano kit fits in with the other Raspberry Pi distributions – I’m not sure if the aim is to get this to fit alongside the other Raspberry Pi distributions (for instance including it as part of NOOBS) or to sell it separately. Raspbian’s open source nature has led it to be massively improved over the years by the community – and it would be a shame if Kano OS missed out on this.

You can try out Kano for yourself at kano.me

The kit launches sometime this year with a custom keyboard – I’ll be reviewing that as well.

Categories
Gadgets Geekery Raspberry Pi

Unipi case (all that’s missing is a fruit logo)

A while ago I backed a kickstarter for an aluminium Raspberry Pi case. Although I’ve already amassed a collection of Pi cases (everything from Lego to a hollowed out Holga medium format camera) this one caught my eye as being a rather beautiful piece of industrial design. They even went as far as quoting me on the kickstarter page.

“The best metal case I’ve seen for the Pi” – Feel free to send free stuff!

Plus it was being made by a bloke and his Dad, which I like.

Well the case has arrived today, and I’m glad to say it’s not a disappointment. I opted for the bare metal version, and it feels really well made. The finish is more matt than it appears in the photos which is a plus point, and it comes with two lids – a perforated version and a version with slots if you want to make use of the camera and GPIO.

The Pi fits snug inside
The Pi fits snug inside

This is a very pretty case – perhaps most suited for a desktop Pi. The perforated design is a little bit reminiscent of the powermac G5 and the construction is spot on. I did need to bend the cover very slightly to get it to lock into place, but once it’s there it sits very securely.

All that's missing is a shiny fruit logo
All that’s missing is a shiny fruit logo

The case is also stackable, which would make a very attractive Pi cluster.

Downsides? well it’s not cheap – Adafruit are selling it for $49.95 although it’s cheaper than the other Aluminium cases I’ve seen. If you’re quick you can still buy it direct for $34.99, which still makes it about as much as a Pi, but then it does look very nice on my desk next to the iMac. The video out and stereo jacks are recessed, so angled plugs might struggle but the HDMI socket is almost flush with the side of the case – and this is the output I would use 99% of the time anyway.

Overall? I stand by my statement that this is the best Aluminium case available for the Raspberry Pi – there are others out there but they start to push the ludicrously expensive barrier, and the UniPi case has the feel of much more expensive fruit branded products.

Categories
Code Gadgets Geekery Raspberry Pi

Build a Raspberry Pi powered LED web counter

Here’s a little project to build an LED web counter for your blog. Proudly(!) display the number of visitors on a retro LED display, using the wordpress stats API – or potentially using any web accessible stats page.

You’ll need a Raspberry Pi (could even be the computer that’s hosting your blog) and a WordPress blog – either hosted yourself and using the Jetpack Stats plugin or on WordPress.com.

For this project I’m using a Python library called beautiful soup which can grab information from a web page – so as well as using this script to display a web counter, you could use it to display any information scraped from any accessible web page.

If you’re not using WordPress you could also do this using google analytics and the Embedded Analytics service, or by using your own counter installed on your website (see ideas below).

The Python script grabs the value from the web, and then sends it to the Pi’s serial port where it is displayed on an LED matrix.

For my project I’m using the Wharfe-Education.com BelleVue kit which fits neatly inside a Ferrero Rocher box and has a nice Back to the Future look about it. For 15 quid it’s a nice easy to solder together kit which features a 6 figure 7 segment LED display.

Wharfe-Education.com BelleVue and Raspberry Pi
Wharfe-Education.com BelleVue and Raspberry Pi

Raspberry Pi to BelleVue serial wiring diagram
Best to attach these with the power off

First make sure the Pi is powered down before attaching anything to the GPIO pins.

To attach the BelleVue to the Pi, you’ll need to attach the TXD (transmit), 5v and GND (ground) pins on the Pi’s GPIO to the inputs on the BelleVue – the right is a diagram for reference: – TXD on the Pi goes to RxD on the BelleVue, 5v on the Pi goes to Vcc and GND to GND.

For reference the diagram on the right shows the top row of GPIO pins with the Pi logo and text on the board the right way up – on the BelleVue it’s the 3 pins on the left hand side as you look at the board, again with the text the correct way up.

When you power on the Pi a sequence of characters will be sent out across the serial port. It is possible to disable this using the instructions found on the Raspberry Pi Spy website here – although they are for the Pi-Lite they equally apply to the BelleVue or any arduino powered LED display.

The Raspberry Leaf provides a handy guide to get the correct pins on the GPIO – or you can use the Adafruit cobbler and some breadboard. The serial port pins are in the same location for all revisions and A and B models of the Pi.

You could also use an arduino with an LED display – here’s an LED Matrix board made by Ciseco, which I’ve written about before:

LED matrix shield Ciseco
LED matrix shield sat on top of an Arduino Duo

or a Pi-Lite for a scrolling ticker board effect. The Pi-Lite just plugs into the GPIO and sits neatly on top of the Pi. I’ve found that the transparent Mod-My-Pi.com case perfectly fits over the Pi-Lite:

Pi-Lite and Raspberry Pi
Pi-Lite and Raspberry Pi

Alternatively if you’re up to the challenge (and want to save some cash) you could make your own – the Pi-Lite, BelleVue and LED matrix boards are all LED modules driven by Arduino based micro controllers and there’s a handy tutorial here which also includes the code you need.

Setup guide

First on the Raspberry Pi we need to install pyserial to make use of the Pi’s serial port:

sudo apt-get install python-serial

Then install the Beautiful Soup library. This allows us to grab information from a web page.

sudo apt-get install python-beautifulsoup

We could use something simpler, but Beautiful Soup is quite a handy way of scraping information from any web page, and it’s an interesting library to learn about.

For WordPress based stats:

Get your API key from https://apikey.wordpress.com – this will require you to log in using your wordpress account.

A quick test is to use the following URL:

http://stats.wordpress.com/csv.php?api_key=yourAPIkey&blog_uri=www.yourblogaddress.com&days=-1&summarize

Replacing yourAPIkey and blog_uri with your values. The final part of the URL defines what data is returned. You should see a plain text message of “views” and a number if everything is working properly. The &days=-1 returns the total number of unique visits to the site – you can replace this with &days=1 for number of views in the last day or &days=30 for number of views in the last 30 days, etcetera.

Once you’re happy with your URL, create a new python script – either on the Pi Desktop or on the command line using

sudo nano webcounterticker.py

and pasting the following python script

Once you’ve saved the script, run it using the:

python webcounterticker.py

Command – you should see your attached LED display list the number of visits to your site. This will loop with the same value until the script is stopped or run again.

Finally – but we don’t want to be constantly typing in the commands to run the script all the time – to get by this we’re going to use cron (short for cronometer – a regular clock that does things at regular intervals). For a bit more info about cron check out this blog from David Singleton.

We can set cron to run our webcounterticker.py program every minute:

sudo crontab -e

Opens your cron table in the nano editor – you just need to add

* * * * * sudo python /home/webcounterticker.py

and then control-O to save and control-X to exit. You might need to adjust the line above depending on where you saved your python script.

A few other ideas:

Once you’ve got your LED display running you might want to think of a few other things to do with it:

  • You can use Embedded analytics to generate a copy of your Google stats to use with the Beautiful Soup library
  • Use your own web counter – e.g. this php script (which I’m currently using on the footer of GhostPi.org)
  • Host a blog on the same Raspberry Pi that is running the web counter
  • Build an Ashes scoreboard to record England’s epic victory over Australia
  • Build a rack of LED counters for Web visits, Twitter followers, Emails sent or other things you want to measure (and show off)
  • Buy a DMC-12 on ebay and turn it into a time machine

As always, corrections and improvements are welcome!

Categories
Gadgets Raspberry Pi

Make any remote into a Pi remote with FLIRC

I recently acquired a FLIRC USB Dongle to use with my Raspberry Pi, and thought I’d post a few impressions of this handy media gadget.

FLIRC is a USB programmable adapter that can learn from any IR remote controller. You program the FLIRC using an app running on a Mac, PC or Intel based Ubuntu install, and once setup the FLIRC just appears as a standard USB keyboard.

The FLIRC itself is the size of a small USB stick – I’ve been using it with an old SKY box remote which has lots of handy buttons to use for various options. These remotes are a nice size, take AA batteries, and there are plenty available from amazon if you don’t have one to hand.

SKY remote being used as a Pi remote
It’s a (SKY) Pi remote

Each of the keys is set by running the FLIRC app – this can be set up as a simple apple TV remote:

Super simple (apple TV)
Super simple (apple TV)

for a more complicated XBMC remote, compatible with the Raspberry Pi’s RaspBMC:

FLIRC XBMC
More options here…

Or for the full kitchen sink option, as a complete USB keyboard:

Just when you need something that adds a couple of keys here and there...

The latter is particularly useful as it offers keys like left and right command – which are missed off some keyboards, like the one on the Motorola Lapdock and using a small remote as a keypad is also quite a handy feature. Programmable keypads are usually much more expensive than the £22.99 that the FLIRC retails for.

All in all the FLIRC is a handy tool for the Raspberry Pi – it’s only downside is that it can’t be programmed directly from the Pi itself, as you need an intel based Mac or PC to program it. There is an API promised in the near future that should hopefully address some of these issues.

One possible option would be to use the Pi as a bluetooth adapter, thus allowing you to control your iPad with an ancient Sky remote. 

Categories
Gadgets Geekery Raspberry Pi

Having a play with the Pi-Face board

Recently I’ve been sent a PiFace board from the lovely people at Farnell UK – I’m currently working on a slightly silly but hopefully quite fun project with this, but in the meantime I wanted to post up a quick review of the board.

Pi-Face expansion board for Raspberry Pi
Where’s Chewie when you need him?

The Pi-Face comes fully assembled and features 4 inputs (complete with push switches for testing) and 8 outputs – 2 of which are relays, making it suitable to drive high current motors. All the outputs feature surface mount LED indicators so you can easily see what’s happening.  As there’s a load of screw terminals attached to the board, absolutely no soldering is required to hook it up to LEDs or motors, or any type of power application. Although the big chunky relays are rated up to high voltages I think the practical limit is about 20v.

Fitting the board – in this case to a Raspberry Pi model A is a push fit job – there are cut outs for the video out and ethernet ports, along with a rubber foot that rests on the HDMI port. My only slight niggle was that in order for the board to fit completely flush against the Pi I had to trim 5 of the pins from the inputs for it to fit where it sits on the blue audio output port. This is a minor issue though as the board would work fine without this.

For installation – ignore the url printed on the board as this includes a mistake in the setup instructions. I used the following to install the software for the board:

sudo nano /etc/modprobe.d/raspi-blacklist.conf

and edit the file to add a  # at the beginning of the line which reads blacklist spi-bcm2708, so it reads # blacklist spi-bcm2708.

then use:

sudo wget -O – http://pi.cs.man.ac.uk/download/install.txt | bash

to install the software – reboot your Pi and then you can use the rather neat graphical interface to test out the board –

startx

to startup the graphical user interface, then open a terminal and type:

~/piface/scripts/piface-emulator
Pi Face graphical emulator
A bit blurry via VNC

The emulator lets you see inputs from the buttons, and switch the outputs on and off:

Pi-face with outputs on
Punch it Chewie

The instructions and resources from the Start Pi website seem to be the most accurate – there’s a lot of work in progress, but hopefully the support for the Pi-Face will improve with time.

In conclusion it’s a cheap, nicely put together board with very handy relays and terminal inputs – I’m planning on putting mine to use with a lego project (watch this space) – although it lacks the flexibility of some of the bigger boards it has enough for most of the projects you’re likely to do – particularly if like me you interested in the whole idea of social media controlled gadgets. The documentation could be a lot better, and with the screw terminals rather than soldering requirement this board is aimed at the beginner, so hopefully that should improve over time.

The Pi-Face is available from Farnell UK’s website.

 

Update

The official Pi-Face website is now a much better source of information & how to guides – find it at http://www.piface.org.uk/

Categories
Code Raspberry Pi Social Media

Trying out the Ghost blogging platform on a Raspberry Pi

Here’s a quick guide to running the ghost blog platform on a $25 Raspberry Pi.

Pi Ghost setup
Here’s my test blog

Ghost is a new piece of blog software, currently under development which was recently funded by a Kickstarter campaign. Ghost is a completely new blog platform which aims to concentrate on writing and has a really nice minimal, instantly updating theme.

Ghost uses node.js (a new one on me) and can run on the Raspberry Pi computer. So I thought I’d put together a few instructions based on my trial and error. You need to be a Kickstarter backer to download the code, although this will be released fairly soon. 

This assumes you’re running the latest raspbian build.  

For a handy reference check out this blog and the RaspberryPi.org forum posts on running Ghost. 

First Install node.js:

sudo wget http://nodejs.org/dist/v0.10.5/node-v0.10.5-linux-arm-pi.tar.gz
cd /usr/local
sudo tar xvzf ~/node-v0.10.5-linux-arm-pi.tar.gz --strip=1
cd node-v0.10.5-linux-arm-pi
node –v

(this should display the version number to test things are working ok)

then install ghost:

mkdir ghost
cd ghost

For the next step  download and install ghost-0.3.0 from the ghost website – at the moment  you need to be a kickstarter backer – log into the Ghost website, and download ghost-0.3.0.zip onto your Pi.

unzip ghost-0.3.0.zip
sudo npm install --production
sudo npm start

(go and make a cup of tea, this takes a while)

Next open a browser on the pi and enter the address:

http://localhost:2368/

and all being well you should see an intro page!

ghostraspberrypi

The built in browsers on the pi are a bit slow for blogging (particularly if you’re accessing it via a VNC connection) so to speed things up you can access your Ghost blog over your local network:

In the /ghost directory edit the config.js file. You’ll need to know your Pi’s ip address – you can get this from running ifconfig – ideally you need to set up your Pi to have a static ip address – 

sudo nano config.js

 replace “host: ‘127.0.0.1’” with “host: ‘<your IP address>'” and “port: ‘2368’” to “port: ’80′”.

and then enter your Pi’s ip address onto another computer on your network – you should now see your Ghost blog!

If found it very occasionally slows down when setting up users, but once I started adding posts and images it worked really smoothly on the Pi. Having a window open with an SSH session is interesting to see the software updating as you edit and create posts on the blog.

First impressions? it’s very minimal, but the lack of distractions makes this feel like a very creative blog platform to use – it’s not going to compete with the likes of wordpress and drupal for building fully fledged CMS websites, but as an alternative to tumblr or blogger it has a lot of potential.

Here's the side by side view
Here’s the side by side view

Ghost’s approach will be to offer the software as a free download for self hosting, or paid accounts via the website (like wordpress).

I’m looking forward to see how this evolves in time, hats off to the Ghost team. 

Update: making your local blog available on the internet:

I’ve been making my ghost test blog available on the internet – this is handy if you want to be able to update your blog from anywhere – although I wouldn’t recommend it for a production website that might get a lot of traffic, as it’s entirely dependent on your home broadband.

This is assuming you have a residential broadband account (I’m using BT broadband). Most home accounts used dynamic IP addresses, assigned by your service provider that change each time you connect to the internet – we’re going to use a service called no-ip.com which uses a program on your Pi to find out it’s address, and update a domain to point to this address. We’ll also need to open a port in the home router to allow connections to the Pi. 

First sign up for an account at noip.com – there is a free option available, or you can opt to pay $15 a year for a service with more features.

Add a host, and choose a hostname from the list of options.

Next choose the DNS-A host option and save. The settings I’ve been using are below.

no-ip configuration for Raspberry Pi

Next, on the Pi download and install the noip software (here are the instructions from RaspberryPihelp.net – check out their page if you want no-ip to run each time you switch on your Pi)

mkdir /home/pi/noip
cd /home/pi/noip
wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz
tar vzxf noip-duc-linux.tar.gz
cd noip-2.1.9-1
sudo make

sudo make install
sudo /usr/local/bin/noip2

Whilst installing it will prompt you for your noip.com login details.

Finally you need to open a port in your router to allow traffic through – there is a port forwarding guide for most routers available here – I found that logging in to my router by visiting http://192.168.1.1 in my browser, finding the advanced menu and adding the local fixed IP address of my pi and web forwarding worked for me.

Hopefully if everything is working you should be able to see your Ghost blog in the wide world: my address is

ghostpi.zapto.org

although this is entirely reliant on it being switched on, which depends on the coffee machine in my kitchen needing power or not.