Sinclair C5 with Touchscreen LCD Display

For a long while I've been playing around with an Arduino board and various sensors/relays and wondered if I could use them to construct a new control box/display for my plain old 12V C5 as a substitute for the original control box/pod which my C5 didn't have when purchased a few years ago.

The choice of using an Arduino board was simple: They are cheap, there are lots of sensors/modules available and you can program it in a language very similar to C++ on your PC.

3.2" TFT LCD Touchscreen Display

The first thing I wanted to do was create a display with a decent pixel resolution, this would relay all the important sensor information to the C5 driver. The display I found was a nice 320x240 pixel display that supports 16-bit colour and has a built-in touch screen. Perfect!

So started the C5 Touchscreen. Deciding what sensors I would need were fairly simple: I wanted to measure battery level, speed and motor temperature. I wanted to control the C5 motor with an analog input (Throttle switch). I wanted to show some visual indication when the indicators were on and have a hazard light button all managed in software.

The Arduino board itself has the ability to manage many Digital/Analog I/O ports. Some pins support PWM which is great for creating a variable speed cooling fan to keep that all important C5 motor chilled. The logic for it is fairly simple: At 15Â°C or lower the fan is off, at 25Â°C or higher the fan is on at full speed and for all temperatures in between the fan speed will vary.

Due to the touchscreen I'm using we have to use the Arduino MEGA board which is larger than the plain UNO board but comes with many more I/O ports.

As this is a touchscreen I want to add various options to configure the Time/Date, MPH/KPH, security PIN and any other settings I decide to add.

Motor load warnings, motor disabled when load exceeds 120amps for a period of time.

As you can see from the pictures I've mounted the display into a small project box and taken the casing for a broken POD and, after a bit of sawing, I've fitted the new screen and it's box inside the original POD casing making it look cool and kind of original.

At the back of the C5 I have added a new Black plastic box containing a new circuit board that allows the lights to to switched on/off, the motor relay and other bits for handling the cooling fan/handle bar switch and indicator switched. This is mounted where the original C5 control box would have been found.

The Software

All of the above isn't much use without the software to drive it and this is where a knowledge of mid/low level programming comes in. Arduino itself is programmed in something similar to C++. It's fairly easy to knock out a program to flip an LED on and off in a loop, indeed, the first demo I did was exactly that.

Luckily my background is in web development and before that games programming in old Z80/ARM assembler so the prospect of writing some C++ wasn't a problem.

As this is a touchscreen application I created several classes to represent colours, buttons, screens etc that grouped together both render and input (touch) functions. The LCD screen comes with a fairly basic set of rendering commands such as: Drawing squares, lines and fixed width font rendering using bitmaps.

The software to drive the display and control the various sensors is mostly done though it may need tweaking after some more testing is performed. The security PIN screen is ready and working. The PIN can be set at any time and needs to be entered when you first power on the unit.

I am using an RTC (Real Time Clock) module that as well as providing a means of maintaining the current time it also provides 50 bytes of NV RAM (Non Volatile Memory) that allows me to store things like the PIN code and other values such as total mileage that will persist even when powered off.

Want One?

Although this is a one-off project, if anyone out there would like to try something similar and would like to use/get hints from the code then head on over to the Building the LCD Touchscreen page for more information.

Component List (Work in Progress)

Here is a list of the components needed to build the display section and back-end circuit board. These are all readily available on the internet. Note: Links are from suitable items on ebay, I'm not benefitting from putting these links here, it's just to make it easier for you to find the right component!

Reference Circuits

I'm no expert at electronics, this is my first serious project and my first with an Arduino board. There is no circuit diagram, this project has been knocked together using several resouces I found whilst researching Arduino sensors. All the circuits used here are from various sources around the internet. The following will help when building the circuits for the back-end section:

Display Section Conponents

My C5 Touch has none of the original electonics or wiring. There is a switch attached to a 12V relay that enables the front screen and motor power. The display at the front is composed of the following:

Project Box 130x68x44mm (You may need a larger one depending on how you connect everything to your Arduino board).

PCB angled header pins x 40

The Arduino mega/shield/LCD screen can be purchased together or as separate items. Sainsmart are the only makers of this size LCD screen for the Arduino as far as I know: Sainsmart Arduino Touchscreen LCD Screen. You can use other LCDs though the software would need a significant rewrite to work with anything other than the Sainsmart screens.