Highlights

Showing posts with label Week 3. Show all posts

Concept Design: ECG

By : Lam Ho Wang
The group is planning to make our own ECG by using, an inferred LED, a photodiode, and OP amp. The sensor is based on the DIY pulse sensor posted on picture 2

Figure: ECG and Arduino Concept diagram
Figure: Circuit Diagram for the proposed ECG

Tag : , , ,

UPDATE - Week 3

By : x
The group looked into methods of making a ECG sensor. A simple sensor could be setup using IR and light sensitive resistor. IR sensor would be mounted on one lip and light sensitive resistor on the other lip of a clip.
More Arduino programming was done this week. The group worked with LEDs and accelerometer. The acceleromter and LEDs were connected to the Arduino board. There were 3 LEDs and each LED corresponded to the X, Y and Z direction of the accelerometer movement. The associated LED blinked when substantive change was detected on its corresponding direction.
  • To read the tutorial of how to connect the LEDs to the Arduino click here
  • To view the Arduino program click here
  • To look through our ECG concept click here


LEDs and Accelerometer

By : x
Arduino Tutorial:
This tutorial will show you how to connect LEDs into Arduino Uno, and how to extract data from accelerometer and make the LEDs react to the change.

First you need to  connect the LEDs to the Arduino board. We will be using three LEDs and bread board to setup the LEDS. You may use any port; here we use port 13, 10 and 4 for X, Y and Z direction associated LEDs respectively. Watch the video if you need help setting up the LEDs.


Now follow the tutorial by Xingyu Huang on how to program using the Arduino development environment to receive data from acclerometer and design an algorithm which effectively translate this change to LED output.

Here is how your hardware would react if everything is setup correctly.

Program: Accelerometer

By : Noctis King

The program of LEDs and Accelerator

    In this week, our group made a monitor by using LEDs to react the change of accelerator.
    Now, we will show and explain how this program work.


const int groundpin = 18;             // analog input pin 4 -- ground
const int powerpin = 19;              // analog input pin 5 -- voltage
const int xpin = A0;                  // x-axis of the accelerometer
const int ypin = A1;                  // y-axis
const int zpin = A2;                  // z-axis (only on 3-axis models)
int ledx=13;                          // the pin of x-axis LED
int ledy=10;                          // the pin of y-axis LED
int ledz=4;                           // the pin of z-axis LED

void setup()
{
  // initialize the serial communications:
  Serial.begin(9600); // set the data rate in bits per second
  
  //initialize the digital pin as an output.
  digitalWrite(groundpin, LOW); 
  digitalWrite(powerpin, HIGH); 
  pinMode(ledx, OUTPUT); 
  pinMode(ledy,OUTPUT); 
  pinMode(ledz,OUTPUT); 
}

void loop()
{
  // set the initial value of accelerator
  int ax = analogRead(xpin); // the initial value of x-axis
  int ay = analogRead(ypin); // the initial value of y-axis
  int az = analogRead(zpin); // the initial value of z-axis
  
  while (true) // loop, tracking and reacting the change 
  {
    int Tax = analogRead(xpin); // reading the x-axis value after changing
    // determining the changing margin of x-axis' value 
    // if value change bigger than 50, the LED will blink
    // if not, it will closs
    if (abs(Tax - ax) > 50)  
    {
      digitalWrite(ledx, HIGH); 
    }
    else
    {
      digitalWrite(ledx, LOW);
    }
    int Tay = analogRead(ypin);
    if (abs(Tay - ay) > 50)
    {
      digitalWrite(ledy, HIGH);
    }
    else
    {
      digitalWrite(ledy, LOW);
    }
    int Taz = analogRead(zpin);
    if (abs(Taz - az) > 50)
    {
      digitalWrite(ledz, HIGH);
    }
    else
    {
      digitalWrite(ledz, LOW);
    }
  }
  
  
  // delay before next reading:
  delay(100);
}

- Copyright © 2013 Group 106-11 - Date A Live - Powered by Blogger - Designed by Johanes Djogan -