Raspberry Pi Data Logger with InfluxDB and Grafana

A need popped up at work for a data logger for various lab tasks. Quickly looking at the market, I failed to identify a lab tool for data logging (cheap, easy but powerful setup, remote access); something for researchers and scientists. I decided a Raspberry Pi with some input buffering would be ideal for the task. This is my roll your own data logger, put together on Saturday – showing what is possible quickly and potential with more development time.

Continue reading Raspberry Pi Data Logger with InfluxDB and Grafana

Raspberry Pi DAC – MCP4725 with wiringPi

The Raspberry Pi lacks a DAC but using the I2C bus, one can easily add a device like the 12bit MCP4725. The GPIO library wiringPi provides support for I2C devices, however, getting the MCP4725 working with it isn’t a simple as one might hope. The device is 12bit but the I2C protocol works on bytes (8bits). To send 12bit data, the Microchip designed the message transfer like this:

The MC4725 expects the 12bit data to be broken into two bytes and sent directly after each other.
The MC4725 expects the 12bit data to be broken into two bytes and sent directly after each other.

Continue reading Raspberry Pi DAC – MCP4725 with wiringPi

Developing Simulink Device Drivers for ARM Cortex

Simulink Embedded Coder offers an ARM Cortex-M support toolbox, which includes code optimisation for the MCU and QEMU emulation but lacks any S-Block drivers for the device. The lack of drivers limits the Simulink development to merely number crunching. You can create cevel blocks that execute external C functions but this requires separate source files with a shared header and pre-defined initialisation, leaving the model without full control of the hardware. In this post, I go over the process of creating hardware driver S-Blocks.

Continue reading Developing Simulink Device Drivers for ARM Cortex

Building Atmel Studio ASF Project using External Makefile

The Atmel Studio IDE is a useful tool thanks to the comprehensive debugging support and management of project drivers via the Atmel Software Framework (ASF) – coming from a hardcore Vim advocate. One thing I dislike about IDEs is the fact they hide the make process from the user making it difficult to break a project away from the software. On wishing to develop code on different operating systems (being Visual Studio based, Atmel Studio is limited to Windows), and outside the IDE, I set about creating a Makefile for an Atmel Studio project built around the ASF.

Continue reading Building Atmel Studio ASF Project using External Makefile

Boblight Web GUI Control RaspBMC

Boblight GUI Control

Since setting up an boblight on my RaspBMC, I’ve been wanting a nice gui to manage it; turn it on and off, change colours.

I was going to make a plugin to improve my Python knowledge but decided a web plugin would be more flexible as it would be controllable from any device. Using Chris Oattes’ TV Control page as base, I moulded the PHP to be compatible with the standard RaspBMC setup, which currently uses the boblight-dispmanx service. The standard XBMC web server doesn’t support PHP and I couldn’t figure a way of getting it to, so my solution requires setup of another lightweight webserver: lighttpd:

You’ll get an error as lighttpd will try to assign to the default web port 80 but libmicrohttpd will already be running on that. You could disable it but I use for remote control. Instead change the default port to something else, I use 3000:

Change server.port = 80 to 3000. Then sudo service lighttpd force-reload

Set the permissions for the server folder:

Now all that is left is to copy my boblight control page to the /var/www directory:

Visit http://[your raspbmc ip]:3000/boblight to set any static LED colour, disable the dynamic lights or turn off the lights all together. I plan on adding function to edit the boblight.conf settings and implementing some more visual effects.

Boblight with Raspbmc – Ambilight Clone

When I first started seeing the Ambilight (Philips’s lighting system that allows the display to bleed out) clones popping up I knew I wanted to create one myself. The open-source system has been fairly well refined to this point, such that it is pretty much plug and play with Raspbmc (XBMC for the Raspberry Pi). ‘nadnerb’ has already created a tutorial for the process, which I followed, so I won’t go into the process here. This post is just to share my results.

Testing before install to avoid any aggravation!
Testing before install to avoid any aggravation!
I opted for some old trunking to hold the LEDs, held using hot glue. The trunking is stuck using double-sided duck tape.
I opted for some old trunking to hold the LEDs, held using hot glue. The trunking is stuck using double-sided duck tape.

AirPi: DIY Airplay Speakers using Shairport and a Raspberry Pi Updated

My last AirPi post has been popular – and still is – but part of why of like Arch linux is that it is constantly updating so you must be hands on, learning a new part of the OS the hard way!

Since my post a year ago, Shairport has some new features and dependencies, and Arch has moved to the systemd service manager, changing the tutorial process somewhat. In order to update it, I have run through the process with the current build (2013-02-11).

Continue reading AirPi: DIY Airplay Speakers using Shairport and a Raspberry Pi Updated

MacBook Core Duo Goes Solid State

Why Replace My 2006 MacBook HDD with SSD

My MacBook is the 2006 original; the white Core Duo 32bit. I got it upon starting University and that ended up taking six years. Amazingly, it is still going strong and whilst I want a nice retina MBP, it would be truly frivolous, given how well this one still runs.

Over the years I have given it a number of upgrades: 70GB > 500GB HDD, 512MB > 2GB (max for Core Duo) ram, new battery and a complimentary top deck from Apple (long story). Now I was turning to an SSD.

Continue reading MacBook Core Duo Goes Solid State