Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Smart Motion-Activated Water Gun Built with Arduino Nano

Components and supplies

Smart Motion-Activated Water Gun Built with Arduino Nano
Arduino Nano R3
×1
Smart Motion-Activated Water Gun Built with Arduino Nano
PIR Motion Sensor (generic)
×1
Smart Motion-Activated Water Gun Built with Arduino Nano
Solderless Breadboard Half Size
×1
Smart Motion-Activated Water Gun Built with Arduino Nano
General Purpose Transistor NPN
I used the 2N3904
×1
Smart Motion-Activated Water Gun Built with Arduino Nano
Resistor 330 ohm
Does not need to be exactly 330 ohm, slightly larger or smaller values also worked.
×1

Necessary tools and machines

Smart Motion-Activated Water Gun Built with Arduino Nano
Laser cutter (generic)

About this project

Overview

This project was inspired by Tinkernut's Arduino Motion Detecting Squirt Gun:

I wanted to replicate Tinkernut's project but the problem was that I could not get my hands on a Raid Auto Trigger because it is not available in China where I was living. However, a quick search on Taobao.com led me to discover this interesting product:

Smart Motion-Activated Water Gun Built with Arduino Nano

Very similar to the Raid Auto Trigger and at the reasonable price of ¥78.80 I decided to purchase one. It turned out to be considerably easier to hack since you did not need to tamper with any of the internal components. You only needed to modify the push button so that it was breadboard/Arduino compatible. If you happen to live in China (or if Taobao ships to your country) you can purchase the squirt gun here.

We turned this into a workshop, hence all the powerpoint slides and big text.

Smart Motion-Activated Water Gun Built with Arduino Nano

STEP 1: Hack the water gun

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

STEP 2: Interfacing with the Arduino

Set up and test the PIR motion sensor with the Arduino Nano.

Smart Motion-Activated Water Gun Built with Arduino Nano
/* 
* PIR sensor 
*/ 
int calibrationTime = 10;    //the time we give the sensor to calibrate (10-60 secs according to the datasheet) 
int outputPin = 2;                // choose the pin for the LED 
int inputPin = 4;               // choose the input pin (for PIR sensor) 
int pirState = LOW;             // we start, assuming no motion detected 
int val = 0;                    // variable for reading the pin status 
void setup() { 
 pinMode(outputPin, OUTPUT);      // declare LED as output 
 pinMode(inputPin, INPUT);     // declare sensor as input 
 digitalWrite(outputPin, LOW); //prevents gun firing at powerup
 Serial.begin(9600); 
 //give the sensor some time to calibrate 
 Serial.print("calibrating sensor "); 
   for(int i = 0; i < calibrationTime; i++){ 
     Serial.print("."); 
     delay(1000); 
     } 
   Serial.println(" done"); 
   Serial.println("SENSOR ACTIVE"); 
   delay(50); 
} 
void loop(){ 
 val = digitalRead(inputPin);  // read input value 
 if (val == HIGH) {            // check if the input is HIGH 
   digitalWrite(outputPin, HIGH);  // turn LED ON 
   if (pirState == LOW) { 
     // we have just turned on 
     Serial.println("Motion detected!"); 
     // We only want to print on the output change, not state 
     pirState = HIGH; 
   } 
 } else { 
   digitalWrite(outputPin, LOW); // turn LED OFF 
   if (pirState == HIGH){ 
     // we have just turned of 
     Serial.println("Motion ended!"); 
     // We only want to print on the output change, not state 
     pirState = LOW; 
   } 
 } 
} 

Use the serial monitor to check that it's working, and then it's time to connect the water gun.

Set up the transistor and resistor like so:

Smart Motion-Activated Water Gun Built with Arduino Nano

Smart Motion-Activated Water Gun Built with Arduino Nano

And with that you should be have a working motion-soaker! We used a laser cutter to make a wooden enclosure (since it's very fast and we needed a bunch of them for the workshop), but you could use a 3D printer as well.

Smart Motion-Activated Water Gun Built with Arduino Nano

Keep in mind, I have put in a 10-second delay in the code so as to allow the motion sensor to calibrate.

Smart Motion-Activated Water Gun Built with Arduino Nano


Manufacturing process

  1. The Evolution of Pump‑Action Water Guns: From Invention to Global Market Leader
  2. Control an LED with a PIR Motion Sensor on Raspberry Pi
  3. Arduino Tic Tac Toe with MAX7219 LED Matrix and Cardboard Enclosure
  4. Build a Sensor Tower with Arduino Cloud: Temperature, Motion & Gas Monitoring
  5. Build a Reliable Arduino Countdown Timer with SparkFun 7‑Segment Display
  6. Build Your Own RC Porsche Car with Arduino: A Step‑by‑Step Guide
  7. Arduino Nano Fingerprint Sensor Project – Step‑by‑Step Tutorial
  8. Build a Gesture & Motion Detector with PIR Sensor & Arduino Nano
  9. Build an IR Sensor Project with Arduino UNO – Simple Guide
  10. SmartAgro: Advanced IoT Solutions for Precision Farming