motion detection and tracking for the esp32-cam water gun
HTML-код
- Опубликовано: 27 авг 2024
- I've added motion tracking and detection to the esp32-cam electric water gun that I made in the last video. Hopefully, it will now automatically detect when pigeons have landed on the balcony and spray them with water.
Details of how I made the water gun are here:
• esp32 cam remote contr...
The code I used is here:
github.com/jon...
Maker Mashup's video on motion tracking, which was very useful for this project:
• ESP32-CAM as a Directi...
Random nerd tutorial on pan-tilt mechanism for the esp32-cam
randomnerdtuto...
Very interesting little project. Dispite how silly it is there is a lot of time spent researching. Gota hand it to you, hope to see more from you soon on another random youtube suggestion.
Thanks. I appreciate the comment.
RUclips suggested this video to me for some reason. I hope more people get to see this one. I like the project!
Thank you!
Schon viel Gelernt, danke! A6400
You are a true genius
Thank you, Saar. That is very kind.
Thank you for sharing your work!
Thank you, for your kind words. I really hope to inspire people to be creative.
Great video! Thank you!
Thank you, for the kind words.
That’s awesome Jonny! Copy-write that asap bro! Great work!👍🤜🤛
Thanks Andrew. That’s a big compliment.
i was waiting for this, great project!!
Thank you!
well 10 month to Halloween but I'm thinking scary pumpkin head that turns and follows you as you walk up the path...
That would be cool… with red LEDs for eyes.
@@jonathanr4242 second thought. A car chassis with a plastic monster on top, left/right servo signal could steer the car, and also trigger say 2 seconds of slow forward motion, so it crawls towards anyone who moves......
Hi Jonathan Great Video Great Project. Just what I was searching for.
I am trying to build a sentinel turret with a gelblaster.
In have cut back the firing time ok But due to physical constraints (usb tethered testing) I have mounted my ESP32 CAM upside down.
Picture is the right way up
Now of course the servo are all reversed and tracking in the wrong directions.
In there a simple way to correct this in the code.
@@Graemecns hi. Sorry, I’m not sure I understand. Are you using vflip?
@@jonathanr4242 No I have had to mount my esp32 cam with the camera at the bottom (usb cable fouling) the video is streaming to WIFI right way up but the buttons were swapped Right Button moved the servo Left. I have fixed that in the HTML code. But in the tracking code if something comes in from the right the camera moves Left. opposite to the movement direction. Is there a simple fix? I have tried changing a number of parameters but no luck. also Does the tracking work for up and down
@@jonathanr4242 no I have had to mount my ESP32 Upside down with the camera at the bottom. The video stream via wifi is the correct way up but the buttons were working in reverse. I have fixed the stream in the HTML Code the the buttons work the right diredtion,
But the tracking software is reversed the camera sees the movement to the right but servo moves left.etc for directions. also does tracking up down work?
@@Graemecns up/down is not implemented yet. You can try renaming the move_left function to move_right and vice versa, for a quick fix.
I thought I tried that but I will try harder thanks
Good job bro, thanks a lot👍
Thank you.
Thank you for sharing your project! It seems you only can go to the left or right, but not up or down right? Would it be the same code to add that functionality ?
Yes. It would not be that difficult to add the up/down functionality. I just didn't do it because I didn't need it.
Are you sure they’ll dislike the water or that it’ll be strong enough pressure? Pidgeons hate spikes, might want to automate spike deployment or just cover your balcony with them. Maybe a motion detector to deploy a buzzer or noise?
I did a buzzer in a previous project but the sound annoyed my wife
excuse me sir, can i have the wiring diagram sir, because on mine, the servo are not function
you have voice like Clivlend from Griffins
I need this for my cats :D
can this be done only with a black and white image, or will it work with a color one too?
The algorithm requires grey level image data. In colour it would use more memory and be much slower so probably wouldn’t work on an esp32 AI thinker in real time. You have to use uncompressed images because the algorithm compares the raw pixel data between two images. You could probably use colour on a raspberry pi.
@@jonathanr4242 i thing use 2 esp32 cam, first for detecting movements in grayscale, second -for taking color picture
@@tree-service that would work nicely.
sir what board select this project AI THINKER or WROVER BOARD
AI THINKER.
@@jonathanr4242 thank you sir it's work but Up Down Servo motor is not work sir what i doing next
@@Rangan-vaathiyar You need to try and test the up-down servo is working properly. see if you can isolate the problem.
imagine having this when robbers tries to hide behind camera
🤣😆
Very cool turret! Is it possible to make the turret track without connecting to wifi?
I also have a problem with servomotors, they just don't seem to react, although everything is connected correctly and the servos work with a different code
Quite interesting! What do you think is the slowest step in the process? I would like to make it move faster...
Probably moving the servos, because I don't want to mistake the motion of the servo, with the camera mounted on it, for general motion. You could probably speed it up a bit by taking the esp32-cam off the servo, and just leaving the watergun attached.
I can not find where to select camera. I keep getting camera not selected error
Are you using an esp32 ai thinker?
yes and i found it. the tracking works but I can not get the servos to respond@@jonathanr4242
Awesome work, I tried it but kept on getting Jpeg compression failed. Please how can i fix this
I'm not sure why this would happen. Try just doing the jpeg without all the other stuff.
When I tried it, the camera worked but the servos didn't move, even when I pressed the track button. How do I fix this?
This could be due to a number of things. To troubleshoot I would place a serial.print in the move servo function to make sure it is being called.
If it’s being called, just try moving the servo back and forth for a few seconds in the setup routine.
@@jonathanr4242 Thank you! I will try this later
@@jonathanr4242 How should I make the servos move? I'm a beginner so I don't really know :(
@@botnumbers4703 Hi. Are you using the code that I wrote?
The first thing is to make sure the servos are properly connected and responding.
I would just put a loop at the end of the setup routine to test this.
Something like
//repeat this a couple of times
for ( int i = 5; i 0;i =i -5){
Servo2.write(i);
delay(100);
}
Note: Trouble shooting servos can be a bit tricky but it’s also very rewarding.
Also, the code I got is based on random nerd tutorials code, with some lines added for tracking and firing the water gun.
It might be worth seeing if you can get the servos working with their code.
One thing I should point out is to make sure you have servoN1 and servoN2 defined, because these are dummy servos that are used to get the correct pwm channel.
@@jonathanr4242 When I used added in your servo test code, it said "expected ; before i", how do I fix this?
Maybe use something like raspberry pi zero for more computing power?
Hi Jamil. Yes. I agree. They are more powerful, but also a bit more expensive at the moment. I would definitely like to try one for an image processing project.
Cool!! I made a similar project. But my servos do not respond.. Does anyone has the same problem?
I needed to power the servos from a different source to the esp32, but with common ground
I have been looking for a channel like this for a long time. Please get ahold of me.
Thanks for your comment. Best to email me if you have a specific question.
@@jonathanr4242 I’m on my cell phone and not sure how to access your email address from here. What is it?
Can I get the required libraries?
Need more water pressure Jonny😂
Yes. People on FB have suggested a plasma ray, a laser, a taser, and someone ver admirably suggested a gerni.
Your program, project is amazing You have given us soo much but can i ask for some assistance i have another esp project that uses
this command" client.print(status2);" its simply a text variable that i post on the page Ive tried but i cannot get it or other commands to work with your webpage Simply put i am trying to display your array motionview on the web page I am trying to add a couple lines of code to turn your project into a person coming up my driveway sensor my intention is to add a few check loops to follow the region of change. Thank you very much either way
I'm not sure. It's been a while since I looked at it. You might need to convert to c_str()?
Thanks for posting code! Looks useful for making bj bot always face the correct….area.
Hi, I have been following you. You do a great work. I work for NextPCB. We would like to sponsor your projects. You can send a DM for more details.
Thank you. I am very flattered that you like the content. Please email me on the email address at the about tab.