RISC Carputer 3 – Fitting & testing

After all of these plans I’ve constructed the face plate from wood and given the intial fitting. Unfortunately I have minimal wood working skills and no shed however my dad has both of these so after a visit I have a face plate ready to go!
A bit of hole cutting and fret sawing on the kitchen table resulted in a faceplate that fitted all of the required switches, knobs and screen.
It’s now in the car and working well. I’ve made a couple of alterations to include a usb extender in the central glove box along with a further connection to the amp allowing a direct connection from an mp3 player.

in situ

I’ve put a 12v socket in the passenger dashboard to connect up the sat nav and also run a further cable to the current rear view camera which is now mounted between the steering wheel and central controls.

Now its all in I’m going to give it a week of use to see if its o.k. Mainly I’m looking to see if anymore cracks develop in the face plate and to make sure the software works well.
I had a short drive about today and !amplay was not very happy! It struggled to get songs loaded and crashed several times so I’ve given it a break for a bit. I really want to use it so that I can utilise it’s hooks for control however I need a bit of time to read through the manual and make sure its installed properly. In the mean time I’ve got digital CD http://www.riscos-digitalcd.net/ running.

My concern with this was that the text would be too small however in practice it is fine on such a small screen. The clock however is huge so may need a bit of a rethink!!

I’m using !bigclock from Bernards riscos site. ,however in practice the screen resolution is not so bad so I may go for a smaller version of the clock on his site.

Here it is running the jukebox on riscos….


..and here it is running arcElite on ArcEmulator (My ulterior motive to the whole project! – with thanks to davespice for the instructions in the magpi magazine http://www.themagpi.com/ )

elitecloseelitefarConclusion and the future!

In final testing it runs pretty well. The temp is usually around 30 degrees and can be reduced quite dramatically by opening the mechanical vent below the windscreen.

Although the car is usually wet inside there has been no water ingress to the console. I have experienced some terrible buzzing due to badly shielded cables however some careful re-routing stopped this.

My next plan is to create a custom dashboard for the screen. Currently I’m thinking of basing it upon the elite HUD with a revolving line drawing of the car in the centre and the read outs like fuel, shields etc displaying values taken from the GPIO pins. Unfortunately this is currently well out of my knowledge however it is something that I’m going to enjoy learning.

RISC Carputer 2 – Setting up

The next step was to plan and set up the electronic items.

Prior to this I had completed a test fit with the unprimed console:



I’m using Am Player to control the mp3’s along with WinMenu as the keyboard is a 2 button affair. Both have been downloaded from 7th Software
7th software link

I needed something small and backlit so opted for the RII ProMini from amazon here
It comes with a small dongle that plugs in to the pi – I was a bit wary that it wouldn’t work with RISC as the instruction state that it is only compatible with linux and windows however it worked perfectly. The only issue happened when I forgot to plug in the dongle and shoved it in when RISC had booted causing the mouse to stay at the top of the screen but this was fixed with a reboot.
It also works with WinMenu requiring the Fn & Ctrl keys to be pushed at the same time.
The backlight is not as dazzling as described however it is adequate and useable once I’d found the correct key (red dot in the top left). The instructions are vague however it didn’t really need anything as it plugged in and worked.

I didn’t want to spend too much on a screen at this stage thinking that if it was a really handy addition to the car then I could upgrade. My big concern was that the screen needs to be positioned right in front of the gear stick and there is the potential to punch it really hard when changing gear if your hand slips!
I went for a low res TFT screen from amazon.
It’s a pretty poor resolution however with a bit of fiddling about on the os comes up with a readable output. One tip I did read about was turning the screen upside down and setting the picture up the display at 180 degrees (a simple couple of clicks) as it makes it a lot more readible.
It comes with a plastic mounting bracket for fitting in to a car which is handy along with a remote control and facilities to add on a further AV input along with a trigger to enable a rear parking cam to be fitted. I’ve not yet set this up but I’d like to make use of it in the future.

The biggest suprise of all was that the keyboard and screen just plugged in and worked! I really thought I’d have some issues (especially the keyboard) and would have to go back to plan B using linux however I was delighted to see it all working on the dining table!!

The next stage was to set up the software. I’m still with my L-plates on as a RISC user however a quick read of http://lehwalder.wordpress.com/2013/06/01/middle-mouse-button-fuer-riscos-mit-winmenu/ got me to understand the process of running things from boot so I did this for WinMenu and AMPlayer. Both of these work perfectly with AMPlayer remembering its position on the screen and returning after rebooting which is very handy.
I’ve also downloaded the config and control files for AMPlayer again from 7th Software. I have a plan of creating my own screen and utilising the control hooks however this will wait until I’ve got the main body of it all working.

Note: I origonally had digital cd working initially – this was great however the small screen made it pretty hard to hit the buttons so I opted for AMPlayer.

I’ve taken advantage of the new amazon facility which allows you to download your previously bought CD’s as mp3’s and saved them to a usb drive, then transfered them to the sd card on the pi. It works pretty well and is a case of simply dragging and dropping.

Type of PI.
I am conscious that the sd card is a finite size so I’m going to have to build a method of reading usb drives in the system. This then limits me to the type of pi – I’d hoped that I could get away with a model A without all the networking and a single usb drive however it may be better to use a model b that I could potentially have some sort of LAN to wireless connector and the additional usb port.

The Land rover is pretty well catered for in the electrical department – It’s got 2 x 12v batteries that are connected in parallel with a connection from the winch to make them in series giving 24v. Behind the passenger seat is a fuse board to control the aux equipment and I intend to fit a further fuse board so that my modifications are separate from the existing equipment.

Power to pi
Initially I was going to run a new power supply form the new fuse board to power 2 x cigar style sockets with a usb adaptor to run to the pi. I managed to loose the adaprot somewhere and ended up altering a halfords 2 x power supply and usb charger. I pulled the tiny usb circuit from it (retaining the 2 x power sockets) and ran power directly to it from the switch, plugging the pi in with a flat, noodle lead from Pimoroni http://shop.pimoroni.com/

Power to amp
This needs about 3 amps so it’ll be run separately from the new fuse board.

Power to screen.
The screen comes with its own fuse and bare wires that I’d like to link up with my own fuse run from the new fuse board.

I had intend to have 2 x usb ports on the dash – 1 as a data and power to the pi and 1 as a power only for charging my phone. In pratice I’ve gone for a single usb port in the centre glovebox so that I can charge my phone and stick in my usb pen drive to transfer data to the pi.

The screen has taken up more space that I’d imagined! Initially I’d though about having the amp below it however it may be better for it to be positioned in the centre console. This would give me the option of pluging in the ipod directly and letting it sit in the soft bit at the front and also having dsomewhere for the keyboard to sit when not used.

At the end of this I had a working version in my front room:

working prototype


RISC carputer 1 – introduction

My current project involves getting my pi on the road!
The intention is to put a pi and 7″ screen in to my car – a 1992 landrover defender. It’s been modified by previous owners and sports all sorts of additional  electrical connections in a centre console.

The centre dash currently looks like this:


Basically a 12v / 24v danger box for your hands!

It’s my 3rd landrover (previous vehicles were a series 3 & a 101) with one of the main attractions being their reliance on mechanical control – I’ve owned other vehicles and nothing irritates me more than breaking down caused by a software fault! Whilst I’m looking forward to having a computer onbard I really don’t want to  intergrate it too much in to the vehicle and I want an off switch so that it’ll all still work without the computer running.
I’d like to build in the facility to monitor & possibly control the cars temp, lights etc via the GPIO pins as a future upgrade however these need to be optional with the car running normally without them.

My shopping list for the o.s.:
Quick to start. Quick to turn off (and minimal chance of issues if the power just drops)
Able to play mp3’s
Good for low res screens.
RISC os fitted the bill perfectly. I’ve a real soft spot for risc since playing around with a borrowed BBC, my own Electron then an Arc 440 back in the day. I’ve had it very succesfully running on my raspberry pi since release and have had a go at programming the gpio pins thanks to the efforts of Tank.

I’m going to avoid the temptation of making something sofisticated to house all of the electronics – partly as it’ll be quite expensive but mainly as I enjoy the current look of it and it shows a progression of ownership with me as its current owner!

Luckily the previous owner was thoughtful enough to install additional wiring running form the console to the area behind the passenger seat which has the air compressor along with the extra fuse board which feeds the lights etc.
The existing radio was accompanied by a CB and they’ve become quite tired so I removed them, leaving all the connections and brackets in case they’ll be useful.

In order to get things working I need the following:
A Pi
RISCOS on an SD card
Keyboard / mouse combo (I can’t stand touch screens!)
Audio amplifier
Power to all of these
USB port to get music on the the pi

This is pretty simple. I’ve already got a pi from the origonal batch (256mb). It runs RISCOS perfectly so I think this one will be in the car (I’ll need a new one to power my night vision animal cameras running linux so a 512mb would be better used in this situation)

I’ve got a 4mb card hanging around and have installed the os.

So far the cost is:
£22:23 – Screen
£25:00 – Fuse board (halfords 🙁 )
£Free! – Wiring (thanks previous owners!)
£Free! – SD card (already owned)
£38:99 (incl P&P) – Pi (replacement for the 256mb version from CJE micros – CJE Micros ) I’ve also bought the reat time clock module and temp sensor – both work flawlessly on the pi and can be bought from the CJE website

£17:99 –  keyboard
£ 2:99 – cigar / usb connector
£Free! – OS (thanks ROOL! ROOL website) ( os download from raspberry pi foundation )
£ 8:29 – Amp (works well. It has flashing lights for no apparent reason and arrived via glacier which kept the costs down)
(prices exclude P&P unless stated)

Nut Dispenser – 3B. Hardware(dispensing mechanism)

This has proved to be the trickiest part!

Initially i’d hoped to dispense standard, roasted monkey nuts as the squirrels love them! I’ve built many variations of the dispensing mechanism out of foam card however it was proving to be really tricky with the irregularly shaped nuts and their friction.

I’ve tried all sorts of mechanism from the simple opening and shutting of a spring loaded door to the moving of gravity fed nuts using a cut out like the board game downfall.

Downfall game – (image from skooldays.com)

The downfall was my favorite but very problematic with the monkey nuts so I changed to using shelled nuts which were much easier to dispense.

Above all the design needs to be reliable so I have constructed many prototypes with the most reliable by far being a simple trap door – I don’t mind it dispensing too many nuts at once however I don’t want it to clog up and this design proved to work well.

Prototypes - (clockwise from top left) the flapper, the hopper, the noisy cog and the downfall
Prototypes – (clockwise from top left) the flapper, the hopper, the noisy cog and the downfall!

The whole thing needed to be motorised and the foam card just wasn’t strong enough so I reverted to creating the mechanism from Lego at this stage. This was an easy decision as I have tons of it ahnging about with the only downfall ( 😉 ) being that I didn’t want to conform to the lego standard dimensions however for a prototype it would be fine.




Nut Dispenser – 3A. Hardware (electronic)

The hardware for the project can be broken down in to 2 main sections – the electronic control of the various sensors and the mechanism to dispense the nuts.

A) Electronic control.

Having played around a bit with breadboard I’ve worked out what I’d like to have for the various inputs and outputs:
1. Motor to drive the nut delivery system behind a reed switch or relay.
2. Microswitch to tell the pi where the motor is – to stop it chucking out tons of nuts or none at all!
3. Motion detector – I’ve bough one from Tandy which works pretty well .Not sure of the use for it yet but I:m going to add it in should it be necessary in the future.
4. Switch to trigger if the nuts are deployed. (possibly an IR breaker beam rather than a switch to avoid complex mechanical issues).
5. LED. A light that I can configure to show different colours. I’ve chosen a RGB LED so that it can be positioned in one place with the colours showing the status – I’d considered several different coloured ones but was concerned that the wildlife would notice the position of the light (i/e 3rd from left) rather than the colour = possibly a new experiment, though.

I wanted something that was easy to connect to the pi and so have come up with a veroboard circuit that connects to the pi via a ribbon cable.

This has the various connectors in place to make it fairly easy to connect up the swiitches etc and the ribbon cable to ensure that they are alwas connected to the correct pins on the pi.

The second piece of veroboard has the connection for the lego motor – these have special connectors and I decided to use an old battery box as a doner for the plug. I then soldered this on to some board and glued it down having worked out the pin arrangement from here: http://www.philohome.com/pf/pf.htm

It all works pretty well however the wires are inclined to come off the pins at the slightest vibration! Also I’ve had trouble passing 9v through the opto isolator as it sticks at anything over 3v – I’ve since got some relays that may prove better.

wildlife camera

I’ve had a bit of a break from the pi powered feeder over the past few weeks however I’ve been using it to work with our ip camera to record some night shots of the wildlife in the garden.
Over the past few evenings we’ve set the camera to look at the garden with the pi running “motion”. I’ve got hold of this inexpensive IR lamp from amazon and I’m using it with a cheap ip camera from here.
I’ve altered the camera a bit so that I have a switch to turn on & off the built in IR lamps – they’re really good however the camera is behind glass (on the windowcill) and they reflected off the glass. – basically I simply dismantled it and ran a switch over the LDR so that it could be bypassed.
After a bit of setting up from both the camera and motion I can leave the pi running all night silently creating videos of all motion. – the camera was pretty simple to set up having used the disc supplied and motion works excellently after reading the very extensive and detailed online documentation. – once its set up it can be accessed on the specified port (8080 in my case) to work through the options.
I’ve installed Apache on the pi so that it can be accessed from the local network and the videos are saved in a default way that organises them in to month/date.

The link below is for a video recored last week:

(Neither of these seem to work properly and I’m getting pissed off with trying to get videos to work on this blog! – so no more posting of videos)

deer (wmv)

deercam (avi)
This video is not the best quality as I’ve got it set up for night vision with high brightness but you can clearly see our visitor – a small deer which is quite special in such an urban, shared garden!

I’ve also got the CSI camera fitted to the pi which is significantly better in quality – I’ve got this working in a slightly different way and it’ll make a huge difference in picture quality when I intergrate it in to the whole system.

Nut Dispenser – setting up the pi part 1 – VNC

Having made the decisions about the design of the feeder I needed to begin getting the basics of the pi set up together.

AS I’m going to be using RISC OS there are a couple of hurdles to overcome that aren’t present in linux.

The shopping list for the pi setup is:
1 – Remote access for running the program (or monitoring if autonomous).
2 – Wireless networking.
3 – Sending or recording video.
4 – Get it working from battery power.

Before I get to running wirelessly I thought I’d begin with accessing the pi from a remote computer using its current remote connection – For this I used the VNC server by Adrian Lees – http://adrianl.drobe.co.uk/
He describes this as a shaky alpha release but, while a bit slow, it is perfect for running my basic program.

RISCOS for Pi running via VNC on my laptop
RISCOS for Pi running via VNC on my laptop

I accessed it from the laptop using tightVNC which provided a good & stable connection. The pi is set up to display on my tv using hdmi and I didn’t want to fiddle with the screen resolution, so I wasn’t surprised when it didn’t like running at 256 colours.


Nut dispenser – 2. Design

The choice of housing has helped enormously as it gives me a decent set of physical parameters to work too with the design of the internal structure was governed by the required inputs and outputs.
I need:
1. a method of dispensing the nuts (e.g. motor)
2. a method of checking that the nuts are there.
3. a way of signaling to the wildlife that food is present.
4. a way of finding out if the nuts are gone.
5. A way of detecting if the feeder is being visited.

It would also be helpful if there was a method of filming the feeding either from the actual feeder itself or remotely from an unconnected camera.

I’d like to be able to have a configurable method of linking the different inputs and outputs together and the raspberry pi was the easy choice – its pretty small but more importantly I’ve got one so no further outlay!

I will need to create a way of running the pi outside so it will need a battery along with either some way of communicating (e.g. VNC) or to be totally autonomous..

I’m no programmer however as a child I enjoyed my acorn electron as well as having access to a BBC B and and Arc 440, reaching my programming pinnacle aged 11! A few years later I’m drawing on this skill and so would like the project to run using BASIC on RISC OS – mainly as I’m most familiar with the language (although I’m very poor at it) but also because RISC OS just seems to work so well on the pi. The issue with this is that it doesn’t support simple wi-fi dongles and getting VNC to work appears to be pretty tricky.

Finally the whole system needs to be both watertight (in case of showers) and reliable (so that I don’t keep disturbing the wildlife by resetting it every few minutes).

I’ve looked online to see if there was anything commercially available that I could either buy or use the ideas from – the closest was this as posted on the Raspberry pi website: 

…and described on the Twin cities maker website here: http://www.tcmaker.org/blog/2013/03/raspberry-pi-powered-cat-feeder/


Nut dispenser – 1. Concept

With our squirrels and jays becoming a bit more used to our presence I though it would be fun to create an automatic feeder. Rather than simply dispense nuts the idea was to get them to work for it and to see what they see in terms of colours. Initially this consisted of a coloured l.e.d. that showed if a nut was present (e.g. red for none, green for present etc) with the nut being obscured so they could only tell via the colours.
I have grown this idea in my head to the point where I thought it would be fun to construct a dispenser that had several functions and then use them in a modular fashion to create various scenarios for the creatures to go through before they received the prize.

This idea was left for a while until my niece & nephew gave me a bird house for my birthday – unfortunately it is not possible to put up a permanent bird house in our communal gardens but the shape of it made me think that I could build my dispenser inside – so I did!

The birdhouse that will house the feeder

The following posts show how I am going through the design and build of this project.