Saving the planet

I’ve moved my printer to another room. Now it’s connected to my continuously running computer. But it’s constantly connected to power and is not really switching off. So I was searching for a solution to switch it of automatically. Using a µC would be nice, but the idea a the moment is to use a USB->serial converter and us the status pin RTS to switch a solid state relay. Today I’ve successfully tested the setup. First I tried with python, which in general is able to set the status of that pin, but unfortunately python is too “high”. During initialization and termination RTS is touched. And I don’t want to “shock” my printer with short switching pulses. But I’ve found this C-code. This allows to keep the state of the pin after termination of the program. This little piece of code exactly does what I need. I’ve added a diode before connecting RTS to the solid state relay to make sure that the relay does not see a negative voltage. I can not yet post a picture of that because my prototype is highly dangerous and I don’t want to provide any examples of dangerous 230V wiring on the net.

The next step will be to set up a cups backend that switches on and off the relay.