Monthly Archives: June 2017

Raspberry Pi 3B: Learning from the ground up

Over the past couple of months I’ve been working for Dan Wildgen at Amnesia Games, on a specific game called Disenchanted Forest. I designed and built lots of electronic modules – almost all built using the Arduino platform – to detect knock patterns, control lights and faders, door solenoids and a play controller to monitor and pace the game. However, the sound tracks and audio clips of the game were programmed on a Raspberry Pi, so I thought it high-time for me to learn how to program it.

So I got myself a Raspberry Pi 3B, case and power supply…

Raspberry Pi 3B board

I started with the excellent tutorials from Adafruit and have recently just started to play with the PYTHON programming language. As I love light and light pattern animations (walk towards the light…), I decided to learn how to use Python to program WS2811-type addressable LEDs.  However, I soon found that while many code examples appear to work correctly on the rPi3B, there are subtle dependencies to watch out for. As I learn, I shall post any issues and solutions that I encounter.

NeoPixel 2811 Addressable LEDs:

I followed the guides on https://learn.adafruit.com/neopixels-on-raspberry-pi, downloaded and compiled the rpi_ws281x library, and connected up a strip of WS2812 LEDs to the breakout header. So far so good.

ISSUE: However, all of the example files to control the strip just produced random flashing of the LEDs. No control whatsoever!

SOLUTION: It turns out that on the rPi3B there is a conflict in that audio drivers use the same resources required for the strict timing requirements of the WS2812 LEDs (see https://github.com/jgarff/rpi_ws281x/issues/103). The solution that appeared to work for me was to edit the “/boot/config.txt” file and comment out the “dtparam=audio=on” line. However, this solution seems to completely disable all audio, so it’s quite a costly trade-off. Nevertheless, it did work.

# Enable audio (loads snd_bcm2835)
# dtparam=audio=on

More to come…

CNC Porn: Death of a Power Supply

After two fun-filled and care-free days wallowing in CNC heaven as my new 500W Brushless Spindle sped through HDPE like butter, I was shaken awake with a flash of light and a loud “BANG“, quickly followed by a low-pitched scraping and a final “THUD” as the end mill snapped.

The culprit – my brand new 48V 20A 1000W Switching Power Supply – had died in a rather dramatic fashion. This power supply was purchased here on eBay. So, opening up the case here’s what I found…

48V 1000W PSU: the cause of the BIG BANG

48V 1000W PSU: blown 20A! mains fuse (20A at 110V is a F*&K of a lot of power)

Continue reading