NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » Turning on COmputer without Switch

March 04, 2011
by dgikuljot
dgikuljot's Avatar

Hey guys, I am working on a project to turn on my computer with an Rf Transmitter. I want to be able to turn on the computer by only tapping into the wires of the PSU. I know grounding the green wire turns on the PSU, but it doesnt power up the motherbaord so i was wondering if there are any other wires that need to be connected to each other to make this happen. Once again i dont want to use the switch or the pins where the switch connects on the motherboard, i want to strictly do thiswith the Wires of the PSu. Thanks, kuljot

March 05, 2011
by Rick_S
Rick_S's Avatar

My understanding is that most all modern motherboards get some voltage from the PSU to provide power to the circuitry that powers everything up. The only way you will wake the motherboard electronics is through it's power switch connections. Otherwise, as you've found, all you will get is a power supply that is on with a motherboard that is still off. I don't know of any way to start a modern pc without using it's power switch connections.

March 05, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

I think Ralph is right, you will need to tap the wires on the mother board that control the power supply. If you find a way to do this do let us know.

Humberto

March 05, 2011
by Rick_S
Rick_S's Avatar

Now Humberto, I know Ralph and I look so much alike and all but try not to get us confused... :D

March 05, 2011
by Ralphxyz
Ralphxyz's Avatar

Darn, and I hoping to get some credit for being helpful.

RALPH

March 05, 2011
by Rick_S
Rick_S's Avatar

LOL Ralph :D

March 05, 2011
by dgikuljot
dgikuljot's Avatar

Dang it my dreams ruined. EVeryone Thanks for replying. I was going to build a Rf circuit and had plans to maybe sell it so people could boot their Pc's with remotes. I could still do it, but it would mean harder install for customers. Now they would have to tap into the switch wires. Originbally all they had to do was to plug in an adapter into the Psu connector where it plugs into the motherboard.

March 05, 2011
by Noter
Noter's Avatar

Isn't the power switch connected to the motherboard via two wires to a header on the board? Seems simpler to tap in to that connector than the power connector anyway. There are different power connectors for different pc flavors but they all have two wires on a header for the switch ... at least I think they do?

March 05, 2011
by dgikuljot
dgikuljot's Avatar

Ok guys I need a little mor helP. My question is how do I specify weather the mcu will output a +5 or a ground. Also is t possible to take 1 wire into mcu and connect that input to an output wire

March 05, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

@Ralph and Rick,

Sorry guys, you are both so helpful on our forums my head gets a little confused sometimes.

@dgikuljot. A digital output on your MCU is either a GND or a +5. So you should be able to use any old digital pin for that. I recommend looking over the LED blink project in the NerdKits Guide, we talk extensively about fiddling digital outputs.

Humberto

March 06, 2011
by Rick_S
Rick_S's Avatar

If you are wanting to turn on a computer via the two power pins, I would think the most sure way would be to use the microcontroller to toggle a mechanical relay. The mechanical realay would appear just like the pushbutton on the front of the computer to the motherboard. You'd simply connect it's NO (Normally Open) contacts to the two pins for the power switch on the motherboard. Triggering a relay is a relatively simple task. You'd need to use a transistor to supply the extra current a relay draws (see the motors or servo squirter tutorial).

Rick

March 06, 2011
by dgikuljot
dgikuljot's Avatar

Hey Rick, Thanks for the reply. I know I could use a relay, but my question was is it possible if I take the 2 wires coming from the switch and connect them to different mcu pins, and then somehow with code have both pins connect to each other which would simulate pressing the switch

March 06, 2011
by Rick_S
Rick_S's Avatar

You can't really do that. However, it may be possible to trigger the power switch. It really depends on how that switch connector works. Often switches work by shorting an input to ground. I can't say that is the way the motherboard switch connector works, but if it does, you could possibly drive a pin low to signal the power up condition. You would have to share a common ground between the microcontroller and computer to do this to ensure ground is at the same level.

Rick

March 06, 2011
by dgikuljot
dgikuljot's Avatar

Hey Rick, Yeah the switch basically connects the wire to ground, so basically i can pulse both switch wires ground. I just want to make sure every motherboard is like this, because i do have plans to sell this circuit to friends/ family, and maybe on ebay.

March 06, 2011
by Rick_S
Rick_S's Avatar

I don't want to burst your bubble, or discourage your endeavor. However, the remote pc switch has been done. HERE is a link to one such device.

Rick

March 06, 2011
by dgikuljot
dgikuljot's Avatar

Hey Rick , First of all thanks fOr taking the time to reply to my posts. Also I checked that link it and that's an ir remote, less range , remote needs tO be facing computer etc. I want to make a rf remote switch, mOre range and turn on from anywhere in the house. Do you guys think this is sellable or not. I appreciate your guys opinion

March 06, 2011
by Keyster
Keyster's Avatar

I do like the idea. not sure if it is sellable but i can think of some great places to use it. a large classroom environment for example. one of these places that have rooms full of computers for taking test, classes, etc. walk in, hit a button and they all turn on. sounds very cool. of course they could just use the built in PXE (wake on LAN) so i am not sure if it would sell... i do like your thinking because i LOVE wireless stuff. anything wireless just makes me go gooey inside!!! ;)

what kind of wireless module are you working with? i just started playing around with the RFM22B module. i am thinking about making my LED Cube wireless, my LED scrolling display wireless, etc... once i get the feel for it i am going to use it to send telemetry from an RC airplane back down to a laptop sitting on the ground.

keyster

March 06, 2011
by dgikuljot
dgikuljot's Avatar

Hey Keyster, I haven't really decided on the wireless modules yet. But were not going o be transmitting much data over the remotes so I need a simple cheap one. You have any recommendations.

March 06, 2011
by Rick_S
Rick_S's Avatar

Sorry, I forgot about the RF mentioned earlier. HERE is a link to one someone built using RF transmitter receiver, paired with encoder/decoders to do the task. His project might give you some ideas. Your project is definitely doable with a micro-controller, or even as the other site shows, without. I hope I didn't offend, sometimes I come off differently than I try.

Rick

March 06, 2011
by Keyster
Keyster's Avatar

Other than the RFM22B (probably WAY overkill for what you are wanting) the only other module i have used is the 315Mhz transmitter/receiver combo from Sparkfun.

http://www.sparkfun.com/products/8945

they are much cheaper than the one i am currently working on which is what you will need if you make these in mass and you can also have one transmitter and multiple receivers.

I did have some problems with these modules BUT i would definitely say it was due to my lack of knowledge of how they work not the quality of the modules themselves. These were my first attempt at wireless so i hope that one of the "veterans" may also have some suggestions...

March 06, 2011
by Keyster
Keyster's Avatar

Edit to my prior post: i do not currently see the Receiver i mentioned earlier. when i follow the link from my prior purchase i see that is says "Deprecated". my assumption is that they are coming out with a newer version because they do still sale the transmitter. kind of silly to have the transmitter and no receiver to go along with it...

keyster

March 06, 2011
by dgikuljot
dgikuljot's Avatar

Hey guys, Thank you everyone for the quick helpful replies. I think the avr 168 would be an overkill fOr this as I only need like 5 I/o pins. You guys have any recommendations On any other smaller age that's also cheaper. I only need 5 I/O pins.

March 06, 2011
by dgikuljot
dgikuljot's Avatar

Edit: I meant smaller Avr not age

March 06, 2011
by Rick_S
Rick_S's Avatar

Maybe something like the 8 Pin attiny25/45/85 series. You would have to get an ISP programmer though to program them.

Rick

March 06, 2011
by Rick_S
Rick_S's Avatar

Maybe something like the 8 Pin attiny25/45/85 series. You would have to get an ISP programmer though to program them.

Rick

March 07, 2011
by Noter
Noter's Avatar

Here's a wireless wake on lan for PC's. Uses Tiny AVR's and looks like all the code and schematics are provided. http://www.engbedded.com/wake-on-lirc

I came across it when checking out their Embeded AVR Fuse Calculator - this is a very useful link when it comes to setting fuses - http://www.engbedded.com/fusecalc.

March 09, 2011
by dgikuljot
dgikuljot's Avatar

Ok guys i have one mroe question. According to the nerdkits guide this is how you set a pin to output ground:

PORTC &= ~(1<<PC3);// set PC3 low

the way i do it is : PORTC |= (0<<2).

Is my method good also, or is it bad for mcu in any way.

March 09, 2011
by Keyster
Keyster's Avatar

Dgikuljot, i dont believe your way is doing anything. you are shifting 0 (zero) left twice which will always be zero and then ORing it with PORTC which will not change a thing. anything ORed with zero always remains the same.

remember, what you need to do is turn the bit that is in position PC3 to a zero. here is an example of what the chip does for this command.

step1 - PORTC &= ~(1<<PC3)

step2 - PORTC &= ~(b00000001<<PC3)

step3 - PORTC &= ~(b00000001<<3)

step4 - PORTC &= ~(b00001000)

step5 - PORTC &= (b11110111)

step6 - PORTC = PORTC AND b11110111

let me re-phrase my statement above. this is not Exactly what the chip does, this is a way to visualize what the chip does.

keyster

March 09, 2011
by dgikuljot
dgikuljot's Avatar

I think it does output ground. I connected positive side of led to 5 volt and the negative side to the mcu with my code. And the led lit, so it is outputting ground

March 09, 2011
by Keyster
Keyster's Avatar

it is probably because the default setting of that pin is ground. remove that one line of code and see if it still lights the LED.

March 09, 2011
by dgikuljot
dgikuljot's Avatar

Ok i removed tht line and the led still lights. So what i dont get is how in this line

PORTC &= ~(1<<PC3);

the little symbols set the pin to low

March 09, 2011
by Noter
Noter's Avatar

You will benefit from a better understanding of bitwise operations. You can find many tutorials on the web but here's one to get you started.

http://www.cprogramming.com/tutorial/bitwise_operators.html

March 09, 2011
by bretm
bretm's Avatar

Keyster explained all the little symbols in excruciating detail a few posts above. But let's try it again:

PORTC &= ~(1<<PC3);
           ^

The "1" is just a 1. In binary it's the eight bits "00000001"

PORTC &= ~(1<<PC3);
               ^

PC3 is a macro that simply equals the number "3".

PORTC &= ~(1<<PC3);
             ^

The "<<" symbol is the "C left shift operator". It takes the value on the left and shifts it left by the number of bit positions indicated by the value on the right. In this case it takes "00000001" and shifts all the bits left by 3 positions (PC3). Zeros are shifted in to fill in the new bits on the right. The result of (1<<PC3) is "00001000".

PORTC &= ~(1<<PC3);
         ^

The "~" symbol is the "C bitwise NOT operator". It changes the bits from 0 to 1 and vice versa. In this case it changes "00001000" to "11110111".

PORTC &= ~(1<<PC3);
      ^

The "&=" is the "bitwise AND assignment operator". It causes bits in the result (the left-hand value "PORTC") to get set to zero whenever the corresponding bit on the right is zero. The other bits are left alone. In this case the only bit on the right "11110111" that is zero is the bit in position PC3. So bit PC3 on the left-hand side (PORTC) gets set to zero.

March 09, 2011
by Keyster
Keyster's Avatar

OK, by "the little symbols" i assume you mean the &= and the ~. they are not hard to explain:

i am going to assume you know what Binary is, if not see the video on Binary that was done by the Nerdkits guys. it is here: http://www.youtube.com/watch?v=DzkNB2vMFTU

the "PORTC &= (anything)" just means "PORTC = PORTC & (anything)"; or take PORTC then AND it with (anything) and then put it back in the PORTC memory slot.

the tilde "~" means NOT. it means take all the binary ones and make them zero's and take all the binary zero's and make them one'1.

~b00010001 would be b11101110 for example.

if you are unsure what AND is exactly do a youtube search for it... a video will explain it WAY BETTER than i can in a single forum entry.

i hope this helps...

keyster

March 10, 2011
by dgikuljot
dgikuljot's Avatar

ok guys thanks for all the help with the bits and everything it is very helpful. I have one last question and it is about decoders and encoders. i know these are used in rf circuits, to prevent one remote triggering something else it shouldnt. My question is instead of using encoders and decoders isnt it ok to just have the transmitter transmit a certain code, and then have the MCU on the recicver end check if thats correct before acting on the signal of the remote. This would precent interference by other remotes, right?

March 10, 2011
by Keyster
Keyster's Avatar

there are several ways to handle this but the most common (as far as i know anyway) is called the CRC (Cyclic Redundancy Check). there are also many forms of CRC but the easiest is to just add up all the bytes you are sending and send the answer as the last piece of data (usually 1 or 2 bytes). on the receiving end you just add up the bytes you receive and compare the answer to what it gets through the air. if they match then you are "pretty sure" the data is good and correct.

if you are referring to addressing then that is pretty simple (in small systems). what i do is just send the address as the first byte. if you what to talk to device number 5 you just send a 5 and then the data with a CRC at the end. all receivers that are not number 5 will just see the 5 and ignore the rest of the data. the device you have specified as number 5 will grab the rest of the data, check the CRC and move on with acting on the code. of course you can have 1 device be specified as number 5 or you can have 100 devices specified as number 5 depending on your system. you can even use a DIP switch so changing the address of each device is quick and painless.

keyster

March 11, 2011
by bretm
bretm's Avatar

It sounds more like he's talking about the other way around--making sure only one specific remote will activate the device.

CRC might be overkill. Adding up all the bytes isn't a CRC, it's a checksum. That would probably be more appropriate than CRC. A stronger checksum that's still easy to compute on small MCUs is the Fletcher-16 checksum. That would be useful for detecting if a command was corrupted by interference.

Another thing you can do, which my wireless keyboard and mouse does for example, is to "train" the device and the remote so that they share a randomly-generated ID number, but this requires that both the remote and the device it's controlling have some way of storing data while turned off. The MCU has EEPROM for that.

The way that would work is the user would push the "train" button on the remote. The remote would then wait for a signal from the device indicating that the user also pushed the "train" button on the device. They would then talk to each other to establish a shared ID number. Then, whenever the remote issues a command, it also sends the ID number. If the device receives a command with the wrong ID, it ignores it.

If you need this to be secure, I think the 8-bit MCU is a bit underpowered to do the encryption necessary to keep the ID secret and to encrypt each command, so it's more of a way to prevent accidental commands from other remotes. Just generate four bytes of random data and store that as the ID number on the remote and the device it's controlling. The chances of a different remote sending the exact same 4-byte sequence is about one in 4 billion if the random number generator is good.

March 11, 2011
by Keyster
Keyster's Avatar

oops, i thought that a checksum was a form of CRC. i was thinking that CRC was a broad term that covered a large array of different types of checking data over a stream. my bad.

in my statement above please replace the phrase CRC with Checksum...

keyster

May 04, 2011
by hariharan
hariharan's Avatar

can i set PORTC to 10000000 by programming it

PORTC= b1000000

or

PORTC= B1000000

Post a Reply

Please log in to post a reply.

Did you know that talking to the microcontroller over the USB/Serial link is easy under Windows, Linux, and OS X? Learn more...