Back to Parent

Process

Step1: Define basic logic



Step2: Get familiar with the FSR sensor



Step3: Record sleep start and end status

Detect sleep start and end status, and publish the events to the Particle Cloud.



Step4: Sleep data persistence

Since the data on Particle console is temporary, I decided to transfer sleep data from Particle to Google Cloud to make it long-term. I referred to tutorials in Particle docs (https://docs.particle.io/tutorials/integrations/google-cloud-platform/) and here are my main steps:

  1. Add Google Cloud Platform integration on Particle console.
  2. Transfer data from Particle to Google Cloud Pub/Sub.
  3. Store data from Pub/Sub in Google Cloud Datastore.



Step5: Use IFTTT to tell the pillow when to buzz

  1. Create a new applet on IFTTT with two services: Data&Time and Particle.
  2. Wire the buzzer to the circuit.
  3. Define and register a function called "alarm" to Particle Cloud so that IFTTT can call it directly.



Step6: Play the music!

I referred to a tutorial on Arduino (https://www.arduino.cc/en/Tutorial/ToneMelody) to learn how to code music for the buzzer.



Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0