Ray Kuo
Published © GPL3+

Drop Art Kit

Simple, elegant and modern electronics kit that lets you capture stunning water drop collisions.

IntermediateFull instructions provided5 hours947
Drop Art Kit

Things used in this project

Hardware components

ESP8266 ESP-12E
Espressif ESP8266 ESP-12E
×1
Step-Up Voltage Regulator - 3.3V
SparkFun Step-Up Voltage Regulator - 3.3V
×1
Opto-Isolator
Opto-Isolator
×2
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
Darlington High Power Transistor
Darlington High Power Transistor
×1
Resistor 330 ohm
Resistor 330 ohm
×4
LED (generic)
LED (generic)
×1
Slide Switch
Slide Switch
×1
3.5mm stereo jack
×3
9V Battery Clip
9V Battery Clip
×1
9V battery (generic)
9V battery (generic)
×1
solenoid valve
×1

Story

Read more

Schematics

Drop Art Fritzing

Code

esp8266 firmware

Arduino
#include <ESP8266WiFi.h>

#define SOLENOID 13
#define FLASH 14
#define CAMERA 12
#define ON 1
#define OFF 0

WiFiServer server(80);

void setup() {
  Serial.begin(115200);
  Serial.setTimeout(25);

  WiFi.mode(WIFI_AP);
  WiFi.softAP("DropArt");
  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
    
  pinMode(SOLENOID, OUTPUT);
  pinMode(FLASH, OUTPUT);
  pinMode(CAMERA, OUTPUT);
  
  digitalWrite(SOLENOID, OFF);
  digitalWrite(FLASH, OFF);
  digitalWrite(CAMERA, OFF);

  server.begin();
  Serial.println("HTTP server started");  
}

int drop1 = 0;
int drop2 = 0;
int drop3 = 0;
int duration1 = 0;
int duration2 = 0;
int flashDelay = 0;

void loop() {
  WiFiClient client = server.available();
  if (client) {
    Serial.println("Client connected.");

    while (client.connected()) {
      if (client.available()) {
    
      // Read the first line of the request
      String buffer = client.readStringUntil('.');
      Serial.println(buffer);
      
      // clean
      if (buffer[0] == 'C') 
      {
        digitalWrite(SOLENOID, ON);
        delay(10000);
        digitalWrite(SOLENOID, OFF);
      } 
      // start
      else if (buffer[0] == 'S') 
      {      
        char *p = &buffer[0];
        char *str;
        uint8_t count = 0;
        while ((str = strtok_r(p, ":", &p)) != NULL) {
          String x = str;
          if (count == 1) {
            drop1 = x.toInt();
           } else if (count == 2) {
            duration1 = x.toInt();
           } else if (count == 3) {
            drop2 = x.toInt();
           } else if (count == 4) {
            flashDelay = x.toInt();
           }
          count++;
        }
        Serial.println(drop1);
        Serial.println(duration1);
        Serial.println(drop2);
        Serial.println(flashDelay);

        digitalWrite(CAMERA, ON);
        delay(100);
        digitalWrite(CAMERA, OFF);

        digitalWrite(SOLENOID, ON);
        delay(drop1);
        digitalWrite(SOLENOID, OFF);
        
        delay(duration1);
        
        digitalWrite(SOLENOID, ON);
        delay(drop2);
        digitalWrite(SOLENOID, OFF);

        delay(flashDelay);

        digitalWrite(FLASH, ON);
        delay(100);
        digitalWrite(FLASH, OFF);
      }
      // stop
      else if (buffer[0] == 'T') 
      {
        digitalWrite(SOLENOID, OFF);
      } 
      }
    }

      Serial.println("Client disconnected.");
      client.stop();
  }
}

app source codes

Install ESP Core

Credits

Ray Kuo

Ray Kuo

2 projects • 3 followers

Comments