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!

Dad status indicator

Obligatory foto of finished project first:

Ever since I was working from home I wanted to make a status indicator, so my wife and kids knew that I was in a video call and could not be disturbed.

Once I saw this tweet by Steve Forde (@cairn4) I knew how the perfect indicator sign should look like and I decided to do my own.

Materials used
1 NodeMCU
2 RGB LEDs
6 220 Ohm resistors
1 Powerbank
1 small breadboard
1 Ikea Ribba foto frame

Plus the help of my lovely wife who is a professional graphic designer! <3

I send the status from my telegram app on the smartphone or the laptop to the telegram bot on which the NodeMCU is listening, so it’s not yet fully automated. Still investigating how I could push a status change in MS Teams to a webhook.
A possible way to do this is via GraphAPI, but I’m not sure if my company will allow me using it.

The NodeMCU is powered by a powerbank. This is nice as there are no cables coming out of the frame. It has a capacity of 1650mAh and with the NodeMCU’s power consumption of 70mA this should get me going through a work day.

Source code is on github.

Magic Mirror

Wanted to have a family info board in the kitchen for a long time. But then these mirrors caught my eye and I instantly loved it. And when the MagicMirror project was featured Project #1 in MagPi I ran out of excuses not to make one.
Installation/setup is amazingly easy and well made! Need to invest time now to learn more about github and node.js to make the most of it!

View post on imgur.com

Got the two way mirror from Plexihof (Lucerne, Switzerland)

Problems faced
Had an old Raspi 2 laying around that was not really reliable and cost me lots of headaches (ie. dropped wifi connection)
So I swapped it for a new Raspi 3. Used a brand new installation of Raspbian Jessie (2017-03-02)

Installation was a breeze. Followed this tutorial.

Problem I could fix

Problems I could not fix

  • MagicMirror does not autostart after reboot. Haven’t really invested time yet as this does not bother me too much
  • Mouse pointer still on screen visible after MagicMirror starts. Also not bothering me too much.

Cost

  • Two way mirror: 50 CHF (+20 CHF shipping)
  • Raspberry Pi 3: 50 CHF
  • Wood, screws, tools, cables, paint: ca 30 CHF
  • Screen: Used an old, unused one

Knock To Open Trasure Chest

The finished box

Preface

My daughter asked me to build her a treasure chest that she could use to store her most valuable things. Obviously she demanded it to have some kind of a locking mechanism so only she could open the box.

First thought was to use a keypad but then her grandfather bought her a diary with a secret code. So I had to come up with something else. On adafruit’s tutorials I came across the Secret Knock Activated Drawer Lock. Use a secret combination of knocks to open the box… An idea I instantly liked a lot. Another great thing about this drawer lock was that it was programmable, which means you can change the knock sequence to anything you like. Continue reading

Primo: Problems and stuck [Updated]

Right now I basically assembled all parts of the board and the Cubetto but it looks like the wireless communication is not working.

List of Problems:

  • Cubetto did not initialize. I could hear the motors stutter but they would not move. Looks like the 4 AA batteries don’t deliver enough juice. Now I’m temporary using an old cell phone charger to deliver the power. No more wireless 😉 but it helps me troubleshooting.
    Might have to go for LiPo batteries.
  • I then tried it out with the XBees installed on the Mega and the Uno (via Wireless sd shields) respectively. But nothing happened.
    Looking at the board’s output over serial I can see that the commands are being sent. And when connecting to Cubetto using the USB cable it also initializes correctly and executes commands that I send from the laptop via serial.

So I made a step back and just wanted to setup a basic XBee connection between the two Arduinos:

I came across this tutorial from Instructables but it is not working for me.

Setup
Transmitter:
– Mega 2560
– Arduino Wireless Protoshield SD
– XBee 2mW Wire Antenna – Series 2 (ZigBee Mesh)

Code:

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
}

void loop(){
  delay(1000);
  Serial.println('h');
  delay(1000);
}

I have the switch on the shield on “USB” while uploading and can see “h”‘s printed in the serial window after uploading. Switching to “Micro” after that.

Receiver:
– Uno R3
– Arduino Wireless Protoshield SD
– XBee 2mW Wire Antenna – Series 2 (ZigBee Mesh)

Code:

int sentDat;

void setup() {
  Serial.begin(9600);
  pinMode(2, OUTPUT);
}

void loop() {
  if (Serial.available() > 0) {
    sentDat = Serial.read();

    if(sentDat == 'h'){
      digitalWrite(2, HIGH);
      delay(1000);
      digitalWrite(2, LOW);
    }
  }
}

Again, having the switch to USB when uploading and seeing the led blink when sending an “h” over serial. Then switching to “Micro”.

And then: Nothing!

How can I troubleshoot this? Any help appreciated.

[UPDATE]

I yanked the shield from the Mega and crossed tx/rx from the Mega to the shield. I also connected the 6 isp connections plus 5v, 3.3v and GND.
I then connected Mega’s rx with Uno’s rx and tx with tx with wires and my blink sketch worked!
I had the switches on the shields both to USB.

But then, when I remove the rx/tx wires the communication is dead. I switched the shield to Micro mode and back to USB, i played around with switching rx / tx… but no luck.

Not sure if I need to make more connections from the Mega to the shield… unfortunately it’s not on shieldlist.org.

[/UPDATE]

Primo: Instruction blocks and interface board

Currently working on painting the parts, glueing the interface board and putting the copper tape to it and also to the instruction blocks. To make it more difficult, the laser cut slots of the instruction blocks are slighlty narrower than the 5mm copper tape. So I need to cut off a bit from the tape so it goes through the slot. Fortunately I don’t have this problem with the too narrow slots on the interface board.

Another thing that was too small were all the holes for the 5mm LEDs on the interface board.

Can’t wait to finally start soldering!

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.

 

Primo Part I: Lasering the stuff

A while ago I backed the amazing Primo project on Kickstarter. Right on schedule, the source files were available by the end of February.

Went to the local FabLab today to laser all the components.
Their lasercutter is second hand and has its hiccups. I ended up lasering all the components twice for best results. So it took me twice the time.

But I’m happy having everything at hand and start assembling. Lots of guidance is also available on Sjoerd Dirk’s Blog.

A weather moodlight

To create a moodlight using Arduino was always in the back of my mind. When I came accross the Spark Core on Kickstarter I also wanted it to be connected to the internet. Spark’s onboard wifi chip would make it easy to have the moodlamp reacting to outside events (apps, web sites, etc.).

In a first step I created a .NET web application that pulls weather data from OpenWeatherMap and according to the condition and temperature it would return two color codes. For example for temperature of 0 to 5 degrees celsius it would return Blue and for condition “Few Clouds” it returned Light Green.

Temperature range is from Purple (very cold) to Red (very hot) and condition is from Purple/Red for severe conditions (Thunderstorm, Hail, Tornado, etc) to White (Snow, etc) to Green (Few/No clouds) and Blue (Rain). Continue reading