Intel® Edison Hands-on Day 6: Sensor lamp
Intel® Edison Hands-on Day 6: Sensor lamp
Intel® Edison Hands-on Day 6: Sensor lamp
Intel® Edison Hands-on Day 6: Sensor lamp
Intel® Edison Hands-on Day 6: Sensor lamp

In this section we will try to make a sensor lamp. When

someone passes by the sensor lamp, the LED will be automatically on. Of course, it will be off if nobody is around. We select PIR motion sensor in this example. It allows you to detect whether someone has moved in or out of the sensors range. It is a good choice for April Fools~~

Tools required

  • 1- Digital piranha LED light module
  • 1- PIR Motion Sensor
  • 1- IO Expansion Shield
  • 1- Intel® Edison with Arduino Breakout Kit

    Step 1: Connection

    Intel® Edison Hands-on Day 6: Sensor lamp

    PIR Motion Sensor - Digital Pin 2

    Digital piranha LED light module - Digital Pin 13

    Step 2: Coding

    int sensorPin = 2; // PIR Motion Sensor Pin
    int ledPin = 13; //LED Pin int sensorState = 0; //Store the PIR Motion Sensor State void setup() { pinMode(ledPin, OUTPUT); //LED is an output device pinMode(sensorPin, INPUT); // The Sensor is an input device } void loop(){ sensorState = digitalRead(sensorPin); //Read the sensor state if (sensorState == HIGH) { //If the sensor state is HIGH, turn on the LED digitalWrite(ledPin, HIGH); } else { //otherwise turn off the LED digitalWrite(ledPin, LOW); } }

    After uploading the sketch, trying to go away from the sensor and wait a moment. Pay attention to the LED and it will be off. If you get close to the sensor, the LED will be on automatically.

    Step 3: Principle(Digital Input—Digital Output)

    Intel® Edison Hands-on Day 6: Sensor lamp

    There is three parts of the device, input part, controlling part and output part. PIR Motion Sensor is the input part. Edison is the controlling part. LED is the output part PIR Motion Sensor is a digital sensor, and LED is also a digital device.

  •  
     

    Tag cloud

    make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel