Prior attempt at standalone sprayer

If your drone isn't so forthcoming about providing power connectors or gimbal control documentation, you may wish to create a standalone parasitic device to trigger your spray can while it's mounted on the quadcopter. Pictured above is the "icarus one" version of the device used in KATSU's drone paintings, which uses a 3D printed servo can mount based off sliptonic's silly-string trigger on Thingiverse.

The store-bought injection-molded plastic spray mounts are really much better suited for this project than 3D printing, but for some reason it just hadn't occurred to me to look for such a product at the time.

The electronics consist of the following:

Sure, the range on the transmitter/receiver pair isn't close to the range on he quadcopter's radios, but for painting you want to be close to the action anyway so this was considered an acceptable limitation.

The code simply took two digital inputs from the RF receiver and used their states to turn on the servo and press the lever as well as release it:

Download: file
#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
int triggerpin = 5;
int offpin = 2;


int buttonState;             // the current reading from the input pin
int lastButtonState = LOW;   // the previous reading from the input pin
int button2State;             // the current reading from the input pin
int lastButton2State = LOW;   // the previous reading from the input pin

 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
  pinMode(triggerpin, INPUT);
  pinMode(offpin, INPUT);
} 
 
 
void loop() 
{ 
  buttonState = digitalRead(triggerpin);
  button2State = digitalRead(offpin);

// compare the buttonState to its previous state
  if (buttonState != lastButtonState || button2State != lastButton2State) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // wend from off to on:
      //buttonPushCounter++;
      myservo.write(90);
    delay(15);
      //Serial.println("on");
      //Serial.print("number of button pushes:  ");
      //Serial.println(buttonPushCounter);
    } 
    else if (button2State == HIGH) {
      // if the current state is LOW then the button
      // went from on to off:
      //Serial.println("off");
       myservo.write(0);
    delay(15);
    }
  }
  // save the current state as the last state, 
  //for next time through the loop
  lastButtonState = buttonState;




} 

It is this standalone device that was attached to a DJI Phantom quadcopter to create KATSU's drone paintings. A circuit diagram is available at the icarus one site.

The known issues with this circuit are mainly related to range and responsiveness once the servo is engaged, depressing the spray can.

The current draw on the circuit seems to decrease the sensitivity of the RF receiver, resulting in a spraying can that can't be turned off remotely, so it sprays until it runs out of paint. This was also considered an acceptable limitation for experimentation under the circumstances.

This guide was first published on Jun 05, 2015. It was last updated on Jun 05, 2015. This page (Prior attempt at standalone sprayer) was last updated on Sep 10, 2019.