dotmana.com

Ce site n'est pas le site officiel.
C'est un blog automatisé qui réplique les articles automatiquement

USB motion sensor (PIR) to wake up screen

Friday 20 June 2014 at 10:13

I have an always on net-book for weather forecast (yeah, when paragliding, you need it)
It basically displays a full screen custom web-page with time and date.

Its always on, not really good for the back-light and energy consumption.

So I got the idea of plugging a PIR sensor to wake up the screen when someone approach it.

Take an Arduino Micro Pro (8€ for the Chinese version), a PIR sensor from eBay (2€), a Hammond case (1€) and an USB A male from scrap (0€).

Let’s give a try, with a basic wiring, and this sketch to emulate keyboard thanks to it’s USB HID, the Arduino Micro Pro is a must.

int sensorPin = 10;
void setup()
{
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);
}

void sendWakeUp(void);

void loop()
{
  if (digitalRead(sensorPin) == 1) 
  {
    sendWakeUp();
    while (digitalRead(sensorPin) == 1)
    {
      delay(1000);
    }
  }
  delay(1000);
}

void sendWakeUp(void)
{
    Keyboard.press(KEY_LEFT_CTRL);
    delay(1);
    Keyboard.release(KEY_LEFT_CTRL);
}
And voila!
Quite nice, discrete and works very well, for about 10€/$.
Note: if someone has an idea to send a key other than LEFT_CTRL (as it can be disruptive on a workstation), I’m looking for a solution.

flattr this!

Source: http://www.dotmana.com/weblog/2014/06/usb-motion-sensor-pir-to-wake-up-screen/