Sonic Switch: Use a Sonic Screwdriver to Turn on Your Computer!

39,055

120

45

Intro: Sonic Switch: Use a Sonic Screwdriver to Turn on Your Computer!

What it is: An Arduino-based light-sensitive switch for turning on a desktop computer.

Why its cool: Use a Sonic Screwdriver to turn on your computer!

Story: This project started, as I'm sure a lot of them do, as a result of boredom and the thought "Wouldn't it be cool if...". I am a fan of Dr. Who. Enough of a fan, I suppose, to spend money on a plastic replica of the good Doctor's Sonic Screwdriver (http://www.thinkgeek.com/geektoys/cubegoodies/8cff/). It was cheap, and it lights up and makes noise _ As a fan of the show (and a CPE/EE), I simply had to have it.

While pondering what to do with my time off, having recently graduated, and while playing with the Sonic Screwdriver, I had one of those "...Duuuuude, Awesome!" moments. And an hour or so and a transistor or two later, I have a device that allows me to do what you see in the video below:


Step 1: The Nitty Gritty

Now we'll get into the technical stuff.

In a nutshell: The photocell is connected in a voltage divider circuit, resulting in a voltage between 0-5V applied to the analog input pin of the Boarduino depending on the amount of light detected. The on-board ADC gives a numerical value based on this voltage. If that value crosses a certain threshold, the digital pin connected to the Base of the transistor is set high, the motherboard power switch circuit is completed, and the computer turns on (or off).

Yes, the circuit can be triggered by any bright enough light source. Like a normal flashlight or, oh I don't know, a camera flash. But its just so much cooler to whip out a Sonic Screwdriver and be all like the Doctor and stuff...Right? Thought so _

A Note: The USB ports on my computer are powered as long as the power supply is on (even if the computer is not running). This provided the power needed for the Boarduino and allowed the circuit to function. I was able to run the USB cable out the back of the case and into a free USB port. Not the best way to power the circuit, I'll admit. I hope to have an updated version of this circuit that provides the same functionality in a more discrete manner. More on that later.

Step 2: The In-Line Transistor Circuit

A relatively simple circuit. Simple enough, even, to unceremoniously slap together and wrap up with a bit of electrical tape. I took off the tape for this picture. You've seen in the previous slide how it looked when finished. The inside of my computer is a rat's nest of wire already. Why not add some more? hehe.

I've said it was a simple circuit. But notice how I totally got the collector and emitter backwards. Yeah. Funny story about me a transistors. For part of my senior design project, we built a giant PVC pipe binary clock. It had 19 LED light clusters, each one needing to be toggled at the appropriate time by a micro-controller. We chose to use a similar transistor circuit that would turn on the light when the pin on the micro-controller was set high. Easy enough. Worked great in prototyping. Worked great all the time, actually. Even as a final product. But one day, our adviser comes in to have a look at the circuit. He asks me to take a look at the "orientation of the transistors."......*facepalm*. Every single one was backwards. But because the current draw of the lights was so low, the circuit functioned fine with the transistors reversed, which is why it never occurred to me during construction. As an electrical engineer, it was a very humbling experience. I told myself I would never make the same mistake again. mmmBahaha. We see how well that went...

(P.S. I hope to have another Instructable up eventually detailing the construction of that clock. Stay Tuned!)

Step 3: The (Bo)arduino Program

So short, It'll fit here. Based on one of the sample programs in the arduino library. Note that the '< 20' bit can be changed to make the circuit more or less sensitive. Having taken the thing apart for this Instructable, I can't, for the life of me, remember which direction results in higher sensitivity (i.e. whether a higher or lower number makes it more sensitive). My apologies. When I throw the circuit back together, I'll update accordingly.

//Sonic Switch Code
int analogPin = 0; //pin a0 on the board
int ledPin = 10; //pin 10 on the board
int analogValue = 0; //value from the ADC

void setup()
{
pinMode(ledPin, OUTPUT);
}

void loop()
{
// read analog input, divide by 4 to make the range 0-255:
analogValue = analogRead(analogPin);
analogValue = analogValue / 4;
if (analogValue < 20){
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
delay(10);
}

Step 4: (not So) Final Thoughts

Looking at it, it seems like a bit of overkill to use the ATMega168-powered Boarduino for such a simple circuit. I had toyed with the idea of trying a purely analog (no micro-controller) circuit to give the same functionality. I suppose it could be done, given the right component values and configuration. But I wanted to have the "Only On or Off" capabilities that a transistor triggered by a digital output pin offered. And I had a micro-controller lying around not doing anything and knew it would be easy to use it to get the desired effect. But I'd definitely be interested to see if anyone has any thoughts on a way to do this using just discrete components. Analog circuit design wasn't my strongest area of study (go figure, huh? hehe).

But I loves me some AVR chips (apparently). I recently purchased a USBtinyISP programmer from Adafruit Industries (http://www.ladyada.net/make/usbtinyisp/) and a couple of ATTiny25 chips from DigiKey. I've got a few projects lined up that might benefit from the tiny yet powerful ATTiny. I'd love to retool the Sonic Switch to use this chip. It certainly would take up less space and not add as much to the clutter already present in my computer. I'll be sure to detail the project in full once it gets underway.

If you've made it this far, thanks for reading through my first Instructable! I welcome any comments, questions, and constructive criticisms.

Share

    Recommendations

    • Optics Contest

      Optics Contest
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge
    • Audio Contest 2018

      Audio Contest 2018

    45 Discussions

    0
    None

    I usually use sleep mode instead of turnoff so i can turn my computer on by clicking on my mouse. Could i maybe hook it up into my mouse or something?

    0
    None

    does it work with the towerless iMacs made in 2011? I forgot to get the upgradable Mac Pro tower

    so I can't really do this easily :P.

    1 reply
    0
    None
    haookenCrafterkid123

    Reply 4 years ago on Introduction

    Possibly, but not without taking the thing apart. I've never cracked one open so I'm not sure how easy it would be.

    0
    None
    TN777

    4 years ago

    Hello fellow whovian. Could this be used to turn on a phone or tablet? Thanks! I will DEFINITLEY be using this if I go to the comic con in my town.

    0
    None
    Hogbroom

    5 years ago on Introduction

    Does this work on computers without plexi-glass sides?

    0
    None
    BookLover715

    5 years ago

    Now that I think about it, sunlight would turn it on too...

    0
    None
    BookLover715

    5 years ago

    Can you not just put in a UV receptor? Do those even exist?

    0
    None
    DustySeven7

    5 years ago on Introduction

    why disable the switch? you could just wire in the borduino in parallel with the switch

    I would never turn my computer on another way. That would never, ever get old. Brilliant, now I know what my next project will be.

    0
    None
    Mr.AustinFTWtinker234

    Reply 7 years ago on Introduction

    Instead of USB power it through the nearest outlet to your door. Then on the hinge side of your door drill out a hole. Stick the photocell in the hole and put a plastic cover on either side (like a window). Then you hook that photocell up to an electric lock on the door.

    0
    None
    Mr.AustinFTWtinker234

    Reply 7 years ago on Introduction

    Put it on an internal door that doesn't matter and only use it for show. (Or use some sort of voice activation and hope noone can make a sonic screwdriver sound)

    Reminds me of something, look up blue box on wikipedia, people could get free phone calls by whistling. Steve Wozinack managed to prank-call the Pope doing it.

    0
    None
    Mr.AustinFTWtinker234

    Reply 7 years ago on Introduction

    Or mod your Sonic Screwdriver to give off an enormous amount of light and make the photocell not very sensitive.

    0
    None
    XOIIO

    8 years ago on Introduction

    This is brilliant! I have an IR port on my laptop, and I am going to order 2 sonic screwdrivers, one to keep and one to mod, then I will find a way to make my laptop react to an IR LED in the screwdriver.

    1 reply