Riley FerrarThomas TraynhamEthan Jones
Published

Rock Climbing Communication Device IOT MEGR 3171

IOT device that allows communication between climber and belayer. Includes microphone, altimeter, and accelerometer.

BeginnerWork in progress131
Rock Climbing Communication Device IOT MEGR 3171

Things used in this project

Hardware components

SparkFun Triple Axis Accelerometer Breakout - ADXL345
SparkFun Triple Axis Accelerometer Breakout - ADXL345
×1
Photon 2
Particle Photon 2
×3
Parallax Altimeter MS5607
×1
uxcell a15080600ux0275 Metal Shell Round Internal Magnet Speaker 2W 8 Ohm
×1
Alinan 4pcs DC 5V-12V Micro Electret Amplifier MIC Condenser Mini Microphone Board Adjustable Gain 750mW LM386 AMP Module
×1
Cylewet 10Pcs Cylindrical Electret Condenser Microphone Pickup with 2 Pins 9×7mm for Arduino (Pack of 10) CYT1013
×1
4PCS Breadboards Kit Include 2PCS 830 Point 2PCS 400 Point Solderless Breadboards for Proto Shield Distribution Connecting Blocks
×1

Software apps and online services

ThingSpeak API
ThingSpeak API

Story

Read more

Custom parts and enclosures

Assembly Zip Folder

Schematics

Accelerometer Circuit Diagram

Microphone Circuit

Altimeter Circuit Diagram

Code

Fall Detection Code

C/C++
Uses ADXL345 to detect free fall
#include <adxl345.h>
#include <Wire.h>

ADXL345 accel;
int ledPin = D2;  

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);

  accel.powerOn();

 
  accel.setFreeFallThreshold(0.30);  
  accel.setFreeFallDuration(0.05);  
}

void loop() {
  int x, y, z;
  accel.readAccel(&x, &y, &z);

  Serial.println("Accelerometer Values:");
  Serial.print("X: "); Serial.println(x);
  Serial.print("Y: "); Serial.println(y);
  Serial.print("Z: "); Serial.println(z);


  Particle.publish("accelX", String(x));
  Particle.publish("accelY", String(y));
  Particle.publish("accelZ", String(z));
  
  // IF reads close to zero, detects fall turns off LED
  if (abs(x) < 0.1 || abs(y) < 0.1 || abs(z) < 0.1) {
    digitalWrite(ledPin, HIGH);

    Particle.publish("Fall-Detected");
  } else {
   
    digitalWrite(ledPin, LOW);
  }

  delay(100); 
}

Microphone Code

C/C++
Takes input from the gain board attached to the microphone, then sends the voltage value to the speaker, then back into the board, then back to the gain board to create a voltage loop.
int red_output = A4;
int black_output = A5;
int red_input = A0;
int black_input = A1;

void setup() {
    pinMode(red_output, OUTPUT);
    pinMode(black_output, OUTPUT);
    pinMode(red_input, INPUT);
    pinMode(black_input, INPUT);
}

void loop() {
     
    
    if (analogRead(A0) > 100)
        Particle.publish("Sound_Event_1", "Input on Red Wire!", PRIVATE);
        analogWrite(A4, A0);
    if (A0 == A4)
        (Particle.publish("Sound_Event_2", "Output on Red Wire!", PRIVATE));
    if (analogRead(black_input) > .1)
        Particle.publish("Sound_Event!", "Input on Black Wire!", PRIVATE);
        analogWrite(black_output, analogRead(A2));
    if (analogRead(black_output) == analogRead(A2))
        Particle.publish("Sound_Event!", "Output on Black Wire!", PRIVATE);
            
    Particle.publish("Pulse Check", "Photon 2 is running", PRIVATE);
    delay(10000);
}

Altimeter Altitude Calculation

C/C++
#include <cmath>

int pressurePin = A2;
int alt = 0;
int p = 0;

void setup() {
}

void loop() {
p = analogRead(pressurePin);
alt = 44330.76923 * (1 - pow(p/1008.466942, 0.190264));
Particle.publish("Altitude", String::format("%.10g", alt));
delay(10000);
}

Credits

Riley Ferrar
1 project • 0 followers
Thomas Traynham
1 project • 0 followers
Ethan Jones
1 project • 0 followers

Comments