Sunday, December 2, 2018

The Project

UNFINISHED!!!
Hi, my 13 year old son was given a math project of his choice and after some brainstorming, we decided to make a heart monitor that reads your pulse, then pumps red liquid in a jar to show it physically. We ordered the needed parts form China and unfortunately they did not come in time. The project is due in 2 days. We are missing the infrared pulse sensor so I've been scouring the internet for another way.
Just now I came across a way to use a webcam to read your pulse. I will give this a try and blog my journey here so that maybe someone else can get help.
Some install troubles and further searching led me to this site: http://thearn.github.io/webcam-pulse-detector/ Here you will find a new package that automatically gets the detection program running. All you need to do first is install Python. I used 3.4.1.
The file you will download is  called webcam-pulse-detector-win and I am using it on Windows 7. You must unzip it, then just click the .exe file. A terminal window should pop up as well as  a webcam window. I am using a Logitech C270. I don't know if it will work on all webcams... give it a try.
The program seems to do a decent job of reading my pulse. now I must figure out how to get the readings to go to my arduino so I can do some fun things with it.

Arduino Connection

How can I use my arduino with this?
I need to do some more digging.
I will be using the original site I found to try and set up the microcontroller. The site is: https://hackaday.io/project/161052-blink-an-led-to-your-heart-rate

There are build instructions at the bottom. If you successfully completed the setup above, you can skip the software installation instructions in #1..
Just drop down to #2. install tools for microcontroller. I will be using the digispark, the same as Dillon. But it should work with other arduinos.

Here is the wiki for the digispark if you want more information: http://digistump.com/wiki/digispark/tutorials/connecting

Step1: I will plug my Digispark into the computer to see if my Arduino IDE 1.8.7 needs drivers to recognize it. (The digispark can plug in either way, so if it does not light up, flip it over!) My computer says USB device not recognized. So I will try the driver. Download the drivers here: https://github.com/digistump/DigistumpArduino/releases/download/1.6.7/Digistump.Drivers.zip
After the download, unzip and click on install drivers and follow the prompts. It is a long install with many prompt windows, be patient!
Installation was complete but it does not show up in the Arduio IDE list. Maybe I must unplug it and plug back in? YES! that worked (says installed Digispark bootloader)
I will reopen the Arduino IDE and see if it is now listed... nope not there. Because I am in a hurry with this project, I will stop trying to use the digispark for now and instead continue with an Arduino Nano as I have one and know the drivers are working.

I am connected and will upload the sketch from the site. I uploaded the code and there is an error, that error is an include at the beginning of the sketch for the digispark. Just remove that code ( the first line): #include <DigiCDC.h>

If you run the code now you will get an error because your other software that uses the webcam (web_pulse) is not running. I will start that and see what happens.




No comments:

Post a Comment