How to Build a USB Powerboard and Control it with Python

I previously blogged about the tosr0x, an inexpensive USB relay controller board which I'm using as part of a computerised thermostat.

Having creating to control the tosr0x' relays using Python, I required a device which employs these relays to switch a pair of mains sockets. This device will essentially be a programmable mains powerboard, switching power to a refridgerator and heat belt to regulate the temperature of my home brew.

This is a reasonably simple project. It essentially involves wiring together a handful of components and mounting them inside a box. For the sake of neatness I take the mains input from an IEC socket rather than wiring a cable directly.

The finished product is a mains powerboard which can be plugged into a USB port and controlled by anything that can speak to the tosr0x.

Continue Reading Comments

Controlling a TOSR0x USB Relay Module Using Python

As part of a forthcoming project to build a computerised thermostat, I require a means of programatically controlling a pair of relays to switch mains power.

The brains of my thermostat will be a Raspberry Pi. This credit-card-sized computer is overkill for such a project, but having access to a complete Linux environment will make it relatively simple to do interesting things such as produce graphs, send Twitter updates and expose temperatures via SNMP. It also allows me to code my thermostat in any language that I choose and in this case, I've chosen Python.

One of the Raspberry Pi's key features is its GPIO interface, allowing it to control all manner of electronics. However for v1 of my thermostat I want to focus on software rather than hardware, so I went looking for a relay controller with a USB interface. What I found was the TOSR0x:

Continue Reading Comments