Motion Sensor Based Device Control

Optimize the energy consumption by activating your appliances only when human being are present in a room.

BeginnerFull instructions provided24 hours799
Motion Sensor Based Device Control

Things used in this project

Hardware components

MSP-EXP430G2 MSP430 LaunchPad
Texas Instruments MSP-EXP430G2 MSP430 LaunchPad
×1
Power Relay, SPDT
Power Relay, SPDT
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Resistor 1k ohm
Resistor 1k ohm
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1

Software apps and online services

Energia
Texas Instruments Energia

Story

Read more

Schematics

motion sensor based appliance control

Control your appliances using motion sensor and MSP430, Basic circuit connections

Code

code for device control using PIR sensor and MSP430G2 launchpad

Arduino
Connect relay and PIR sensor with MSP430G2 launchpad, PIR sensor o/p is connected on P1_4 and P1_5 is connected to base of the npn transistor which is driving spdt relay
const int PIRPIN = P1_4;
const int RELAYPIN = P1_5;/* PIR sensor O/P pin */
int warm_up;

void setup() {
  pinMode(PIRPIN, INPUT);
  pinMode(RELAYPIN,OUTPUT);
  Serial.begin(9600); /* Define baud rate for serial communication */
  delay(100); /* Power On Warm Up Delay */
   
}

void loop() {
  int sensor_output;
  sensor_output = digitalRead(PIRPIN);
  if( sensor_output == LOW )
  {
    Serial.print("No object in sight\n\n");
    digitalWrite(RELAYPIN,LOW);
    delay(100);
    Serial.println("Switch OFF");
    
  
  }
  else
  {
    Serial.print("Object detected\n\n");
    digitalWrite(RELAYPIN,HIGH);   
    warm_up = 1;
    delay(100);
    Serial.println("Switch ONN");
  
    
  }  
}

Credits

Dr. Umesh Dutta

Dr. Umesh Dutta

38 projects • 53 followers
Working as Director of Innovation Centre at Manav Rachna, India. I am into development for the last 12 years.
Texas Instruments University Program

Texas Instruments University Program

91 projects • 119 followers
TI helps students discover what's possible to engineer their future.
Energia

Energia

34 projects • 26 followers
Founder of @energiaproject
shr k

shr k

1 project • 0 followers

Comments