computer controlled switch
Edsard Boelen
v0.1, 26-apr-2009
As I am getting more and more comfortable with the atmega88 USB solution, it is time to make a larger system. The scematic is not very original, it will be the default v-usb demo project.
day 0, the idea
The idea is to make some computer equipment be turned on/off by the computer itself. i.e. printer,scanner,amplifier,monitor,lights. But it should also be possible to do it by external buttons, going software only has its disadvantages.
This will be the design:
day 1, the prototype
It has been a nice sunday, and I had all time time to make the prototype, below you can see the result:
day 2, write firmware
I used the firmware from the powerswitch project, modified it to suit the atmega88 controller and added buttons to it. The buttons have a debounce routine. And I removed the timer function, the timer was very clever made, but I didn't need it.
The code can be downloaded here or view the html version below
main.c
day 3, write application and web control
What fun is a switch if it cannot be controlled via the web. I created two system programs:
powerstatus
powertoggle
The first one returns on each line the status of one port. The second one toggles the power with the number of the second argument.