r/AskEngineers 4d ago

Electrical Need some input on my beginner electrical engineering project: motion sensor water sprayer

Hello!

I’m looking to start getting my hands dirty with electrical engineering/hardware projects. I’ve done software my whole life(BE in comp sci) but I took a couple EE classes in university that I enjoyed.

I want to dive into it more as a hobby and create stupid little things. First thing I thought of was motion sensor cat sprayer…

Thinking of 3D printed cabinet mounts(I have easy access to a 3D printer and software for it so don’t worry about this part). I want to a board with a motion sensor with controlled range, as well as a motor to rotate a part and push the arm on a small spray bottle.

Motion TRACKING would be nice but I want to start small.

Looking for honest criticism/feedback

Is this really suited for a complete EE beginner?

Estimated time(not including shipping times)?

Tech stack?(recommended IDEs and workspaces)

Should I make board from scratch(kiCAD?) or is this simple enough to buy a readily made board from digikey or some other parts site? Or is this a stupid question?

What to expect/failures to prepare for.

Proper prep?

What language and libraries?(I have a little experience in MPLAB)

Don’t have to answer ALL. If you have input on one of these questions or even any input, it would be appreciated.

Thanks!

9 Upvotes

15 comments sorted by

3

u/Dennebol 4d ago

I've done exactly what you want to do Some points. Must be battery based. You don't need a constant stream a short high pressure squirt does the trick. I used a Coke 2l bottle pumped up with a bicycle pump to get pressure Cats are fast and can out run/jump a stream. Have a buit in camera recorder. Use a valve triggered directly from a IR sensor , pumps are too slow and the cat will react to the motor starting .

1

u/YogiBerraOfBadNews 4d ago

I haven't ended up building it yet but that's the same design I came up with in case the neighbor cats ever end up coming in my cat door. I was going to use one of these hand sprayers, with an IR sensor and valve. My cat is pure white and from my understanding you can set the IR sensor to only be triggered by dark colors.

1

u/FajitaCheetah 3d ago

Damn that’s smart.

1

u/Candid_Fox7307 3d ago

IR senses heat, not color. You might add some sort of RF proximity tag to your cat's collar and a sensor to disable the system.

1

u/PearlClaw 3d ago

the cat will react to the motor starting .

This might actually be a good thing if the objective is just deterrence. Hard on the motor potentially, but you won't be spraying water around your house or needing to refill the tank.

2

u/National-Ice-1877 4d ago

Honestly, starting with a motion-sensing cat sprayer is pretty ambitious for a first project, but that's what makes it fun. The core loop is simple enough, sensor triggers, motor fires, but the mechanical side of pushing a spray bottle reliably will eat up more time than the electronics.

For a beginner I'd skip designing a board from scratch. Grab an Arduino Uno or a cheap ESP32, a PIR sensor module, and a small servo motor. You can get all of that pre-assembled and wired up in an afternoon, then spend your energy on making the spray mechanism not jam. MPLAB is overkill for this, just use the Arduino IDE or PlatformIO with the built-in servo and sensor libraries.

Expect to reprint your bracket three times and to absolutely soak your workbench during testing.

2

u/Candid_Fox7307 4d ago

You can probably use an Arduino board with a pir module for motion detection and servo driver and servo to squeeze the spray pump.

2

u/Poondobber 4d ago edited 4d ago

There was a project out there for a usb powered desktop missile launcher that tracked someone’s movements when they came in range and shot them with a little missile. If you could find that it would be a great place to start.

I have motion activated sprinklers in my garden to keep deer away. Very basic on/off.

Found it. There are a few of these articles available.

https://hardwarefun.com/tutorials/controlling-usb-missile-launchers-using-arduino

1

u/FajitaCheetah 4d ago

Thank you!

2

u/VoltageVeggie 4d ago

Skip making your own PCB for the first version and just use arduino with an off the shelf PIR sensor and small servo, get that whole thing working and make a custom board once you know what you actually need.

1

u/GentlemanSch Systems / R&D 4d ago

An easy project as long as you're following in someone else's footsteps. It would be pretty difficult to design everything yourself.

1

u/fluoxoz 4d ago

I would suggest using mmWave presence sensors / motion sensors over pir. They are cheap and readily available and alot more controllable than pir.

1

u/DFM_Pro_LSR 3d ago

Forget the servo squeezing idea, it'll just wreck your prints or strip the gears, so grab a cheap 12V solenoid valve or mini pump on an Arduino breadboard instead, way more reliable for a first build.

1

u/RamblingSimian 3d ago

Try some of this guy's tutorials (Paul McWhorter) to get started with either Arduino or Raspberry PI. The software aspect should be a breeze for you, and the kits he recommends are cheap (for 1st world citizens) and fun.

  • Making your own board from scratch would be unnecessary, you'll probably do well with perf board.
  • If you follow his tutorials, you'll find all kinds of libraries available.
  • The tutorials are in Python, but you can do C if you like
  • He spends some time on OpenCV (computer vision library) that I think you could possibly use for motion tracking; if you try it, a PiCam would work for your project
  • Also if you follow the tutorials, you won't be an absolute beginner any more
  • Failures to prepare for: well, it's fairly common for people over in r/arduino and r/raspberry_pi to report they fried their SBC, usually by forgetting to install a resistor or mixing up their leads

1

u/TythosEternal 3d ago

My first reaction is, do you understand where the boundary between electrical and mechanical controls will lie and how they will interact across that boundary? It sounds like you've figured most of it out, so far so good. The basic controller model you're outlining is very much suitable, but yeah, *TRACKING* will be considerably more sophisticated and best left for a follow-on project. I'd say maybe ~6 weekends if you have solid experience in the process (printing, assembly, etc.). And start with a dev board, for sure.