Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Arindam Biswas
Created March 1, 2020 © CC BY-NC-ND

Kemet-ProxiSense

Kemet-ProxiSense is a mobile device that wirelessly connects to appliances for control and can track activity anywhere.

AdvancedFull instructions providedOver 4 days24
Kemet-ProxiSense

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×2
Proximity Sensor- Pyroelectric Infrared Sensor Module
KEMET Electronics Corporation Proximity Sensor- Pyroelectric Infrared Sensor Module
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×2
Relay (generic)
×1
TinyLily RGB LED
TinyCircuits TinyLily RGB LED
×1
9V battery (generic)
9V battery (generic)
×1
9V Battery Clip
9V Battery Clip
×2
Extension Lead, 3 Outlets
Extension Lead, 3 Outlets
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

Kemet-ProxiSense-Relay

It is the part of the Kemet-ProxiSense device that connects to the home appliances system.

Kemet-ProxiSense-Hexagon

Its is the Kemet-ProxiSense Device.

Schematics

Kemet-ProxiSense_Hexagon

This is the mobile prototype of Kemet-ProxiSense device. This module integrates battery, bluetooth module, Kemet proximity sensor, RGB Led and an Arduino Nano

Kemet-ProxiSense_Hexagon_Fiirtzing

Kemet-ProxiSense_Relay_Firtzing

Code

Kemet-ProxiSense-Hexagon_code

Arduino
This code is for the modular hexagon box which integrates the Kemet pyroelectric SS-430L-N Sensor. The code is configured to filter out and trigger the on/off action which is sent over a Bluetooth link. For aesthetic purposes, the code also drives an RGB led.
/*
Author: Arindam Biswas
Date: 02/28/2020
Contribution: Bruno Calou (Timer Arduino)
Description: This code is for the modular hexagon box which integrates the Kemet pyroelectric SS-430L-N Sensor.
The code is configured to filter out and trigger the on/off action which is sent over a Bluetooth link. For aesthetic purposes, the code also drives an RGB led.
*/

//Define RGB pins
int rGnd=9;
int rB=10;
int rG=11;
int rR=12;
int rDel=50;//ms

//Initialize RGB LED

void RGBInit()
{
pinMode(rGnd,OUTPUT);
pinMode(rR,OUTPUT);
pinMode(rB,OUTPUT);
pinMode(rG,OUTPUT);
digitalWrite(rGnd,LOW);
}

//RGB display function
void RGBPlay()
{
digitalWrite(rR,HIGH);
delay(rDel);
digitalWrite(rG,HIGH);
delay(rDel);
digitalWrite(rB,HIGH);
delay(rDel);
digitalWrite(rR,LOW);
delay(rDel);
digitalWrite(rG,LOW);
delay(rDel);
digitalWrite(rB,LOW);
delay(rDel);
}
#include "timer.h"
int SecC=0;
int Sens=0;
int led_pin = 13;  //Set our led pin
bool led_is_on = false;  //Holds if the led is on

//Timer object
Timer timer;

//Function for checking if any motion exists
//If exists then wait or send light turn off signal

void blinkLed() {
Sens=analogRead(A0);// reading Sensor
if(Sens>200)//
{
Serial.print(1);//Light on signal
}
else
{
SecC++;
if(SecC==30) { //Wait for 30 seconds
digitalWrite(led_pin, LOW);
SecC=0; //reset second timer
timer.stop(); //Stop the timer
Serial.print(0); //Send light off signal
}
}
//Change our led state
// led_is_on = !led_is_on;
}
void setup()
{
RGBInit(); // RGB initialization
pinMode(led_pin, OUTPUT);
Serial.begin(9600);

pinMode(A0,INPUT); // Input pin
//Set the interval in milliseconds we want the led to blink
timer.setInterval(1000);

//Set our callback function
timer.setCallback(blinkLed);

//Start the timer
timer.start();

timer.stop(); // initially stops the timer
}
void loop()
{
//Update the timer
timer.update();
RGBPlay();

Sens=analogRead(A0); //read motion data
if(Sens>200)
{
delay(100); //debouncing delay
Sens=analogRead(A0);
if(Sens>200) //checking if it was a false trigger
{
Serial.print(1); // confirm detection send light on signal
timer.start(); // start the wait timer
digitalWrite(led_pin, HIGH);
}
}
}

Kemet-ProxiSense_Relay

Arduino
This section reads an HC-05 module for incoming trigger signal by serial link and drives the relay to switch appliance accordingly.
/*
* Author: Arindam Biswas
* Date: 03/01/2020
* Description: This section reads an HC-05 module for incoming trigger signal by serial link and drives the relay to switch appliance accordingly.
*/
int data = 9; // recieved data variable
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT); //relay pin 1 goes to coil one positive
pinMode(3, OUTPUT); //relay pin 2 goes to coil two positive
Serial.begin(9600);
pinMode(13, OUTPUT); // Led for indication
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() > 0) // checing if any signal is available to read in the buffer
{
data = Serial.read(); //read serial data
if (data == 49) // Data recieved led turn on
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(13, HIGH);
}
if (data == 48)// Data recieved led turn off
{
digitalWrite(3, HIGH);
digitalWrite(2, LOW);
digitalWrite(13, LOW);
}
}
}

Credits

Arindam Biswas

Arindam Biswas

1 project • 1 follower
Arindam Biswas is a Ph.D. Student at the University of South Florida (Electrical Engineering). He is also working as an RA/TA.
Thanks to Bruno Calou and Penaz Parveen.

Comments