Pulse Sensor Teddy Bear

by mabr5772 in Circuits > Arduino

390 Views, 0 Favorites, 0 Comments

Pulse Sensor Teddy Bear

Screen Shot 2022-12-14 at 7.25.43 PM.png
image.jpeg
Screen Shot 2022-12-14 at 7.29.44 PM.png

This project uses a pulse sensor to take and record your pulse. The design is intended to be used by children who have heart issues and need to take their heartbeat regularly. The enclosure used is a bear, so a kid can feel more comfortable taking their pulse. In addition, the bear will light up and vibrate to your pulse, making the process more fun and less daunting for the kid using the bear. With that being said, this bear can be used for any age, you never get too old for a teddy bear.

The pulse sensor I will be using is the one from the pulse sensor playground (psp). Its library is built for you to get the most accurate data of your pulse by using a PPG. A PPG is what you will typically see medical professionals use for taking your heart rate. The pulse sensor I am using reacts to the light that is reflected back to the sensor. In other words, the amount of light that is reflected back from the green LED will help the sensor detect when your pulse is; the more light it detects, the higher the signal value will be. The pulse sensor playground library will then take the sensor analog inputs and try to find a pattern, your BPM. The sensor works like any other analog input sensor. The sensor will send the values to your computer, then the code will detect each time the values exceed the threshold. The unique part about the psp library is that it will calculate the time between each time the values exceed the threshold. It will then find the average time of each period and create your bpm based on those values.

Supplies

Setting Up the Enclosure

Screen Shot 2022-12-14 at 6.45.44 PM.png
Screen Shot 2022-12-14 at 6.46.00 PM.png
Screen Shot 2022-12-14 at 6.46.19 PM.png
Screen Shot 2022-12-14 at 7.26.22 PM.png
Screen Shot 2022-12-15 at 10.37.59 AM.png
Screen Shot 2022-12-15 at 10.38.13 AM.png
  1. In order to place the circuit into the bear, I had to cut an opening in the bear's back. To ensure a clean cut, I had to cut open the seam and glue each end of the opening (this ensures that the seam will not continue to unravel.)
  2. I then applied both sides of the velcro to each end of the opening. The velcro linked in the supplies list has an adhesive backing that will stick to the fabric. I applied the adhesive to the inside of the bear, along the cut.
  3. I then had to put the circuit into the bear. The bear stuffing makes it tricky to insert and position the breadboard, so it is recommended to remove all of the stuffing before inserting the circuit. The circuit will be placed right inside the bear's opening.
  4. In order to make sure the circuit was secured and there were no open wires, I 3D printed a box to enclose the breadboard. https://www.thingiverse.com/thing:3202128 This model has a hole that I used to plug in the Arduino; the neopixel strip, pulse sensor and vibration motor wires will also use this hole, in order for them to be outside of the box.
  5. The pulse sensor will be placed on the bear's paw. The sensor must be on the outside of the bear, in order for it to get the best reading. To do this, I cut a small hole in the bottom part of the paw. This hole will be used to string the wires back to the breadboard. After the wires are connected to the breadboard, the pulse sensor should be the only thing showing on the breadboard. In order to secure the pulse sensor flat on the paw, I used superglue to glue it down with the sensor facing up.
  6. The vibration motor will also be placed in the paw, in order for the user to feel their heartbeat while using the sensor. To do this, I strung the motor through the back of the bear to the paw; the motor's wires are not long enough to reach the paw, so I had to solder long wires to each end of the motor wire. Once the motor was in the paw, I attached the wires to the breadboard.
  7. The neopixel strip, is very straightforward, it's located right outside the breadboard box, and will wrap around the entirety of the bear's belly.
  8. The last step was to place the bears stuffing back into its body. It is important to make sure the neopixels are covered with the stuffing, so the light will be diffused and less intense.

The Circuit

Screen Shot 2022-12-14 at 6.38.05 PM.png
Screen Shot 2022-12-14 at 6.44.49 PM.png
  • The schematic above shows where all of the wires go, but I will include some notes, explaining my process.
  • The pulse sensor is an analog input so it must be placed in an analog pinout. I chose pin A0 but any analog pin will work.
  • The neopixel can be plugged into any pin, just make sure to change the pin on the code.
  • The pulse sensor uses PWM so make sure to use a pin for PWM, these include D10, D9, D6, D5.
  • The neopixel, motor, and sensor can all be plugged into the 5v power source pin. My Arduino's 5v has not been working, so my circuit will show it plugged into the 3v power. I recommend still plugging it into your 5v power.
  • Lastly, all components will be connected to the ground. The Arduino's ground will be connected to the blue power rail, so I recommend connecting the components to the power rail, instead of the Arduino ground pin.

The Code

Link to Github Code :https://github.com/mabr5772/object/blob/main/Final%20Project%20Arduino%20Project

In order for the pulse sensor to work, I had to use the pulse sensor playground, which can be downloaded from the Arduino library menu in the app. This library will give you the most accurate output of your pulse. To learn more about how the pulse sensor works, check out this site Pulse Sensor Playground.

For the Pulse Sensor, the code uses analog inputs to know when the vibration motor and neopixal strip need to go off. The threshold is currently set at 500 but it may need to be adjusted in order to get the most accurate reading.

The Final Product

My Movie.mp4