Arduino Motion Detecting Squirt Gun

Avatar davisde | March 29, 2014

211 Views 0 Ratings Rate it

[venera_framed_image content_type="video" css_animation="appear" frame_type="browser" slider_engine="flexslider" video_link="" browser_url="https://www.youtube.com/watch?v=bSz4FQPsir8"]

In case you want a nerdier way to make a cheap motion detecting squirt gun, Here's how you can build your own with an Arduino and a PIR sensor!

Acquiring the Parts
Here's what you will need:

  1. Raid Auto Trigger
  2. Arduino
  3. PIR Motion Sensor
  4. Diode
  5. NPN Transistor
  6. Wire cutters and wire

TOTAL COST: ~$45.00

Disassemble the Automatic Sprayer
Wire Up The Arduino
Here is a schematic of the Arduino. You can download the Fritzing files by clicking on this link. Screen Shot 2014-03-29 at 3.15.19 PM [tabby title="Step 3"]

Add The Code
Here is a copy of the Arduino code to upload to your arduino. You can also download it by clicking on this link. const int pirPower = 13; const int pirIn = 12; int motorPin1 = 3; void setup(){ pinMode(pirPower, OUTPUT); pinMode(pirIn, INPUT); pinMode(motorPin1, OUTPUT); digitalWrite(motorPin1, LOW); digitalWrite(pirPower, HIGH); } void loop(){ int value= digitalRead(pirIn); if (value == HIGH){ digitalWrite(motorPin1, HIGH); delay(500); digitalWrite(motorPin1, LOW); } }

Help support my channel: http://www.patreon.com/tinkernut Follow Tinkernut! Google + Facebook Twitter


Comments

This post currently has one response.

Leave a Reply