DIY Ambilight

Another project that I wanted to do like forever was an ambilight for my TV. I found great tutorials, the two that helped most (even though their Hyperion installation and configuration is outdated) are https://blog.monstermuffin.org/building-a-custom-ambilight-system-for-any-input-with-a-raspberry-pi-and-hyperion/ and https://www.digitec.ch/en/page/do-it-yourself-building-your-own-ambilight-7251.
A great (and recent) video tutorial is https://www.youtube.com/watch?v=urOEHzbV48A

The parts

Looking at all the parts that I needed and the price tag I decided to wait a bit more and ordered all the parts (minus the pi zero) from aliexpress.

The rest like USB power adaptor, Raspberry Pi Zero W, SD card and all the necessary cables I conveniently had lying around.

Theory
First overview

Soldering the Pi Zero

The LED strip came with two connectors: 1 with red and white cables for the power supply, and one with red, white and green cable.
From the connector with the 3 cables I soldered the green one to pin #12 (GPIO18) and the white one to pin #6 (GND). The red one I cut off so it could not come in the way.
I also soldered a 120 ohm resistor in between the green cable and pin #12. In some tutorials I read that they used a 100 ohm resistor, but I just had 82 ohm and 120 ohm resistors around so I went for the 120 ohm.

Some other tutorials also mention a level shifter, as the raspi works with 3.3V but the LED strip with 5V . Even others use an arduino for that purpose. For me the setup pictured below worked just with the resistor.

Pi Zero wiring
Dry run

Hardware installation

Bending the LED strip

At first, I thought I cut the LED strip and then solder the corners back together. But I saw many builds on the internet where they just bent the strip. This obviously saves lots of work.

Pi Zero Software

Installation of Hyperion on a Raspberry Pi is easiest if you just download the HyperBian image. It is a ready to use image for your Raspberry Pi. I added the ssh configuration plus the wifi setup so once I put the sd card into the zero and booted it up, I could access the Hyperion web interface on port 8090 of zero’s IP address.

I played around in the configuration, for example I set the RGB byte order to GRB and set the LED number in the LED layout section.

Under “Capturing Hardware” I checked the “Enable USB capture” check box. Apart from that I can’t really remember changing anything from the default setup. Pretty straightforward!

Pretty happy with the outcome!

DigiSpark helps monitoring a log file

At work there was a problem with a tool that archives documents. Whenever that tool failed doing its task it would write an error code into a database table.
So some unfortunate user had to check that table for that error code about three times a day, would open that document in Word, save it and update the error code.

I got the order to write a program to automate the whole process. I used c#/.NET for the whole thing. The Task Scheduler would call this program every five minutes and would write its findings into a log.

Because I tested it I was pretty confident it would work smoothly. But what happened now was this: I would check the log regularly if my program picked up the wrong documents and corrected it. Instead of somebody checking the database for errors I would now check the log for the error indications!

So I wrote a second program – again in c#. It would check the log file and if it detected that the tool picked up and fixed a defect document it would then blink the DigiSpark‘s RGB led and turn from green to red. For this I used DigiStump’s DigiRgb.exe basically the same way I used it in my Minecraft mod.

I love it: It saves me a big amount of time of checking a log for something that hardly ever happens. Plus: It looks really cool on my desk 🙂

DigiSpark with RGB shield

DigiSpark indicating that all is good. If it detects an error log it blinks red ten times and then stays red until manually reset.

 

Connecting to Arduino using Processing and bluetooth (HC-05, HC06)

USB bluetooth dongle

USB bluetooth dongle

The other day I bought myself a USB bluetooth dongle for my HP laptop and a HC-05 bluetooth adapter for the Arduino.

When I connected the dongle to my laptop running Windows 8 it appeared like it would install the default drivers for it. I connected the HC-05 to an Arduino and I could locate it from my laptop. I could even pair the dongle with the adapter. (Default code: 1234.)

HC-05 bluetooth module

HC-05 bluetooth module

But when checking the HC-05 in Windows’ device manager its status would say “Offline”. It took me several hours of googling until I came across a suggestion by another user that bought the same dongle on amazon: I installed the Toshiba Bluetooth Stack! Even though it says it’s only for toshiba laptops it worked on my HP like a charm.

I also had a HC-06 adapter lying around. Optically they look very similar. As far as I know HC-05 can work as master or slave whereas HC-06 is slave only. If you use them as slaves you can use either of them using the same pins. HC-05 came up under COM40 and HC-06 identifies itself as “linvor” under COM41.
Continue reading

Nikon Intervalometer with a Digispark

Years ago I bought myself an IR remote for my Nikon D40. That worked ok, but of course I wanted to build my own using a Digispark.

There’s lots of tutorials for IR remotes out there, like LuckyLarry’s. I then later came across the nikonIrControl library which basically allows you to trigger a photo with a single line of code! Best of it is this library will work for every camera supported by ML-L1 and ML-L3 such as D40, D40X, D50, D60, D70, D70s, D80, D90, D7000, D5000, D5100, D3000, Coolpix 8400, 8800, P6000, P7000, P7100, Nikon 1 J1/V1.

And because the intervalometer should be as tiny as possible I was using a Digispark to control everything.
Continue reading