The Indian Mom

by SiddhantG23 in Circuits > Arduino

470 Views, 1 Favorites, 0 Comments

The Indian Mom

IMG_20191211_024149.jpg

You get off of work late and start walking to your car. You don't hear the footsteps behind you because you're too busy fumbling for your keys in your bag and thinking about your Saturday night plans. What happens next? What if someone starts following you? Don't worry you're never going to be alone again. All your loved ones are always protecting you because of The Indian Mom. The way The Indian Mom works is that once you're leaving from somewhere you can click on the widget relating to the amount of time you're gonna reach home in. If you don't reach in the selected time " The Indian Mom " is going to send a text message to all your emergency contacts asking them to check on you if you're in trouble or you're just window shopping while coming home.

Supplies

  • 24x12" White Acrylic
  • Vinyl Printer
  • Laser cutter
  • Glue
  • PIR sensor
  • Arduino Feather Huzza board
  • Breadboard
  • Wires
  • Soldering Machine
  • Scissors
  • 14x11" Wooden photo frame

Building the Circuit

image1 (7).png
IMG_20191207_190245.jpg
IMG_20191208_201624.jpg

Gathering the components:

  • Arduino feather huzza board
  • Wires
  • Soldering iron
  • PIR sensor

Making the connections:

The Connections on the circuit are pretty simple. First, try the circuit on a breadboard to check if the connections are right. Start by connecting the ground on the PIR sensor to the ground on the Huzza board. Next, connect the Power on the PIR sensor to the USB pin on the huzza board. Lastly, connect the output on the PIR to an output pin on the huzza. Attach a resistor between the output pin and the ground. You can also connect an LED to make sure the Circuit works and your PIR sensor works. Refer to the process photos for that.

Writing the Code and Making the Widget

Screenshot_20191213-001206.jpg
Screenshot_20191213-022623.jpg
Screenshot_20191213-022525.jpg
Screenshot_20191213-022633.jpg
Screenshot_20191213-001206.jpg
Screenshot_20191213-022724.jpg
Screenshot_20191213-022701.jpg
Screenshot_20191213-022525.jpg
Screenshot_20191213-022745.jpg
Screenshot_20191213-022756.jpg
Screenshot_20191213-022706.jpg

This section is divided into two parts. The first part deals with the internet service AdafruitIO and IFTTT has 2 feeds that enable us to perform triggers based on the data we send. The second deals with the code required for the Indian Mom to work.

The Code is :

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key. #define IO_USERNAME "SIDDHANTG1994" #define IO_KEY "2dcfd66d0bce474a8f092c51b977159f"

/******************************* WIFI Configuration **************************************/

#define WIFI_SSID "MFA PoD" #define WIFI_PASS "il0vedesign"

#include "AdafruitIO_WiFi.h" AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

/************************ Main Program Starts Here *******************************/ #include #include #include #include

#define BUTTON_PIN 4 #define LED_PIN 13

// button state int current = 0; int last = 0; int timeInSecond = 0; bool emergencySent = false; unsigned long triggerTime ; // set up the 'command' feed AdafruitIO_Feed *command = io.feed("emergency");

void setup() {

// set button pin as an input pinMode(BUTTON_PIN, INPUT_PULLUP); pinMode(LED_PIN, OUTPUT);

// start the serial connection Serial.begin(115200);

// connect to io.adafruit.com Serial.print("Connecting to Adafruit IO"); io.connect(); // set up a message handler for the 'command' feed. // the handleMessage function (defined below) // will be called whenever a message is // received from adafruit io. command->onMessage(handleMessage);

// wait for a connection while(io.status() < AIO_CONNECTED) { Serial.print("."); delay(500); }

// we are connected Serial.println(); Serial.println(io.statusText());

}

void loop() {

// io.run(); is required for all sketches. // it should always be present at the top of your loop // function. it keeps the client connected to // io.adafruit.com, and processes any incoming data. io.run();

if(triggerTime!=0){ if(digitalRead(BUTTON_PIN) == HIGH){ current = 1; Serial.println("Sensor detected"); } if(millis()-triggerTime>timeInSecond*1000){ Serial.println(current); if(current==0){ if(!emergencySent){ emergencySent = true; command->save(current); Serial.println("Emergency initiated"); } } }else{ } } // grab the current state of the button. // we have to flip the logic because we are // using INPUT_PULLUP. // if(digitalRead(BUTTON_PIN) == LOW) // current = 1; // else // current = 0;

// return if the value hasn't changed if(current == last) return;

// save the current state to the 'command' feed on adafruit io //Serial.print("sending button -> "); //Serial.println(current); //command->save(current);

// store last button state last = current;

} void runFunction(int timeInSecond){ } // this function is called whenever a 'command' message // is received from Adafruit IO. it was attached to // the command feed in the setup() function above. void handleMessage(AdafruitIO_Data *data) {

int command = data->toInt();

if (command == 15){ //light up the LED triggerTime = millis(); timeInSecond = command; emergencySent = false; Serial.print("received <- "); Serial.println(command); digitalWrite(LED_PIN, HIGH); delay(500); digitalWrite(LED_PIN, LOW); } else { Serial.print("not received <- "); Serial.println(command); } }

Making and Assembling the Final Model

IMG_0251.PNG
IMG_20191209_161041.jpg
IMG_20191209_161627.jpg
IMG_20191207_182226.jpg
IMG_20191211_024128.jpg
IMG_20191211_024149.jpg

You can start by drawing the character on in Illustrator. You can draw any character you want. Laser-cut the shape on white acrylic and print the character on Vinyl to later stick it on the acrylic. Make a hole in the transparent acrylic on the wooden frame in order to put the PIR sensor and hide it behind the character. This is a super simple safety device for women that can be made at home for under 20$. Give it a different shape, let your imagination go wild and lastly be safe .