Flashing Light Prize (6) Arduino 101 Break Up (FAIL)
Parting is such sweet elation. Elevation change per 0.15 meters (0.5 foot) measured by BMP180 triggers relay state. Good riddance, Arduino 101. May your gibberish never stain my IDE again.
Ingredients 1. Arduino 101 (34 gr) 2. BMP180 Module (4 gr) 3. TIP120 (1 gr) 4. 2.2K Resistor (<1 gr) 5. 5V Incandescent Bulb (<1 gr) 6. 9V Battery (42 gr) 7. Battery Holder (1 gr) 8. Latex Balloons (Helium) 9. String
Notation(s) 1. Project worked to perfection--right up until the balloons were purchased. After having not acquired enough balloons (12) for lift, a stripping down of materials and conversion to a lighter 12 volt battery resulted in an accidental overload and in brief - kaput! Secondary to this, let it be known that filming string hung peripherals and balloon flight at night with low budget production is as impractical as this whole venture. 2. 1 liter of Helium lifts 1 gram. 12" latex balloon volume is 15L. Horse shit!
Arduino Skyetch
// Flashing Light Prize (6) Arduino 101 Break Up // BMP180 Code by Sparkfun // VijeMiller
#include <SFE_BMP180.h> #include <Wire.h>
// BMP180 SFE_BMP180 pressure; double base;
// States int last = 0; int up = 0; int state = 0;
// TIP120 int light = 7;
void setup() { Serial.begin(9600);
pinMode(light, OUTPUT); digitalWrite(light, LOW);
// BMP180 Working? if (pressure.begin()) Serial.println("BMP180 init success"); else { Serial.println("BMP180 init fail (disconnected?)\n\n"); while (1); }
// Create Base Line base = getPressure(); Serial.print("Base Line Pressure: "); Serial.print(base); Serial.println(" mb"); delay(2000); }
void loop() { double a, P; // Get Pressure P = getPressure(); // Different Between Base and New a = pressure.altitude(P, base);
// Higher by 0.5 Feet or More? if (a >= up) { if (state == 0) { digitalWrite(light, HIGH); state = 1; } else if (state == 1) { digitalWrite(light, LOW); state = 0; } }
// Add 0.5 Feet // Store Last up = a + 0.1524;
delay(500); }
double getPressure() { char status; double T, P, p0, a; status = pressure.startTemperature(); if (status != 0) { delay(status); status = pressure.getTemperature(T); if (status != 0) { status = pressure.startPressure(3); if (status != 0) { delay(status); status = pressure.getPressure(P, T); if (status != 0) { return (P); } } } } }