Wednesday, 10 April 2013

Hacking a PacMan Lamp

I recently got given a PacMan Lamp (which can be bought from Firebox) from microsoft because I published a windows store app (called Space Race for those who are interested - its a phonics game for young children learning English!)

The lamp comes with a little remote that lets you select any colour. I just had to figure out how to control this thing with an arduino!

I took the remote to bits, but quickly realized I was going to have to solder a wire per button at least, and this would hardly scale - so I decided the next best option would be to simulate the IR the remote produces.

Lady Ada has a brilliant guide I used to read the IR signals via the arduino. To do this you will need a IR Detector, which I found to hand

Well, I say to hand... No kids toys were (permanently) broken you will be happy to hear

After hooking it all up to the Arduino I was able to pull out the timings of the "On" periods vs the "Off" periods. As advised you ignore the first off, and then look at the time periods for on vs off. It became pretty apparent that most times were around 530 µs, or 1620 µs, and the on periods were always the short time.

Once I had profiled several of the buttons I turned the "Off" periods into binary with the short period representing 0s, and the long periods representing 1s (as shown by column J in the screenshot above.

With enough codes it became fairly obvious that the first 16 bits where always "0000000011110", and the final 3 bits were always "111". After scratching my head for a bit I realised that the first 5 bits, and the last 5 bits where the only things that changed (the middle bits where always "000", and once I had pulled the bits that changed out it was really obvious that they were just the inverse of each other

Now all I had to do was write an arduino script that would take 5 bits, and translate it into the code, and then correctly send it to the IR pins. Heavily borrowing from the sample code Lady Ada provided I was pretty easily able to implement the algorithm. Feel free to grab the code from my GitHub repository. Once you have uploaded your code you will need to add an IR Diode to your arduino as shown in this image (ignore the stuff to the right of the image - thats for hooking up the IR Detector)

(Image from Lady Ada's site)

Now with everything loaded I needed to create a little app that would fire some commands at it. I created the following little library class that wraps everything up.

To use it simply construct the object (passing in the com port the arduino is connected to, then call do command passing in a command you want) as shown below

I'd love to hear what you use this for - I have just hooked mine up to Lync (its like skype for business). It now flashes white and blue when I get a call and when I'm not getting called it's coloured the same as my lync presence. I'll get a video up asap.

8 comments:

Steven Woods said...

That's awesome.

Steve Woods

Furniture Jati said...

Kursi Tamu Monaco Ganesha
Kursi Tamu Sudut
Kursi Tamu Ganesha Mewah
Kursi Tamu Romawi Garuda
Kursi Tamu Flamboyan Kepang
Kursi Tamu
Almari Peluru Jati Jepara
Almari Ukir Jati Jepara Majapahit
Almari Jati Minimalis
Sofa Jati Jepara
Furniture Indonesia
Kursi Tamu Jati
Almari Jati Jepara
Mebel Jepara
Kursi Tamu Minimalis
Kamar Set
Jual Kamar Set
Harga Set Kamar
Kamar Set Jati
Set Kamar Minimalis
Set Tempat Tidur
Set Kamar Tidur
Jual Kursi Tamu
Kursi Tamu Mewah
Kursi Tamu Minimalis Jati
Kursi Tamu Minimalis Jepara
Kursi Tamu Minimalis Terbaru
Kursi Tamu Minimalis Murah


Furniture Jati said...

Meja Makan
Meja Makan Lesehan
Meja Makan Jati
Meja Makan Minimalis
Jual Meja Makan
Toko Meja Makan
Furniture Meja Makan
Meja Makan Terbaru
Meja Makan Minimalis
Meja Makan Minimalis Murah
Meja Makan Minimalis Modern
Meja Makan Minimalis
Meja Makan Bulat
Meja Makan Jepara
Meja Makan Hotel
Jual Meja Makan Minimalis
Meja Makan
Meja Makan Minimalis
Meja Makan Minimalis
Meja Makan
Meja Makan
Meja Makan Benteng Tanduk
Jual Meja Makan
Meja Makan Cafe
Jual Meja Makan
Kursi Meja Makan
Kursi Meja Makan
Model Meja Makan Minimalis
Meja Makan Murah
Kursi Meja Makan
Harga Meja Makan
Meja Makan Minimalis
Jual Meja Makan Minimalis
Model Meja Makan

Furniture Jati said...


Meja Kursi Makan
Meja Makan Lesehan
Meja Makan Jati
Meja Makan Lipat
Meja Makan Kayu Jati
Meja Makan Minimalis
Desain Meja Makan
Daftar Harga Meja Makan
Meja Makan Kaca Minimalis
Meja Makan Bulat
Harga Meja Makan Murah
Jual Meja Makan
Meja Makan Antik
Harga Meja Makan Minimalis
Set Meja Makan Minimalis
Meja Makan Jepara
Meja Makan Restoran
Meja Makan Restoran
Meja Makan Kayu Jati

Furniture Jati said...


Lemari Pakaian Murah
Lemari Pakaian Minimalis
Model Lemari Pakaian Minimalis
Model Lemari Pakaian
Contoh Lemari Pakaian
Desain Lemari Pakaian Minimalis
Lemari Pakaian Gantung
Harga Lemari Baju Murah
Lemari Baju Anak
Harga Lemari Pakaian 3 Pintu Sliding
Model Lemari Baju
Lemari Murah
Almari Jati
Lemari Pakaian Bayi
Lemari Furniture
Mebel Lemari
Lemari Pakaian Ukir Jati Jepara
Lemari Pakaian 4 Pintu

Furniture Jati said...

Lemari Pakaian Jati
Selamat Datang Di Furniture Jati
Lemari 3 Pintu
Harga lemari Baju
Lemari Pakaian Jati Minimalis
Jual Lemari Pakaian Minimalis
Harga Lemari Pakaian
Lemari Pakaian Jepara
Lemari Pakaian Anak
Lemari Baju Dua Pintu
Lemari Pakaian 2 Pintu
Lemari Pakaian 3 Pintu
Lemari Pakaian 4 Pintu
Lemari Pakaian Kayu Jati
Lemari Pakaian
Lemari Pakaian Sliding
Jual Lemari Pakaian Murah
Jual Lemari Pakaian Sliding
Lemari Pakaian Modern
Lemari Baju Minimalis
Lemari Baju

Furniture Jati said...


Lemari Pakaian Murah
Lemari Pakaian Minimalis
Model Lemari Pakaian Minimalis
Model Lemari Pakaian
Contoh Lemari Pakaian
Desain Lemari Pakaian Minimalis
Lemari Pakaian Gantung
Harga Lemari Baju Murah
Lemari Baju Anak
Harga Lemari Pakaian 3 Pintu Sliding
Model Lemari Baju
Lemari Murah
Almari Jati
Lemari Pakaian Bayi
Lemari Furniture
Mebel Lemari
Lemari Pakaian Ukir Jati Jepara
Lemari Pakaian 4 Pintu

Ferra w said...

salam, nice for post article..
klinik obat kuat
klinik farmasi
obat kuat pria
sex toys wanita