Gadget Programmers | Arduino|DIY PC's Auto Sleep Mode Sensor
DIY PC's Auto Sleep Mode Sensor
  • Anshul Pareek
    Developed By
  • Arduino
    Categories
Overview/short description

Your PC can feel your presence! when you're away it will sleep automatically and wake up when you in front of it.

Requirements / Things Used to build Project

COMPONENTS AND SUPPLIES

A000066 iso both
Arduino UNO & Genuino UNO
1
11026 02
Jumper wires (generic)
4
13285 01
PIR Motion Sensor (generic)
1

ABOUT PROJECT

 

Idea Behind!

As my other project, This System is developed to reduce electricity usage while you are not working anymore on your pc.

The main focus of this project is to reduce electricity usage when your pc is not in use. As So many times i go away from my PC without making it on sleep mode or log it off. So this device will help you to auto sleep when you are not in front of pc and will wake up when it detects any human being in front of pc within a range. To detect Human being we are using PIR Sensor which is very cheap in cost and Arduino UNO.

 

STORY

 

How It works!

In this project I've used Arduino along with processing. In our Arduino code we are gathering data from PIR Motion Sensor which will give digital signals 1 if it detects any Heat object near it other wise it will return o.

Above gathered data will be printed on serial which will be received by processing software and processing software will check whether coming input is 1 or zero if Its one then it means user or any heated object is nearby so it wont make your pc on sleep mode. whenever you move around from your pc PIR Sensor will return 0 signal which will be received and printed by arduino on serial and further will be read by processing software and in the condition of 0 this will run the code to sleep the pc until it gets 1.

PIR Motion Sensor:

It detects heating object like as we are having heat in our body so whenever we go around our pc it will detect our presence and will give instructions to Arduino to do some predefined specific work about sleep and wakeup.

 

Lets make it!

Step-1 :

PIR SENSOR CONNECTIONS:

Gnd => arduino gnd

Vcc => arduino 5v

out => Arduino digital pin 8

You can take help using connection diagram too.

After successful connections.

STEP-2:

copy and paste the Arduino code which is reading signals from PIR sensor and printing on serial.

 

#define pirPin 8

void setup() {

Serial.begin(9600);

pinMode(pirPin, INPUT);

}

void loop() {

PIRSensor();

delay(200);

}

void PIRSensor() {

if(digitalRead(pirPin) == HIGH) {

Serial.println(1);

}else{

Serial.println(0);

}

}

STEP-3:

Run the processing program which is named as pirScreenLock.

You can download Processing code by going below URL:

FOR MAC OS:

http://www.parikshacrack.com/gadgetProgrammers/pir_auto_sleep/application.macosx.zip

FOR WINDOWS 64:

http://www.parikshacrack.com/gadgetProgrammers/pir_auto_sleep/application.windows64.zip

STEP-4:

Now everything is setup you can run your pc with pirScreenLock program this program should be run after arduino code uploaded and must run always. (this will work for wakeup only on mac os as i am working on my pc which is mac os still i've done efforts for win and found code to sleep only. asap i will do wake up for windows also)

 

If you have any query please shout in comments.

Thanks hope you'll like my project.

Code

Arduino:

#define pirPin 8

void setup() {

Serial.begin(9600);

pinMode(pirPin, INPUT);

}

void loop() {

PIRSensor();

delay(200);

}

void PIRSensor() {

if(digitalRead(pirPin) == HIGH) {

Serial.println(1);

}else{

Serial.println(0);

}

}

Credits

To all of the viewers.