Close
0%
0%

Particle-Pebble Gate Jedi

Force to Pebble to Android to Cloud to Photon to TIP120 opens Gate

Similar projects worth following
Force to Pebble to Android to Cloud to Photon to TIP120 opens Gate

Having discovered several spare Midichlorians in my liquor cabinet, I trained and applied them to opening a large cumbersome gate. The FORCE motion travels through my inner what-nots and is translated by the Pebble Classic accelerometer toggling a command sent to the (Particle) Cloud (City) which returns to the Particle Photon triggering a TIP120 to fire a button on an existing RF transceiver.

May the ridiculous hand gestures be with you, always.

That time when --

  • 1 × Particle Photon
  • 1 × Pebble Classic
  • 1 × 7085 5V Step Down Transistor ESD and TVS Suppressors / ESD and Transient Voltage Suppression (TVS) Diodes and Arrays
  • 1 × 2.2K Resistor
  • 1 × TIP120 Discrete Semiconductors / Power Transistors and MOSFETs

View all 8 components

  • Fritz

    Vije Miller02/06/2016 at 02:33 0 comments

  • Pebble.js APP

    Vije Miller02/06/2016 at 02:12 0 comments

    // Gate Jedi Peddle APP (Version 1.3) @TVMiller 
    // Pebble Blink APP @Jack-Dangerfield
    
    var Accel = require('ui/accel');
    Accel.init();
    var UI = require('ui');
    var ajax = require('ajax');
    var Vector2 = require('vector2');
    
    // Create Window
    var main_window = new UI.Window();
    
    // Open Button and Display
    var txtOnLabel = new UI.Text({
        position: new Vector2(0, 50),
        size: new Vector2(144, 30),
        font: 'Gothic 28 Bold',
        text: 'GATE JEDI',
        textAlign: 'center',						
        color: 'white'
    });
    
    // Display Main Window
    main_window.backgroundColor('black');
    main_window.add(txtOnLabel);
    main_window.show();
    
    // URL To Particle Cloud
    function Toggle(function_name,function_value){
      var URL = 'https://api.particle.io/v1/devices/XXDEVICEIDXX/' + function_name +'?access_token=XXTOKENXX';
    
      ajax(	
        {
          url: URL,
          method: 'post',	
          type: 'json',
          data: { "args": function_value}
        }
      );
    }
    
    // Accelerometer Poll and Function (Default 100Hz 25)
    Accel.on('data', function(e) {
      console.log(e.accel.x);
      if (e.accel.x > 900) { 
        console.log(e.accel.y);
          if (e.accel.y > 900) {
      Toggle('gate','open');
     }}
    });
    
    // Button Function and Photon Parameters
    main_window.on('click', 'up', function() {
      Toggle('gate','open');
    });
    

  • Photon Code

    Vije Miller02/06/2016 at 02:07 0 comments

    // Gate Jedi (Version 1.3) @TVMiller
    
    int sig = D7;
    int command = 0;
    
    void setup() {
    pinMode(sig, OUTPUT);
    Spark.function("gate",gateJedi);
    digitalWrite(sig, LOW);
    }
    
    void loop() {
    }
    
    int gateJedi(String command) {
        if (command=="open") {
            digitalWrite(sig,HIGH);
            delay(3000);
            digitalWrite(sig,LOW);
            command = 0;
                }
        else {
            digitalWrite(sig,LOW);
        }
    }
    

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates