Thursday, 31 October 2013

Jack-O'-Lantern Time

With Halloween now upon us and with the kids a bit older I decided this year I would make some Jack-O'-Lanterns. Never made any before so wasn't sure how these would turn out. However for a first attempt I don't think they turned out that bad.


To light them up I decided I was going to use a flickering LED candle. Seen loads of these all over the internet and figured it wouldn't be very hard to make. After rummaging through my parts bin I decided I would go with a trusty old ATtiny13. Using one of the PWM outputs and a single N channel FET to drive a few of LEDs.


Built it up on a small piece of strip board held onto the back of single 2 x AA battery socket.


The firmware is almost a simple as the circuit. The PWM level ramps up from its low value right up to its full brightness level holds it there for a short period before ramping down to its low value. A variable delay period is then generated using a linear feedback shift register. This gives a reasonable flickering effect. The cycle is then repeated indefinitely.


Wednesday, 12 June 2013

Word Clocks

While browsing one of my favourite sites Hack a Day I saw an article about a chap who had designed an automated programming test bed using a Raspberry Pi. Interesting in itself but what really caught my attention was what this guy was using it for.

Turns out he manufactures "word clocks". I have never seen these things before but wow how cool are these.


Check out his website Dougs World Clocks. Some thing else to go on the TO-DO list.

Wednesday, 1 May 2013

Bluetooth Temperature Sensor

Been playing around with the cheap bluetooth module I bought on eBay a couple of weeks ago. Can't say its been a straight forward exercise. According to the data sheet the device supports a number of AT commands for setting the baud rate, device name, pairing code etc. So I hooked up the power and sent commands using a serial breakout board to the module. Now according to the datasheet sending the command "AT" should  result in an "OK" response from the module however the device didn't appear to be sending any responses.

Doing a little searching on Google seems I am not the only one having issues with these modules. The forums are full of people struggling to get them working. Seems they have a very small timeout period meaning typing commands by hand would result in a timeout. Apparently these devices also don't like line feeds at the end of messages.

Still I'm not giving up that easy. Not being able to get a response to any AT commands I decided I would just try to pair with the device and send messages over the air waves using the default settings. After searching for the device I successfully paired it with my laptop and after firing up the terminal program tried sending messages between the two. Hey bingo its only working. Result!!

With that now working it was time to interface this module to a microcontroller. I built up a simple circuit using an Atmel ATMega168 microcontroller. Messages sent by the micro appeared fine on the PC.


Just out of interest I decided it might be worth seeing if sending commands from the micro would result in a response from the module. So rather than simply sending the "AT" command and looking for a response I tried changing the device name instead. Still no response from device. However when attempting to pair again the laptop was unable able to find the module. Strange!? So searching for new devices turns out the device name had changed. The command had worked just I was not seeing any acknowledgement.

So seems this device is a bit hit and miss. But still what do you expect for £8.

Next step I interfaced a couple of DS18B20 1 wire temperature sensors to the micro. The great thing about these 1 wire sensors is that you can have a number of sensors on one bus. So once you have one working, assuming you have implemented a search algorithm to identify and initialise each device on power up adding more sensors is a breeze.


With the temperature readings being received in simpleTerm over bluetooth I went on to design a simple windows application to display these temperature readings. That way I can leave the device running and have the application running in the background while I keep and eye on the temperature. It only supports up to four sensors irrelevant of how may are reported over the serial link.The user simply selects the required serial port, waits for the device to be paired and then temperature readings begin appearing.


What would be great would be a android version as well that could be run on a phone or tablet. Theres another project on the to do list!

Saturday, 20 April 2013

More New Toys

Look what arrived today. I really need to stop buying stuff.


Been after an ARM based development board for a while now. Not been really sure where to start then I stumbled upon these little beauties. The Steallaris Launch Pad from Texas Instruments. Based on the LM4F120H5QRFIG 80Mhz Cortex-M4F CPU with 256K Flash and 32K RAM bags of peripherals and external I/O. All this for less than a tenner. And the support online for these is phenomenal. Can't wait to get it up and running.

As well as the launchpad I also bought one of these little bluetooth modules from eBay.


Need a cheap way of achieving a short distance wireless serial link between two devices on another project. Was considering going down the ZigBee route but  the cheapest ZigBee modules I can find are nearly £30 each these little bluetooth modules are less than a third of the price. Lets just hope it works!

Traktor Compliant MIDI Controller Project - Part 2

Just a quick update I forgot to post.

Having never dabbled with USB on AVRs before getting communications working was a lot easier than I thought it would be. Thanks to Dean Camera's excellent USB stack LUFA I now have the virtual serial device working perfectly on my MinimusAVR board. I built a simple development board housing the Minimus and a couple of LEDs. I then sent commands to it using PuTTY to turn ON and OFF these leds.

That’s step one done now time to think about the remaining hardware.

simpleTerm - Terminal Emulation

As part of my work I tend to find myself using terminal emulation a lot for testing and debugging. Having used numerous terminal emulation packages including the likes of HyperTerminal, Tera Term, PuTTY etc I have yet to find anything that perfectly suits my needs.

So I decided to design my own. Here it is, simpleTerm (that's simpleTerm not simpleTon). Its written entirely in Visual Basic .NET. Its pretty simple. Only the serial port and baud rate can be selected, the data bits, parity and stop bits are all fixed at 8, None and 1 (which 99% of the time is all i'll be using anyway).


Other features include logging to file. Showing received data as either ASCII or hexadecimal. Sending data as a string or hexadecimal/decimal escape code. Sending preset sequences. Auto add carriage returns on send. Configurable background and foreground colors and remember last connection settings.

The screen shots above and below show me using it to communicate with my bus pirate.


Friday, 8 February 2013

Traktor Compliant MIDI Controller Project - Part 1

For my next project this is something I have wanted to build for a while now. A Trakor compatible midi controller. For those who have no idea what Traktor is its a professional digital DJing application from Native Instruments. Now it operates perfectly fine when using your computers keyboard or mouse but it really comes alive when using an external midi controller such as native instruments own Traktor Kontrol X1 or DJ Tech Tools MidiFighter Pro.

Traktor Kontrol X1
MidiFighter Pro
Now both of these controllers are excellent controllers in their own right but are a) expensive and b) don’t offer the full flexibility of features I would like to have at my finger tips. Solution build your own!

Now traditionally midi devices where connected using 180° five-pin DIN connectors communicating over a twisted pair plus ground configuration. From what I can remember these are current driven and optically isolated to avoid interference between instruments. However luckily the USB audio class supports USB midi devices which makes things a whole lot simpler. All I need is a microcontroller with USB host support and that’s it. In theory.

A while back I purchased a couple of these MinimusAVR boards (made famous by people jail breaking their PS3s).


These things are amazing. For about a £5 you get a small PCB populated with an Atmel AT90USB162 microcontroller and a few bits of extra hardware, a couple of LEDs and a couple of switches. The AT90USB162 has 16KB of flash, 512 bytes of RAM and 512 bytes of EEPROM. But most importantly
it has a full speed USB transceiver on board as well. Perfect. It even has a small bootloader pre programmed that allows you to reprogram it without the need for an external programmer.

The MinimusAVR will form the basis of this project with the additional hardware fitting around it. Now I know there is a complete USB stack for the USB AVR microcontrollers written by a chap named Dean Camera called LUFA which supports numerous USB classes including MIDI. Check out his website.

My plan is to develop a stand alone midi controller with the following features :-
  1. Fully USB compliant.
  2. Support for up to 32 digital inputs (push buttons and rotary encoders).
  3. Support for 8 analogue inputs (for potentiometers).
  4. Support for up to 32 LEDs.
  5. Configurable button mapping.
  6. Possibly some form of display.
  7. Whatever else I can think of as the project progresses.

The project will be broken down and completed in stages :-

First implement a virtual serial device using LUFA. That way communication to and from the microcontroller can be carried out using some form of terminal emulation such as Hyperterminal, TeraTerm or Putty. This will help with debugging during the early stages of getting the hardware working. Messages will be sent to and from the device and once everything is working the virtual serial device will be removed and replaced with a MIDI device instead.

Next add hardware/firmware for reading up to 32 digital inputs. Push buttons switches and rotary encoders. Then add hardware/firmware for driving 32 LEDs. Then hardware/firmware for reading 8 analogue inputs. Possibly some form of display not sure yet. Then once all the hardware is working convert the serial messages into appropriate MIDI messages.