Back to Parent

Outcome


Intention

My little one took his first steps recently. He is on the move and into everything. Being first time parents my wife and I are still learning how to “baby-proof” our home. And although we change a lot of things, there are still certain areas, like where the TV plugs to the wall, that can be a little precarious. I plan to create a baby sensor to be placed in one of these troublesome spots that will notify my wife when she is just out of range to catch him herself.


The Product is a PIR sensor that is positioned to sense when a baby is near something dangerous.  The sensor turns on an LED when motion is sensed and then publishes an event.  While the event is being published a second LED blinks to indicate publishing.  This event turns on an LED on another particle that is located near the babies parent to notify them there is a dangerous situation brewing.  The mother can than make a decision to push a button to turn on an alarm (piezo buzzer that is located on the sensor photon) that is intended to surprise and freeze the baby while the parent has time to reach the child and remove them from danger.  This button press triggers another event that causes the buzzer to chirp at the baby.  I hope you enjoy the product, please see it demonstrated in the video below.

Context

People make motion sensors all the time so there was a lot of information on how to set on up.  I found the wiring for both the piezo and the PIR sensor from the link below where a guy set up an alarm for his dog to stop drinking from the toilet.  I used his code as a guy as to how to put this together.   

https://particle.hackster.io/31043/toilet-water-protector-119a4d?ref=search&ref_id=pir&offset=4

Key to success of this process was the being able to communicate between photons through the particle cloud.  This is example was used write the code that allows the photons to talk through events. 

https://docs.particle.io/guide/getting-started/examples/photon/#the-buddy-system-publish-and-subscribe

The buttons and led I was able to set up from past experience with Arduino.

Process

Outline your approach to the project? What ideas did you generate and how did you refine or reject them? What did you research and explore? what were the design choices? What challenges were encountered and how did you resolve them?

My approach was to create the two fundamental functions of the device separately then meshed them together.  The first was to get one photon to sense motion.  The second was to get two photons to communicate.

First, the PIR sensor was connected and check to ensure sensing.  Because the example above had basically done this, I used what the toilet dog guy did exactly.  Here I found how annoying the buzzer was and quickly unplugged it.  Then I added a serial communication to the code to add a feedback mechanism for understanding the output of the sensor.  And set the threshold in my if statement for what detected motion was.  I also had to do some searching to figure out how to make the motion sensor less sensitive.  One knob on the PIR is for delay and the other for sensitivity, I found that I had to turn both to get close to the desired sensing, although I never really reached it.  In the future I think I'd like to combined sensors to get a more sensitive read on when my baby's presents is being sensed.  

Second, the communication between the photons was tested in what I will call a separate sandbox.  I wired an LED to each photon and programmed a quick "light show" (series of blinks).  I then published and event when the sequence is done, to get the other photon to begin their "light show".    I doing this I found my second photon (purchased just the other day) blinking red with and overwhelmed memory error (13 blinks between SOS's).  I did some research to try to find people with similar problems, but ended up just trying to understand the error code and tried to code my way around publishing too often.  This brought to life the design choice to incorporate and indicator light that would both provide feedback as I was trouble shooting, as well as providing a meaningful delay in my ecosystem. After do this I was able to achieve the desired result.  

Finally, I integrated the two functions.  This included jumping back an forth from each set of code and working my way through the interaction that would transpire as I planned them to transpire.  And commenting out the buzzer until the very end.  Positioning the the devices was not trivial.  Something that will definitely receive more consideration next time.


Product

  • Materials
  • Wiring
  • Code
  • Video

Qty

Item

2

photons

2

power cables

2

cellphone charger cubes

1

PIR Sensor

1

Peizo Buzzer

2

Breadboards

3

LEDs

3

1K Resistors

1

General Purpose Transistor NPN

1

Button

Code is found below

Mom photon
Show Advanced Options
Baby photon bb
Show Advanced Options
Show Advanced Options
Show Advanced Options
Show Advanced Options

Reflection

The process of making this was very fun!  Almost too fun.  I really feel like the more I make and hackup, the more curious and excited I become.  What starts as a simple idea just seems to grow in complexity as I want to push the boundaries of what the technology is capable of.  For example, when first conceptualized I only planned on using one photon... but after start to build I quickly got online and ordered another.

Some challenges that I encountered were: 1) sensitivity of the sensor, 2) being annoyed by the buzzer, and 3) using events to communicate between two photons.  It took me a while to get the PIR sensor to the right sensitivity by turning the knobs of the sensor.  The buzzer really needs to stay unplugged until the project is ready.  And I spent a lot of time making sure that the photons were not publishing too often in my code.  I got a few red blinks, but now I have learned to code my way around that and be aware of what is being published.


All in all, this was a wonderful experience.  


Drop files here or click to select

You can upload files of up to 20MB using this form.