DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Threat Detection: Learn core practices for managing security risks and vulnerabilities in your organization — don't regret those threats!

Managing API integrations: Assess your use case and needs — plus learn patterns for the design, build, and maintenance of your integrations.

Related

  • Upgrade Your Hobbyist Arduino Firmware To Work With STM32 For Wider Applications
  • How to Stream Sensor Data to Apache Pinot for Real Time Analysis
  • How To Check Tuya Library in Arduino IDE
  • Setting Up Your Own Arduino IoT Cloud Server

Trending

  • Designing Scalable and Secure Cloud-Native Architectures: Technical Strategies and Best Practices
  • Storybook: A Developer’s Secret Weapon
  • Ditch Your Local Setup: Develop Apps in the Cloud With Project IDX
  • Smart Routing Using AI for Efficient Logistics and Green Solutions
  1. DZone
  2. Data Engineering
  3. IoT
  4. MotionSense Not-E-FYE: Motion Activated Pushbullet Notification to Smartphone

MotionSense Not-E-FYE: Motion Activated Pushbullet Notification to Smartphone

Create a motion-activated Pushbullet Notification to your smartphone.

By 
Anupam Datta user avatar
Anupam Datta
·
Jun. 28, 15 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
812.5K Views

Join the DZone community and get the full member experience.

Join For Free

motionsense is a motion activated pushbullet notification system for your smart and handheld gadgets. it detects activity and notify you to take action. it consists of an arduino with wifi connectivity and one pir sensor to detect activity.


list of materials i used :

  • arduino mega 2560

  • esp8266 serial wifi esp-01 variant

  • hc-sr501 pir sensor

  • 1000 µf capacitor, different resistors [ capacitor for wifi power supply, resistor for voltage regulation ]

  • single thread 0.5mm wires [ connector lead ]

  • female-female jumper wires [ connectors ]

  • xperia z1 [ for pushbullet app, any smartphone will do ]

  • my laptop [ coding in arduino ]

  • arduino ide [v1.6.4]


first you need to set up your pir sensor








turn yellow potentiometers in this fashion to get highest sensitivity

now connect with aduino :

  • pir gnd -> arduino gnd

  • pir vcc - > arduino 5v

  • pir out - > digital pin 2 [ you can choose pin according to your choice and change in arduino code also ]


connect esp8266 wifi with arduino









  • esp8266 gnd - > arduino gnd

  • esp8266 uxtx (transmit pin) -> arduino rx2 (arduino mega receiver pin, ie. serial2 in code)

  • esp8266 ch_pd (make high) -> arduino 5v (add one voltage regulator 0f 3.3 as esp 8266 can tolerate 3.3v. i have used a resistor as i didn't have voltage regulator. but voltage regulator is preferred)

  • leave rst , gpio2 and gpio0 not connected

  • esp8266 urxd (receiver pin) - > arduino tx2 (arduino receiver pin ie. serial2 in code)

  • esp8266 vcc - > 3.3v of arduino

esp8266 has power issue. at the time of data transmission, it draws power from arduino so much that arduino may restart if arduino is powered via pc usb. even with 5v power supply through power plug may not suffice. hence it is always recommended to use external power supply for esp8266. however in my experiment i used a quick & cheap solution for this. i used one 1000µf electrolyte capacitor to supply enough power to esp8266.

  • longer pin - > esp8266 vcc connected to 3.3v

  • shorter pin - > esp8266 gnd connected to arduino gnd


pushbullet

create account in pushbullet. get access token in account section. in api section you can see different apis for different purposes.

note : here all the api link and urls are provided for https connection and arduino can not use https as it is not that powerful to handle that. hence we will use http version of those apis which is not mentioned here in pushbullet docs but i got this reference from github .

in pushbullet docs for pushing they had mentioned url which is https, so we will use http url and port provided in that github project. also we will add /pushbullet before and rest path they had mentioned.

example :
for notification push to all devices , according to pushbullet doc ,
  • rest path is  : /v2/pushes
  • but we will use : /pushbullet/v2/pushes
  • base url : 173.17.168.19
  • port : 8181

now you need to put logic on arduino.

open this github project

go to experiments folder. there you will find motionsense.ino , your code which will push notification to your smart devices.

copy this code to arduino ide and connect your arduino ( already set up with wifi and pir sensor ).

now change these parameters :

#define ssid "yourssid" /* replace yourssid with your wifi access point name */
#define pass "yourpassword" /* replace your password with your wifi access point password */

you may want to change pir out pin to  your desired pin

#define pirpin 2 /* change to your desired digital pin of your arduino */
#define auth_token "your_token_from_your_account";
/* replace  your_token_from_your_account with your access token*/

also use your access token as mentioned in above snippet.

now compile and run.

it will take time for sensor calibration, wifi module initialization and for connecting to your access point.

you can see these things in your serial monitor.

after everything will done, it will start looping through main loop and you will see

"everything fine | no intrusion "

in your serial monitor continuously.

whenever you go go in-front of your pir sensor, it will detect movement and push notification to your devices.













to get more : http://www.codeproject.com/articles/1002782/iot-motionsense-not-e-fyi


references :

  1. esp8266 at commands

  2. pushbullet through adafruit wifi

  3. esp8266 maker

  4. different esp8266 modules

  5. esp8266 wiki

  6. pir sensor

  7. about hc-sr501

  8. datasheet for pir

  9. more on pir

arduino Smartphone

Published at DZone with permission of Anupam Datta. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Upgrade Your Hobbyist Arduino Firmware To Work With STM32 For Wider Applications
  • How to Stream Sensor Data to Apache Pinot for Real Time Analysis
  • How To Check Tuya Library in Arduino IDE
  • Setting Up Your Own Arduino IoT Cloud Server

Partner Resources


Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: