zzolo / heart-of-the-browser

Visualizing a heart beat in the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heart of the Browser

Visualizing a heart beat in the browser.

Setup

Hardware

You will need the following:

  • An Arduino (code only works with Arduino and tested with an Uno)
  • A Pulse Sensor
  • A USB cable to connect the Arduino to your computer (or some other way to get the serial output to your computer).

Connect the Pulse Sensor to the Arduino with the following configuration.

  1. Connect the Ground (black) wire to the GND pin on the Arduino.
  2. Connect the Power (red) wire to the 5V pin on the Arduino.
  3. Connect the Data (purple) wire to the A0 analog pin on the Arduino.

cablehookup

Software

Get this code:

  1. Use the Download ZIP button or use Git to checkout the code.

Arduino code

  1. Plug-in the Arduino to the computer with the USB cable.
  2. Download and open the Arduino IDE.
  3. Go to File -> Open and open the heart-of-the-browser.ino file from this repository.
  4. Upload the sketch to your Arduino. (You can open up the serial monitor in the Ardunio application to double check that data is being output)

Visualizing

The main visualization is for a web browser. The following commands are for the Command Line (Terminal) and are expected to be run from the root of this project (except for the first one).

  1. Change to the projects directory: cd heart-of-the-browser
  2. Install NodeJS.
  3. Install SerialBot: npm install serialbot -g
  4. Install Bower: npm install bower -g
  5. Install Bower dependencies: bower install
  6. Run SerialBot with a similar command; you will need to change the serial port path: serialbot start /dev/cu.usbmodemXXX -b 115200
    • Use the following command to get a list of serial ports to find the one that the Arduino is connect to: serialbot list
  7. Open index.html in a web browser.
    • It is suggest to use a simple web server. For instance the following will install a simple web server and make one at port 8080: npm install http-server -g && http-server

About

Visualizing a heart beat in the browser.

License:Other


Languages

Language:Arduino 81.6%Language:JavaScript 12.2%Language:HTML 4.0%Language:CSS 2.2%