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...

Комментарии • 75

  • @stevenm3914
    @stevenm3914 Год назад +5

    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.

  • @YATESA8
    @YATESA8 Год назад +1

    RUclips suggested this video to me for some reason. I hope more people get to see this one. I like the project!

  • @jeditor8960
    @jeditor8960 9 месяцев назад +2

    Schon viel Gelernt, danke! A6400

  • @saarboaz123
    @saarboaz123 4 месяца назад +1

    You are a true genius

    • @jonathanr4242
      @jonathanr4242  4 месяца назад

      Thank you, Saar. That is very kind.

  • @michaelomode630
    @michaelomode630 11 месяцев назад +1

    Thank you for sharing your work!

    • @jonathanr4242
      @jonathanr4242  11 месяцев назад +1

      Thank you, for your kind words. I really hope to inspire people to be creative.

  • @danh9002
    @danh9002 8 месяцев назад +1

    Great video! Thank you!

    • @jonathanr4242
      @jonathanr4242  7 месяцев назад

      Thank you, for the kind words.

  • @andrew_bookallil
    @andrew_bookallil Год назад

    That’s awesome Jonny! Copy-write that asap bro! Great work!👍🤜🤛

    • @jonathanr4242
      @jonathanr4242  Год назад +1

      Thanks Andrew. That’s a big compliment.

  • @orlandop2265
    @orlandop2265 Год назад

    i was waiting for this, great project!!

  • @lezbriddon
    @lezbriddon Год назад +1

    well 10 month to Halloween but I'm thinking scary pumpkin head that turns and follows you as you walk up the path...

    • @jonathanr4242
      @jonathanr4242  Год назад

      That would be cool… with red LEDs for eyes.

    • @lezbriddon
      @lezbriddon Год назад +1

      @@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......

  • @Graemecns
    @Graemecns 17 дней назад +1

    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.

    • @jonathanr4242
      @jonathanr4242  17 дней назад

      @@Graemecns hi. Sorry, I’m not sure I understand. Are you using vflip?

    • @Graemecns
      @Graemecns 16 дней назад +1

      @@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

    • @Graemecns
      @Graemecns 16 дней назад +1

      @@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?

    • @jonathanr4242
      @jonathanr4242  16 дней назад

      @@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.

    • @Graemecns
      @Graemecns 16 дней назад +1

      I thought I tried that but I will try harder thanks

  • @Botir-vo1xg
    @Botir-vo1xg 7 месяцев назад

    Good job bro, thanks a lot👍

  • @SeniorDonCarlo
    @SeniorDonCarlo 3 месяца назад +1

    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 ?

    • @jonathanr4242
      @jonathanr4242  3 месяца назад

      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.

  • @H0mework
    @H0mework Год назад +2

    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?

    • @jonathanr4242
      @jonathanr4242  Год назад

      I did a buzzer in a previous project but the sound annoyed my wife

  • @Vellz08
    @Vellz08 9 месяцев назад

    excuse me sir, can i have the wiring diagram sir, because on mine, the servo are not function

  • @tree-service
    @tree-service 5 месяцев назад

    you have voice like Clivlend from Griffins

  • @teknisyankuno2375
    @teknisyankuno2375 Год назад

    I need this for my cats :D

  • @tree-service
    @tree-service 5 месяцев назад +1

    can this be done only with a black and white image, or will it work with a color one too?

    • @jonathanr4242
      @jonathanr4242  5 месяцев назад

      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.

    • @tree-service
      @tree-service 5 месяцев назад

      @@jonathanr4242 i thing use 2 esp32 cam, first for detecting movements in grayscale, second -for taking color picture

    • @jonathanr4242
      @jonathanr4242  5 месяцев назад

      @@tree-service that would work nicely.

  • @Rangan-vaathiyar
    @Rangan-vaathiyar Год назад +1

    sir what board select this project AI THINKER or WROVER BOARD

    • @jonathanr4242
      @jonathanr4242  Год назад

      AI THINKER.

    • @Rangan-vaathiyar
      @Rangan-vaathiyar Год назад +1

      @@jonathanr4242 thank you sir it's work but Up Down Servo motor is not work sir what i doing next

    • @jonathanr4242
      @jonathanr4242  Год назад

      @@Rangan-vaathiyar You need to try and test the up-down servo is working properly. see if you can isolate the problem.

  • @ihatelov1n
    @ihatelov1n Год назад

    imagine having this when robbers tries to hide behind camera

  • @engineergaming275
    @engineergaming275 9 месяцев назад

    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

  • @wagnerfontes2
    @wagnerfontes2 Год назад +1

    Quite interesting! What do you think is the slowest step in the process? I would like to make it move faster...

    • @jonathanr4242
      @jonathanr4242  Год назад

      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.

  • @charlesryan6868
    @charlesryan6868 Год назад

    I can not find where to select camera. I keep getting camera not selected error

    • @jonathanr4242
      @jonathanr4242  Год назад

      Are you using an esp32 ai thinker?

    • @charlesryan6868
      @charlesryan6868 Год назад

      yes and i found it. the tracking works but I can not get the servos to respond@@jonathanr4242

  • @opiritetariah
    @opiritetariah Год назад +1

    Awesome work, I tried it but kept on getting Jpeg compression failed. Please how can i fix this

    • @jonathanr4242
      @jonathanr4242  Год назад

      I'm not sure why this would happen. Try just doing the jpeg without all the other stuff.

  • @botnumbers4703
    @botnumbers4703 Год назад +1

    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?

    • @jonathanr4242
      @jonathanr4242  Год назад

      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.

    • @botnumbers4703
      @botnumbers4703 Год назад

      @@jonathanr4242 Thank you! I will try this later

    • @botnumbers4703
      @botnumbers4703 Год назад

      @@jonathanr4242 How should I make the servos move? I'm a beginner so I don't really know :(

    • @jonathanr4242
      @jonathanr4242  Год назад

      @@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.

    • @botnumbers4703
      @botnumbers4703 Год назад

      @@jonathanr4242 When I used added in your servo test code, it said "expected ; before i", how do I fix this?

  • @JamilKhan-hk1wl
    @JamilKhan-hk1wl Год назад +1

    Maybe use something like raspberry pi zero for more computing power?

    • @jonathanr4242
      @jonathanr4242  Год назад

      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.

  • @samsongenet7762
    @samsongenet7762 Год назад +1

    Cool!! I made a similar project. But my servos do not respond.. Does anyone has the same problem?

    • @jonathanr4242
      @jonathanr4242  Год назад

      I needed to power the servos from a different source to the esp32, but with common ground

  • @ThaigersDen
    @ThaigersDen 5 месяцев назад +1

    I have been looking for a channel like this for a long time. Please get ahold of me.

    • @jonathanr4242
      @jonathanr4242  5 месяцев назад

      Thanks for your comment. Best to email me if you have a specific question.

    • @ThaigersDen
      @ThaigersDen 5 месяцев назад

      @@jonathanr4242 I’m on my cell phone and not sure how to access your email address from here. What is it?

  • @surojitdas4496
    @surojitdas4496 9 месяцев назад

    Can I get the required libraries?

  • @rubydan7483
    @rubydan7483 Год назад +1

    Need more water pressure Jonny😂

    • @jonathanr4242
      @jonathanr4242  Год назад

      Yes. People on FB have suggested a plasma ray, a laser, a taser, and someone ver admirably suggested a gerni.

  • @jeffkellner7416
    @jeffkellner7416 8 месяцев назад

    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

    • @jonathanr4242
      @jonathanr4242  8 месяцев назад

      I'm not sure. It's been a while since I looked at it. You might need to convert to c_str()?

  • @OMNI_INFINITY
    @OMNI_INFINITY 11 дней назад

    Thanks for posting code! Looks useful for making bj bot always face the correct….area.

  • @chenzora2417
    @chenzora2417 Год назад

    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.

    • @jonathanr4242
      @jonathanr4242  Год назад

      Thank you. I am very flattered that you like the content. Please email me on the email address at the about tab.