Monday, December 9, 2013

Electric imp automatic door lock @PinMeTo - #IoT

When we, PinMeTo, moved in to our office at MINC in the beginning of September we only had three keys to four persons and an extra key cost 500 sek so i built an automatic door lock for the door. Maybe cheaper to just buy an extra key but not as fun.

Using Everymote to open


  • Electric imp
  • Servo
  • Flex sensor
  • 22KΩ resistor
  • Raspberry pi or server for everymote 

Inside the lock.

Servo to turn the lock

Double sided adhesive and IKEA BEVARA FTW!
Flex sensor to determent if door is locked or not


Everymote lock code

Configure the url to the agent in config.js and start app.js

Happy hacking!

Friday, November 22, 2013

Don't look at me LED jar - Build guide.

This is a fairly easy project to build and only need some soldering and gluing. Video and background to this project can be found here.



  • Spotify
  • Node.js
  • Arduino

Build it

Start by splitting up the led strip to eight half meter stripes and solder it together. The resistors are for reduce ringing and cross-coupled signals. 

Glue the stripes to the jar and put the beat stripe/ring inside the jar. The IKEA jar I'm using is really hard to get the glue to stick to the frosted part ended up using som sort of super glue.

The led strip can be ordered from Adafruit or aliexpress 


Firmware for teensy

Node.js app

Happy hacking!

Wednesday, November 20, 2013

Don't look at me LED jar. #spotify #mmhw #arduino

Running test program

For Malmö music hack weekend (MMHW) I decided to hack something with LEDs. I had the idea of building a led wall that reacted on music and showed different animations. So I ordered 4 meters of 144 LED/m led stripes, a PSU to handel the load of 576 LEDs and a Teensy 3.0. Sadly I didn't finish on time for the presentations and only had the LED wall running a test program to blind the audience with at the end of the hack.

Of corse I had it sort of running before the evening was over.

A week after the hack I start rebuilding it and put it on a big IKEA jar.

Led strip splited up to 8 half a meter strains and glued to the jar.


Running test program

In action

And it can do text to!

The name "Don't look at me LED" is because of when turned up to full brightness it is really hard to look straight at it.

Want to build one? Be back in a week or so for the instructions. 
Build instruction

Happy hacking!

Tuesday, October 22, 2013

Led stripe music visualiser. #spotify #RaspberryPi #arduino

This hack start as a idea to connecting Spotify to philips hue and make them flash in sync to the music. But during the path off the project it become more about led lights =)

Music visualiser built in to TV table

There is four parts in the current configuration

  1. Spotify app
  2. Raspberry pi controlling an addressable led stripe (optional)
  3. Arduino controlling non addressable led stripe (optional)
  4. Philips hue (optional)

The Spotify app

Spotify have an api to get realtime analyse of the playing track so it is possible to do beat detection and other fun stuff. When i started this project I had no idea how to visualities music and just test different things to it locked good. The code is at the moment a mess but you can find it here 

Raspberry pi

The raspberry pi is running a node.js app that is connected to a digital RGB LED Strip LPD8806 from Adafruit and the Spotify app is connecting to the node app using Code  



The Arduino is controlling Ikea dioder and are connected to the Raspberry pi using serial port and changes colour in sync to the beat and intensity to the base band.  

Using aluminum foil as reflector for the dioder 

Philips hue

The philips hue is more as some extra mode lights due to the hub is not not fast enough. Have only bean able to get one light bulb blink in sync whit the music whiteout lagging. 

And of course we have a version of this at our office to :)

Earlier version

For smaller more portal music visualiser check out the LED jar.

Happy hacking!

Updated: Added link to LED jar

Sunday, October 20, 2013

Another Ikea dioder hack. #arduino #ikea #diy

A few weeks ago I hacked a Ikea dioder I got from @achaido and last week I got another version of the dioder from @suhajdab. So here is the hack for the new version.

 Start by removing the microcontroller.

Solder wires to power and ground.

And to the resisters before the MOSFETs controlling the different colours.

Connect it to the Arduino and have fun!

Happy hacking!

Wednesday, September 25, 2013

IKEA DIODER led strip arduino hack

To my surprise it was really easy to hack IKEA DIODER and connect it to an arduino. The only thing that needed to be done is removing the old microcontroller and solder there wires to control the RGB colours and one for +5 v and GROUND.

Connect the power and ground to the arduino +5v and GND. The wires for controlling the control the colours  to pin 3, 5 and 6 and use the code from Adafruit to test.

Other Dioder hacks
A “real” Ikea Dioder hack

Happy hacking

Monday, September 2, 2013

Electric Imp solar powered temperature logger.

The Electric imp is a small chip for connecting things to the internet. Programming the imp is done through their cloud IDE using squirrel.

The first hack I did with the imp was a solar powered temperature logger using a TMP36 sensor and send the data to ThingSpeak




Connect the pin9 on the imp to the middle pin on the TMP36 sensor.


To calculate the temperature from the voltage is Temp °C = (voltage - 0.5) * 100 and to transform the analog value from pin9 to voltage is V = supplyVoltage * / 65535.0.

ThingSpeak graph

Happy hacking

Tuesday, June 11, 2013

Build your own automated candy machine Part 1.5 Hardware, Arduino

Since we did the first post how to build a candy machine we have moved from using a phidget to use a small Arduino. By using a Arduino we do not need any special software to get it working and only send a simple command over a regular serial port.

We are using a Pro Micro 5v/16MHz from Sparkfun, any small size arduino running on 5v should do. Connect wires to GND, RAW for power and pin 3 for signal. Using the Vcc pin will draw to much power and make the Arduino restart endlessly.

Use double sided adhesive tape to attach the Arduino.  

Clone the git repo or download the ino directly candyServo.ino
Upload the candyServo.ino to the Arduino and test it by connect serial monitor to it and send "give".
Depending on the servo you may need to trim for how long it should spin.

Happy hacking!

Monday, June 10, 2013

Realtidskoppla webben med den fysiska världen @ lat55

Föreläsning och demo om "Realtidskoppla webben med den fysiska världen" av Marcus på lat55

Koden exemple från demo finns:

Happy hacking!

Monday, June 3, 2013

Use #RaspberryPi CSI camera module to stream live video to Bambuser

The new CSI camera module for the raspberry pi make it posible to stream high-definition video without having problem with performance. Streaming with ffmpeg will use about 2-4% and raspivid 1-2% of the CPU.

I am using Adafruit Occidentalis distro that is build on raspbian.
Start by upgrade the Raspberry Pi firmware and install the camera module

sudo apt-get update
sudo apt-get upgrade
sudo raspi-config

Enable the camera

Enable Camera
Enable the camera

More information on how to install the camera module

First ffmpeg need to be removed and install from source. The reason for this is that the package distributed through apt-get is not compiled with H264 suport.
Compiling the code takes a few hours so start it in a screen so it do not stop if losing connection to the pi or do a cross compile.
To use screen

sudo apt-get install screen
Compile and install ffmpeg

sudo apt-get remove ffmpeg
cd /usr/src
sudo mkdir ffmpeg
sudo chown `whoami`:users ffmpeg
git clone git:// ffmpeg
cd ffmpeg
sudo make install

Now it is time to get your stream url and key from Bambuser

raspivid -t 9999999 -w 960 -h 540 -fps 25 -b 500000 -o - | ffmpeg -i - -vcodec copy -an -metadata title="Streaming from raspberry pi camera" -f flv [url]/[id]

If the image need to be flipped or mirrored -hf and -vf can be use on the raspivid command.

-hf, --hflip    : Set horizontal flip
-vf, --vflip    : Set vertical flip

Now you should be able to se the video on your Bambuser dashboard

This will likely be work with other streaming services as ustream and

Happy hacking