Archive | Hardware

PowerControl Home Automation

You might have already seen my PowerTray tool in an earlier post.  I’ve made some big changes to the tool so I thought it warranted a brand new post.

The Power control suit allows you to control external devices in your home. PowerControl supports the following output controllers:

Using PowerControl with one of the above and a simple relay or solid-sate-relay arrangement you can control any appliance in the house.

PowerControl operates in a server/client architecture. It consists of the following components:

PowerControl Server Service (Server)

This windows service is responsible for controlling hardware, whether it be attached via Parallel port, print server or K8055. The PowerControl Config tool is used to add and remove devices which are controlled by this service. The PowerControl service can be managed from any PC on the network using the PowerControl Config tool (All tasks except configuring the local service instance, this must be done by running the config tool locally on the PC which runs the service).

PowerTray (Client)

PowerTray provides a system tray menu which is used to interact with a PowerControl server to turn devices on and off.  It can interact with any number of PowerControl servers and can be run on any number of PCs on the local network.  This means multiple PCs have access to the same devices. The PowerControl service maintains the state of these devices and updates each instance of PowerTray. For example You might turn on a Lamp from PC1 then turn it off later from PC2.

PowerCmd (Coming soon!)

PowerCmd is a command line tool which allows you to interact with a PowerControl service. This allows you control devices from other programs and scripts.

Version History (2008-08-24) (PowerTray)

  • Initial release (2009-03-21) (PowerTray)

  • Lots of little bug fixes and better error handling (2010-11-10) (PowerControl) Current release

  • Added support for K8055 USB
  • Added support for Windows 7
  • Split service config from PowerTray client
PowerControl (2704 downloads)

Parallel Port Power Control Utility

*Update I’ve released a new version of Power Control *

*Check out the new Post Here*

As promised when I posted about the print server power control Hack, I’ve finally gotten around to writing a little windows app to control devices from the system tray. The utility is called PowerTray, it can control local devices or devices connected to a networked computer as long as they are also managed by PowerTray.

PowerTray Screenshot

PowerTray can also integrate with MyPowerControl in MediaPortal HTPC system. If you’re using this with MediaPortal then only install either PowerTray or the MyPowerControl plug-in in a single computer not both!

Source is available in the MediaPortal plug-ins SVN
Version History (2009-03-21)
-Lots of little bug fixes and better error handling (2008-08-24)
-Initial release

0.3.0 –  (Read about and download the new version of PowerControl)


Print Server Power Control Hack

Power Control Box

A few years a go I built this solid-state relay power control box.

It connects to a parallel port allowing me to turn the power points on and off using software. The parallel port allows for up to 8 outputs by using data 0 through 7 (Pins 2 though 9).

DB25 Connector

I’ve had this box attached to my HTPC for the last few years; I use it to control power to my TV, subwoofer, table lamp etc.

As mentioned in my previous posts I’ve just finished building a new HTPC, and guess what, it has no parallel port! I thought it would be a simple case of using a USB to parallel adaptor but unfortunately these adaptors aren’t seen by windows as standard parallel ports; instead it appears in device manager as a “USB Printing Support” device hence can’t be addressed directly to turn the data pins on and off.

Print Server

After much googling I came across a project by Doktor Andy which uses a network print server to drive external devices. This was perfect since I had a HP JetDirect print server. I wasn’t able to get Doktor Andy’s circuit working with the JetDirect but Boyan Biandov who’s name was on Andy’s site was very helpful and told me how to get the JetDirect working. A single 74LS04 chip is all that is required to invert the strobe output and feed it back into the busy input, I’m not really a wiz with electronics but as I understand it this fools the print server in to thinking that there is a printer attached and everything is “ok”.

* EDIT *

You DON’T need to use the additional chip at all. Fred kindly commented and pointed this out:

I have a trick to remove the 74ls04 chip : told the printserver ignore the busy data
a simple setting with any snmp tool
npPortCentronicsHandshaking OBJECT-TYPE
ACCESS read-write
STATUS optional
“The handshaking to be used in sending data over the parallel port.”
::={ npPort 4 }

Smply change the value to 2

Gerrit and Milan have included some step-by-step instructions and a video below in the comments below on how to set this SNMP option.

Thanks to all have contacted me and contributed!

* EDIT *

Print Server PCB

Printer Server PCB (Bottom)

The IC requires +5Volts and it is also nessecicary to connect +5volts to pins 10, 13 and 15. It wasn’t hard to find a +5v point on the print server board.


Connections; What needs to be connected to what:

Credit goes to Doktor Andy for this great idea and BIG thanks to Boyan who gave me just the right info when I was about to give up!

Control Software

I’ve created a full windows application to control devices attached to print servers, local parallel ports and K8055 USB boards. Download and read about it here.

Here is the simple class which I use to access the print server. Say you wanted to turn on pins 2, 4 and 6. Combine the pin values


Required value to tun on pins 2, 4 and 6 is 1+4+16=21

Call the output method specifying the port as ipaddress:port and the output value:

(Most print servers use tcp port 9100, multi port JetDirects use 9100 for port one, 9101 for port two etc)


using System.Net; using System.Net.Sockets; using System; using System.Collections.Generic; using System.Text; namespace PowerControl { class IpPortAccess { public static void Output(string port,int value) { string[] ipport = port.Split(new char[] { ':' }); string _ip = ipport[0]; int _port = Convert.ToInt32(ipport[1]); Socket soc = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); soc.Connect(_ip,_port); byte[] sendData = new byte[1]; sendData[0] = Convert.ToByte(value); soc.Send(sendData); soc.Close(); } } }