PIR Sensor DC Motor Arduino Project | Arduino To Control Dc Motor When Detected Motion | Thetips4you

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ก.ค. 2020
  • #arduino, #arduinoprojects,#pirsensorprojects Hello Friends, Welcome back to my channel. In this tutorial we are going to control a DC Motor when there is a motion detected by PIR sensor.
    In this lecture we will go through the step by step instruction for the complete circuit using Arduino UNO, DC motor, PIR sensor and few other components and writing the code.We will be using Tinkercad Simulator, and at the end of this tutorial you can just follow the connection and copy the code to Arduino IDE, upload the code to the Arduino and you will have a running project..
    -------------------------------------------------------------------------------------------------------
    Schematic and Project Code is available in github.
    github.com/shazforiot/pirsens...
    -----------------------------------------------------------------------------------------------------------
    Arduino Serial Monitor Tutorial | Potentiometer With Arduino
    • Arduino Serial Monitor...
    --------------------------------------------------------------------------------------------------------------
    PIR Sensor Arduino Project | Motion Detector Arduino UNO
    • PIR Sensor Arduino Pro...
    --------------------------------------------------------------------------------------------------------------
    ==========================================================
    Follow me @:
    / thetips4you
    / @thetips4you
    / thetipsforyou
    www.thetips4you.com
    ========================================================
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 83

  • @willwood6116
    @willwood6116 3 ปีที่แล้ว +1

    Great video. I followed the tutorial and everything is working as it should!
    I was wondering if there was anyway the PIR sensor could activate the motor for a certain amount of time (2/3 seconds) before stopping and then reversing (for 2/3 seconds) when there is no motion to activate the PIR sensor? I have no idea how to do this any and would be very grateful for any advice.

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      Yes . That is possible. We need to change the circuit and code a little bit. Can you contact me through fb @thetipsforyou or in Instagram @thetips4you

  • @anafilipovic241
    @anafilipovic241 3 ปีที่แล้ว +2

    This is really an amazing tutorial, thank you so much for it. I was wondering would it also work with a somewhat lower voltage? I need it to be as small as possible and with a solar-charged battery, and those are not easy to find. Thanks!

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว +2

      Thank you for your feedback. If the voltage is good enough to run the motor yes it should work irrespective of the source.

    • @lucsonnelson8037
      @lucsonnelson8037 2 ปีที่แล้ว

      If you need something smaller, it's way easier cause you can just directly use the voltage coming from the arduino. It jus a 5 volt input. No need of all of this transistor. All you need it's a program

  • @fekaduadbeb3058
    @fekaduadbeb3058 5 หลายเดือนก่อน

    Where will you connect the neutral of the 9v battrey had it not been on a bread board

  • @jerrybomcool
    @jerrybomcool 10 หลายเดือนก่อน

    This is exactly what I needed thank you! I just need to make this wireless (running from batteries and not from the wall) I’m assuming this applies the same to the nano

  • @varunsavadatti8457
    @varunsavadatti8457 2 ปีที่แล้ว +1

    It was so helpful ✌️

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว +1

      Good to hear. Thank you for your feedback.

  • @danielbigelow2193
    @danielbigelow2193 3 ปีที่แล้ว +1

    Thank you sir this was a great tutorial..I don’t have any diodes at the moment so I tried the circuit without and it worked..can I use a LED instead of a normal diode?

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว +2

      It may work without diode. The only reason for using the diode is to stop the reverse current flow that breaks your device. LED cannot do the job of diode.

    • @danielbigelow2193
      @danielbigelow2193 3 ปีที่แล้ว +1

      @@Thetips4you could it damage my device if I’m not using the 5V pin? I plan to use 12V on the external pin of Arduino

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว +2

      Since the DC motor need higher voltage, if you use 12v and if don't use diode, there is possibility of the device to dead state. So be careful.

    • @danielbigelow2193
      @danielbigelow2193 3 ปีที่แล้ว

      @@Thetips4you I’ll test it out and let you know..I think it should be fine since the current of 8 AA batteries in series is the same as 1 AA battery

  • @breadoflifemeditationandhe466
    @breadoflifemeditationandhe466 3 ปีที่แล้ว +1

    great work man, i have try it, it is working great, but i want the motor to reward back after sometime, and if it sense motion while rewarding back it should stop, thanks man looking forward for you reply

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      With this circuit it will be difficult to reverse the motor as you will have to reverse the power supply from battery. You can use different method in which the power is decided by pin and cann write the code to control it.

  • @patrickguinan9360
    @patrickguinan9360 3 ปีที่แล้ว +1

    I had it working but then I changed the battery for the motor from a 9V to a battery pack for 6 AA in series - should b e same voltage, I think. It worked few times then stopped. I have gone back to 9V battery but motor still won't engage, although LED in place of motor works. Any advice?

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      Can you test the motor separately, it may be the motor is not working.

    • @patrickguinan9360
      @patrickguinan9360 3 ปีที่แล้ว

      @@Thetips4you Thanks for responding. Yes, I have tested the motor and it works fine with just the 9V.

  • @erinrehm4854
    @erinrehm4854 3 ปีที่แล้ว +1

    Hi I was wondering what kind of transistors can be used. Could I use a 2N2222 transistor?

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      Yes probably, but the preferred is nmos or MOSFET.

  • @salamaalali1052
    @salamaalali1052 3 ปีที่แล้ว +1

    Hello sir, how can I combine this circuit and code to ultrasonic distance sensor I have the 2 circuits separate.
    1- First circuit is ultrasonic distance sensor controlling the 2 DC motors using L293D H-bridge.
    2- Second circuit is like the tutorial you did with 2 DC motors.
    Everything is working in the 2 circuits but I don't know how to combine them. May you help me with that?
    - The idea of my project is when obstacles or anything comes near my probe the PIR Sensor will detect the motion and the Ultrasonic distance will move backward when it's near 100cm to my probe. And also I will include the dust sensor but still did not do the circuit and I don't think it will work.
    - One question about the diode transistor I don't have it right now, if I did not include it the circuit will still work?
    I apologies for the long discussion and I will be happy if you could help. Thank you!

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว +2

      Hi, yes we can do that. Please contact me through fb thetipsforyou. Let's see how we can create the circuit and code for your project.
      Regarding diode, it is used to stop the current flow in reverse direction to protect Arduino, your circuit should work even with out diode.

  • @prasannak3124
    @prasannak3124 3 ปีที่แล้ว +1

    Thanks for the vdo. Can IRF540N MOSFET transistor b used for this? I have 7805 IC, can this be used.

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      Irf540n mosfet should be fine.

    • @prasannak3124
      @prasannak3124 3 ปีที่แล้ว

      @@Thetips4you thanks

  • @paddymush1
    @paddymush1 3 ปีที่แล้ว +1

    hi,, this is great video , i liked and subscribed. im doing this , except im using 5v servo motor , so does this mean , i take away the 9v battery , and run the servo ground , and live to the same as the sensor and then the servos feed to the arduino. thank u

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว +1

      Thank you for your comment. Yes it will work with servo motor and power from Arduino. If you have any issues let me know.

    • @paddymush1
      @paddymush1 3 ปีที่แล้ว +1

      @@Thetips4you thank you very much , awesome

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      You are welcome.

  • @pcmoba3738
    @pcmoba3738 2 ปีที่แล้ว

    Can breadboard carry 12v 1a

  • @mugilanlatchimanan9301
    @mugilanlatchimanan9301 2 ปีที่แล้ว

    Can we use This project to implement in an aircraft. For example like to calculate the distance between the ground and the aircraft when landing. If yes please tell me how.

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว

      These are not industrial sensors, you can use the concept. However the sensors has to be changed with precision sensors.

    • @mugilanlatchimanan9301
      @mugilanlatchimanan9301 2 ปีที่แล้ว

      @@Thetips4you what are the examples of precision sensors

  • @trekdetectsicily3515
    @trekdetectsicily3515 2 ปีที่แล้ว

    value for diode?

  • @keerthu374
    @keerthu374 6 หลายเดือนก่อน

    Sir i want to slow my motor if my pir sentor detect a body or else the motor speed should be same
    If i change the if else statement
    The motor is high 1st after 1-2 seconds it come to zero on both motion detect or not detect
    What's the mistake i have made?

    • @Thetips4you
      @Thetips4you  6 หลายเดือนก่อน

      What exactly do you change in the else if statement?

  • @dalenicic5696
    @dalenicic5696 2 ปีที่แล้ว

    Hi this is an excellent tutorial but im a little confused about which MOSFET and diode to get as there are many available, could you specify which you used please? Also can I control rpm of motor? Thank you

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว

      Thank you. You will not be able to control the rpm with this circuit. I will check and share you the details on the models.

    • @dalenicic5696
      @dalenicic5696 2 ปีที่แล้ว

      @@Thetips4you excellent thank you, also sketch keeps showing errors?

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว

      @@dalenicic5696 Can you give more details on what you mean by Sketch keep showing errors?

    • @dalenicic5696
      @dalenicic5696 2 ปีที่แล้ว

      @@Thetips4you apologies sketch error is my fault, I’m new to arduino

    • @dalenicic5696
      @dalenicic5696 2 ปีที่แล้ว

      Although now I have same issue as some other people the motor does not stop spinning

  • @shahrulanuar6386
    @shahrulanuar6386 2 ปีที่แล้ว +1

    Hi.. I followed 100% your instruction. But my dc motor keep rotating even if the sensor detected no motion. Why? is it because of the diode/ transistor that I used? do they have specific value?

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว

      Can you make sure the pir sensor is connected correctly. It signal pin should not be connected to 5v, in some pir sensors the signal pin will be in different position.

  • @Ildeniz1071
    @Ildeniz1071 3 ปีที่แล้ว +1

    Great tutorial. Can you use the same system to stop running motor with sensor.

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      Yes, if you are talking about sensor detect can be used to stop a running motor. However you will have to define when the motor should be running as well.

    • @Ildeniz1071
      @Ildeniz1071 3 ปีที่แล้ว

      @@Thetips4you I have six indoor cats. I am tired to clean their kitty litter box. I come up project to create self cleaning box. Mechanical parts is done but I have to control a stepper motor when any cat go in and detected by PIR sensor. Simply a cat goes in the box, sensor detects , no motion, when the cat leaves the box sensor triggers the system, 30 seconds delay and then stepper motor turns the system half revolution and turns back the system the beginning position and stops until a cat trigger the system again. I am watching almost all PIR sensor and stepper motor tutorials to combine them. I know you will say "hey, don't bother, pay $500 to buy from the market" but they are not big enough.

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      Great to hear about your project and cats. Here the the problem is that you will not be able to seperate the movement of cat coming and going out. Pir sensor will keep detecting a high value when there is even a small movement. Probably you can try with ultrasonic sensor and if the distance ( cat is going away from sensor) is more than some distance you can rotate the motor.

  • @Enoch_The_Gent
    @Enoch_The_Gent 2 ปีที่แล้ว +2

    How can you turn on 3 dc motors with a Pir sensor and have each dc motor to be on for a certain amount of time then turn off?

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว

      You need to change the circuit and code based on it.

  • @xanh350
    @xanh350 3 ปีที่แล้ว +1

    man pls how do I use this RIP sensor as analog? I'd like it to detect only if the green circle is in the middle of that sensor place?

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      What is your exact requirement with PIR sensor?

    • @xanh350
      @xanh350 3 ปีที่แล้ว

      @@Thetips4you to put at a door and only detect movement of a human so that it doesn’t react when a dog or cat is there for example, but I just want it to show that in the tinkercad as a demonstration.

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว +1

      @@xanh350 You cannot do that with just a PIR sensor. If you need to specifically detect humans I would recommend to go with OpenCV and programmed to detect human.

  • @weiyichong7581
    @weiyichong7581 3 ปีที่แล้ว +1

    Hi can I ask what type of nmos transistor and diode is used in this project

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      Hello Friend, you can use normal rectifier or PN diode, also MOSFET transistor. In Tinkercad you can easily find diode and nmos transistor.

    • @weiyichong7581
      @weiyichong7581 3 ปีที่แล้ว +1

      So if I were to buy those components I can just tell them to get me a MOSFET transistor and a normal rectifier? Or are there any codenames for the specific component?

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      @@weiyichong7581 Yes. That will be fine. MOSFET NMOS Transistor and Normal diode. You can search in online shopping site and easily available there.

    • @weiyichong7581
      @weiyichong7581 3 ปีที่แล้ว +1

      @@Thetips4you Thanks so much!

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      @@weiyichong7581 You are welcome my friend

  • @stanimatorblue
    @stanimatorblue 10 หลายเดือนก่อน

    The IDE says "Failed Uploading: No Upload Port Provided." It's plugged in. I don't know what I can do. Any suggestions?

    • @Thetips4you
      @Thetips4you  9 หลายเดือนก่อน

      In the Arduino ide select the right board and port. Alternatively you can select the tools-ports to select the port

  • @bryanmathes9016
    @bryanmathes9016 ปีที่แล้ว

    Is this still active chat? I did everything the same ran the test but when put into real materials, the DC motor continues to run

    • @Thetips4you
      @Thetips4you  ปีที่แล้ว +1

      It should work. Check the connections or pin for sensor is connected correctly.

    • @bryanmathes9016
      @bryanmathes9016 ปีที่แล้ว

      @Thetips4you I'm buying a dc motor to see if this is the issue. Should be here tomorrow so I'll let you know. The one I'm using now is 3v -12v so I'm wondering if it is just pulling the power. New one will be 1.5v -6v

  • @christibeabarr
    @christibeabarr 3 ปีที่แล้ว +1

    When I add battery, motor just turns on and doesn't stop. I've been trying to troubleshoot with no success. Any ideas by chance?

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      That means the power is always going to motor. Can you share your circuit diagram to me in fb @thetipsforyou. I will have a look.

    • @telcygomes4770
      @telcygomes4770 3 ปีที่แล้ว +1

      Yes what solution could you provide?

    • @Thetips4you
      @Thetips4you  3 ปีที่แล้ว

      I have asked Christi to check few things through fb. Are you facing the same issue? What I found out when checking with SoulFrank, by default the pins where giving high voltage. So we had to make some changes in code. Pls contact me through fb@ thetipsforyou.

    • @mangananjanchristiana.5710
      @mangananjanchristiana.5710 2 ปีที่แล้ว

      Yes, I have the same problem too, with my project. The motor just keeps on spinning without capturing any motion, can you help me about this sir?

  • @Syncz1712
    @Syncz1712 ปีที่แล้ว

    bro can you give a reason on why you used servo motor?
    please i have project to be submitted soon

    • @Thetips4you
      @Thetips4you  ปีที่แล้ว

      Where is Servo motor used?

  • @shazrenyusuff1619
    @shazrenyusuff1619 ปีที่แล้ว

    Hi can i know why need diode and transistor???

    • @Thetips4you
      @Thetips4you  ปีที่แล้ว

      It is used to stop reverse current flow.

  • @lucsonnelson8037
    @lucsonnelson8037 2 ปีที่แล้ว

    Are you sure that the diode is well place in this circuit bro cause in real life it should fried the arduino board.

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว

      Yes, the diode is kept in the way that the current will not flow towards Arduino. You can test that before making the connection.

  • @whispymagma2535
    @whispymagma2535 2 ปีที่แล้ว

    I had a lot of problems with this tutorial, My arduino IDE detected all sorts of problems.

    • @Thetips4you
      @Thetips4you  2 ปีที่แล้ว

      Do you like to share the details

    • @whispymagma2535
      @whispymagma2535 2 ปีที่แล้ว

      @@Thetips4you sure. When I copied what you wrote down on the code on tindercad, I wrote letter to letter, and all the same symbols, and when I copied and pasted it into the arduino IDE, I tried uploading it, and it said stuff about putting this: ';' behind digitalWrite, and canat can not be found