Category Archives: Raspberry Pi

Secret project – MotorPiTX motor board

I soldered together my MotorPiTX motor controller today and fitted it to the robot:

Robot with MotorPiTX board

Robot with MotorPiTX board

It’s a hell of a lot neater than my original effort, and only trails one wire. It goes forwards and backwards now too. To the left of the blue relay near the top you can see my homemade heatsink attached to the voltage regulator:

Heatsink detail

Heatsink detail

The robot in action, being driven by a Go program on the Raspberry Pi:

Next up, getting the camera working, and figuring out a better power supply/battery.

Tagged

Secret project

Tiny motor

One of my new motors. It’s about 10mm in diameter

I’ve started work on a top-secret project. I can’t really hide the fact that it’s going to be a robot, but I’m not going to say what it is, at least not just yet.

So, last night I was designing a 3d printed mount for the tiny 3-6V motors I bought and I started to wonder if I could cobble something together using my old technic lego. I dug out the lego, but on top of that was my dusty old meccano set, even better!

WIthin a short amount of time I had some motor mounts and a frame made, including tensioning springs for the caterpillar tracks. All that was left was to take it for a spin. I hooked it up to my Raspberry Pi via my Custard Pi breakout board, a ULN2803A and a custom voltage regulator circuit.

Meccano wheel mount

Motor mount

Seeing if it drives in a straight line:

Hooked up to the Raspberry Pi, controlled by microswitches. You can see the top of the Custard Pi poking out over the mess of wires that is my breadboard and the cheap wireless dongle/antenna I got from eBay. The voltage regulator circuit makes an appearance being dragged along behind:

MotorPiTX

MotorPiTX kit

Right now it only goes forwards because I didn’t have the circuitry for anything else, but I got my MotorPiTX in the mail this morning so that will change soon.

Tagged ,

go-piglow, a lib for controlling the piglow in Golang

piglow

A few days ago I got a Piglow. It’s a fairly useless but fun addon board for the Raspberry Pi that has 18 individual user controllable LEDs arranged in Arms/Legs/Tentacles (whatever you want to call them).

There are example programs out there to control the LEDs, but they are all in Python, and on my Pi they are all fairly slow so I wrote my own lib for Go:

https://github.com/wjessop/go-piglow

The API is fairly strigthtforward, this sample program just turns on and off some of the LEDS:


package main
import (
"github.com/wjessop/go-piglow"
"log"
)
func main() {
var p *piglow.Piglow
var err error
// Create a new Piglow
p, err = piglow.NewPiglow(); if err != nil {
log.Fatal("Couldn't create a Piglow: ", err)
}
p.SetLED(0, 255) // Set LED 0 to 255 (max brightness)
p.SetLED(1, 128) // Set LED 1 to half brightness
err = p.Apply(); if err != nil { // Apply the changes
log.Fatal("Couldn't apply changes: ", err)
}
}

view raw

piglow.go

hosted with ❤ by GitHub

The lib API allows for controlling individual LEDs, the colour rings, the tentacles, or to display a value bar-graph style on each tentacle.

I wrote some more complex example programs to go with the lib to demo these capabilities. A simple program to flash the LEDs, a CPU meter that displays 1, 5 and 15 minute load average on each of the tentacles, and the most fun, a disco program, here is me demonstrating them:

Right now i’m running this program on my Pi to slowly fade between the colour rings.