Home Automation: Change direction of rotation of DC motor using 2 relays and Arduino - Robojax

Ғылым және технология

Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135
Learn how to control motor using 2 relay and Arduino in a very simple way without motor driver module.
The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe and enable the bell 🔔.😊
Download Arduino code for this video: bit.ly/2relay-motor
** Purchase 2 channel relay from **
Amazon USA: amzn.to/2QhmuAO
Amazon Canada: amzn.to/3x3iAvQ
Amazon Europe (all Europe): amzn.to/3dwp7aA
** Purchase Arduino Start Kit **
Amazon USA: amzn.to/3z88F9G or just UNO board amzn.to/3aY7KOL
Amazon Canada: amzn.to/31an88J or just UNO board amzn.to/3pYxSNN
Amazon Europe (all Europe): amzn.to/3pMCHge or Just UNO board amzn.to/2PgGItD
AliExpress: s.click.aliexpress.com/e/_9uc7Xe
Banggood: www.banggood.com/custlink/3GD... or UNO board www.banggood.com/custlink/vKm...
eBay: ebay.us/B1JWLi
***** Purchase Authentic Arduino Uno from ***
Amazon USA: amzn.to/2KApAwK
Amazon Canada: amzn.to/37LZ8sW
All Europe Amazon: amzn.to/36YDSzn
Jump to different section of video by clicking on the time:
00:00 Start
00:51 Introduction
02:04 Relay Module explained
04:29 How it works
08:03 Wiring Explained (2 single relay)
10:16 Wiring Explained (dual relay module)
11:48 Basic code explained
15:25 Advanced code explained
18:41 Demonstration
Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135
Tutorial by Ahmad Shamshiri form Canada
****************************
Arduino Step by Step Course (over 150 lectures) Starts here • Lesson 00 What is Ardu...
****************************
If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robojaxTV
Follow me on Facebook robojaxTV
Follow me on Twitter: / robojaxtv
Follow me on Instagram: / robojax
Tutorial by Robojax.com
Get other projects code and learn Arduino
robojax.com/learn/arduino
*** AFFILIATE PROGRAM ***
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.

Пікірлер: 216

  • @ShedOfDreams
    @ShedOfDreams3 жыл бұрын

    Fantastic! Thank you. Absolute beginner with Arduino. Subscribed. Managed to combine it with some rfid code to operate a car door Solenoid Lock for garden shed security.

  • @aco319sig3
    @aco319sig34 жыл бұрын

    Finally, a clear explanation without assumptions make about the viewer’s knowledge!!! Thank you!

  • @robojax

    @robojax

    4 жыл бұрын

    You are welcome.

  • @NarendraSharma-zd8gx

    @NarendraSharma-zd8gx

    2 жыл бұрын

    Thank you sir for your Reply

  • @3phasetinkerer
    @3phasetinkerer10 ай бұрын

    Such a beautiful explanation Ahmed! Thank you very much for the video. I’ve never uses a relay module in my life and this video shows everything I need in detail.

  • @wr1450
    @wr14503 ай бұрын

    You just cleared my final year project bro❤

  • @robojax

    @robojax

    3 ай бұрын

    Glad to hear that

  • @rodolphougolini
    @rodolphougolini2 жыл бұрын

    Thanks. It worked perfectly. I'm using 2 way smart relay.

  • @danjunk-DIY
    @danjunk-DIY3 жыл бұрын

    Very informative and helped me ! Thank You !!

  • @robojax

    @robojax

    3 жыл бұрын

    You're welcome!

  • @kevinchang7497
    @kevinchang74973 жыл бұрын

    Thank you soooo much l. Was very helpful

  • @pujanshrestha2983
    @pujanshrestha29833 жыл бұрын

    Woha...3:30 am here...and I was thinking and solved it and verifying on KZread...and it's already here..lol..Thank you 😀 Robojax 👍🔥

  • @robojax

    @robojax

    3 жыл бұрын

    Perfect!

  • @galaxcartz9429
    @galaxcartz94293 жыл бұрын

    Thanks a lot. Before I find this, I wired it very close. Only thing was I forgot to check which side that relay pins are placed on the relay module.

  • @robojax

    @robojax

    3 жыл бұрын

    You're welcome

  • @BeeKneeSeaGhoul
    @BeeKneeSeaGhoul11 ай бұрын

    Excellent video. You earned yourself my humble sub. Tnx.

  • @alphaeaglesoft
    @alphaeaglesoft3 жыл бұрын

    Thanks a lot, your video reali helped me out big deal!!!!

  • @robojax

    @robojax

    3 жыл бұрын

    You're very welcome!

  • @suhassubbanna
    @suhassubbanna3 жыл бұрын

    Very nice explanation m8. Even though the video is long, there is a lot crisp information included. Perfect for a beginner to control the motor without a motor driver. If you're okay with working in a constant speed I advice using a relay with the optocoupler since the relays usually handle very large currents without any problem. I did 6 wheel drive toy car to tow around my nephew's cycle using Johnson motors, the motor driving modules prices were so high I just ended up using the relays. Works perfectly fine. In the next video provide instructions on using an isolated voltage for relays as using the same 5 volts from the Arduino won't work all the time and will give lot of interference.

  • @robojax

    @robojax

    3 жыл бұрын

    Thank you for the suggestions specially the interference issue. I have it in mind it.

  • @suhassubbanna

    @suhassubbanna

    3 жыл бұрын

    @@robojax yeah. You need any help with that let me know m8. I do that for living with big tractors and trucks.

  • @maljahra6086

    @maljahra6086

    2 жыл бұрын

    Ok

  • @2007xoxox
    @2007xoxox4 жыл бұрын

    You are incredible. Thank you

  • @robojax

    @robojax

    4 жыл бұрын

    You are welcome. 😃

  • @directorstu
    @directorstu8 ай бұрын

    Very clear. Thanks 👍

  • @user-to3mb5dt3b
    @user-to3mb5dt3b8 ай бұрын

    Thank you so much for the video. your code helps me a lot with similar projects.

  • @robojax

    @robojax

    8 ай бұрын

    Glad I could help!

  • @gabrielaguilar8108
    @gabrielaguilar81088 ай бұрын

    great video and explination!!!! am i able to control bigger motors with the arduino and relays such as a 2hp motor 115 /230 Volts 1800 rpm

  • @joesisco8145
    @joesisco8145 Жыл бұрын

    Thank you very much 👍

  • @GamingGodCops
    @GamingGodCops5 жыл бұрын

    Awesome instructor and instructions......

  • @robojax

    @robojax

    4 жыл бұрын

    Thank you. 😄

  • @roboarjun
    @roboarjun2 жыл бұрын

    Thank you!

  • @ChristianGrau92
    @ChristianGrau929 ай бұрын

    Very good thank you

  • @stefkoum
    @stefkoum2 жыл бұрын

    Good evening from Greece! i am using this code to control a chicken coop door to open and close in 12 hour intervals. The problem i am facing is that if i operate using the arduino delay (because i tried with Ds3231 RTC and failed countless times) because of friction in the door, is never fully open or closed and if i increase the motor rotation for more seconds i am afraid it will crush the shell (using a 12v windshield motor). My question is is there any chance i could add 2 limit switches so that it stops at spesific height, delays for 12hours, reverses polarity and then continues operating the other way and if so, how? ( i am a complete noob in programming and it is time consuming and frustrating to fail every time) Thank you so much in advance!!

  • @jascfdrac
    @jascfdrac9 ай бұрын

    Excelent!❤

  • @batticha462
    @batticha4625 жыл бұрын

    Great as usual

  • @robojax

    @robojax

    4 жыл бұрын

    Thank you. 😄

  • @a.a.b3834
    @a.a.b38343 жыл бұрын

    Thank you so much finally i got it

  • @robojax

    @robojax

    3 жыл бұрын

    you are welcome. please subscribe. I appreciate it.

  • @crafts4mecrafter763
    @crafts4mecrafter7632 жыл бұрын

    still because old video didnt know if still active. hi great video so clear. i found the relays 12v 2 channel relay. please advise what else i need besides motor. i need arduino board and breadboard but dont know where to begin which model and style

  • @robojax

    @robojax

    2 жыл бұрын

    I have already send you the link to introduction to relay if you didn’t understand it from this video. Everything you need is shown in video.

  • @axelpalsson516
    @axelpalsson5162 жыл бұрын

    Great video, thank you so much! I just have one question. Is the current supplied to the motor from the battery, the relays or a combination of both?

  • @robojax

    @robojax

    2 жыл бұрын

    Hi, the motor is a load. So the power supply for the motor and relays can be the same. That is only possible if your motor is 5V and relay is 5V. if relay is 5V and motor is 12V or something else, then use separate power supply.

  • @mmanivannan6291
    @mmanivannan62914 жыл бұрын

    Excellent guidance !!! Program for CW and ACW direction is fine.What changes in the program to be made to start the motor rotation in clockwise and anticlockwise for 3 cycles and stop until the module is powered on again with a trigger from a switch or sensor ? Sir can you help me please.

  • @robojax

    @robojax

    4 жыл бұрын

    that needs separate video. Can't be explained here and because it very custom for specific feature, few people would want that so I can't make video for that.

  • @Bytemusic
    @Bytemusic4 жыл бұрын

    awesome Robojax thanks so much for this. Please can you explain how i can add to this a Limit swith to change polarity and a motor control (for speed)? thanks so much

  • @robojax

    @robojax

    4 жыл бұрын

    You are welcome. Once we talk about the speed, then we need to use Speed Controller and there won't be any relay. I just added it to my "to do list" and if time permits, I will make video. Thank you for not skipping the ads and keep watching them. This will help me a lot.

  • @Bytemusic

    @Bytemusic

    4 жыл бұрын

    @@robojax thanks again.. you are dope

  • @tomasmargelis8083
    @tomasmargelis80838 ай бұрын

    Thanks:)

  • @hannoseegers651
    @hannoseegers6513 жыл бұрын

    Thank you for the informative video! I have one question. Wont it be easier to connect the VCC to the NO(Normally Open) ports and GND to NC(Bormally Closed) ports? Therefore the connection will always be open and you dont have to turn both relays on for the connections to be open? Therefore you only have to turn on relay one for relay one to become positive

  • @hannoseegers651

    @hannoseegers651

    3 жыл бұрын

    Also, im currently using a raspberry pi, using node etc. But i doubt it'll make a difference in my question

  • @robojax

    @robojax

    3 жыл бұрын

    Hello and you are welcome. It won't work. in the introduction I explained with diagram how it works. we need to separate SPDT switch's. I've spend hours making diagram and recoding this video so you won't have any question. When I make video, I put myself in the position of a viewer and I can see all question that a viewer might have and answer them in the video. so please watch without skipping. I have not wasted time in this video. Good luck and your subscription with active 🔔 is appreciated.

  • @hannoseegers651

    @hannoseegers651

    3 жыл бұрын

    @@robojax no problem! Your video really helped me and was exactly what i wanted so i didnt skip the video. I was simply curious about the question. Once again. I really liked your video.

  • @robojax

    @robojax

    3 жыл бұрын

    Thanks. Stay safe.

  • @waynebrady953
    @waynebrady9533 жыл бұрын

    Thanks Ahmad, great video, i intend to use the 2 channel relay and a wiper motor in my project but wish to incorporate limit switches to stop the motor at a set position, basicly motor start, run to limit switch and stop, then when activated reverse position to second limit and stop...do you have a tutorial/code for this at all? Thanks

  • @Rainy_days_lover

    @Rainy_days_lover

    2 жыл бұрын

    Servo motor perhaps?

  • @crafts4mecrafter763
    @crafts4mecrafter7632 жыл бұрын

    hi great video so clear. i found the relays 12v 2 channel relay. please advise what else i need besides motor. i need arduino board and breadboard but dont know where to begin

  • @robojax

    @robojax

    2 жыл бұрын

    Hi, if you are totally new to Arduino then this is 30 minutes course kzread.info/dash/bejne/f5aWlNqaYbrJgrA.html but I have $200 Arduino course now offering it on KZread for free and here is a section of the course on relay kzread.info/head/PLHvJ4bw0xno4GS6Y3yxm1kEoKIkSWRXPs

  • @crafts4mecrafter763
    @crafts4mecrafter7632 жыл бұрын

    your lessons are fantastic. cant wait to create motor auto reverse for crane. can i use arduino to control speed?

  • @robojax

    @robojax

    Жыл бұрын

    search my channel. learn how to Search for a Particular video here kzread.info/dash/bejne/gZyft8WecrrJeNY.html

  • @prayoshavisiontech
    @prayoshavisiontech4 жыл бұрын

    First of all thank you for this video, Sir. I have 12v Dc motor, I want it rotate cw and ccw automatic same like in this video WITH speed controller. So where can I connect speed control in between ? Also one more question is If motor 12v ardruino also required with 12v ?

  • @robojax

    @robojax

    4 жыл бұрын

    Hi, You are welcome. I just added the link correct link to control direction of motor. this video and code is to just change the direction or Turn ON and OFF. no speed control. That's why we used relay to make it very simple. I have motor control related videos here kzread.info/dron/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=L298N

  • @ganesanraman1232
    @ganesanraman12324 жыл бұрын

    Can we add additional sensor for regulating ,like non contact liquid sensor

  • @robojax

    @robojax

    4 жыл бұрын

    Yes you can. this is Arduino and you can add as much as your Arduino pins permit.

  • @RJ593ec
    @RJ593ec2 жыл бұрын

    Gracias me sirvió. Aún que el idioma no entendí nada 🤣. Pero gracias a las conexiones entendí. Gracias

  • @ShrikrishnaShrikantGad
    @ShrikrishnaShrikantGad23 күн бұрын

    I'm want to control linear actuator using Arduino, 2-relay module and a 8 inch 200N linear actuator and 12v battery. Can the same connection and code be used for controlling a linear actuator without using push buttons?

  • @AkihiroGaming
    @AkihiroGaming4 жыл бұрын

    Good day sir, how did you control the voltage? Do you use code for reducing and increasing it?

  • @robojax

    @robojax

    4 жыл бұрын

    no voltage is controlled. this is just switch (relay is a switch) and speed of motor does not change.

  • @abualis1178
    @abualis11784 жыл бұрын

    Great session as always, can we use the same module to control the initial speed of the the motor, ie: I want the 220v motor to start slowly and gradually gain speed thanks

  • @robojax

    @robojax

    4 жыл бұрын

    Thanks. No you can't do it. this is just a switch. turn ON and OFF only.

  • @abualis1178

    @abualis1178

    4 жыл бұрын

    What can you advise to add to the circuit so I can manage the speed of 220V, I guess the Arduino won't do it but it will help with the on/off function only. Thank you.

  • @emanuelortiz3667
    @emanuelortiz36672 жыл бұрын

    Will you be able to program a schedule on and off for the motors. On any given day. For example Monday relay 1 turn on ccw for 30 seconds then relay 2 turn on cw for 30 seconds on the same day 30 seconds after relay 1 was activated?

  • @robojax

    @robojax

    2 жыл бұрын

    Hello, Yes you can but you need to use clock module to accurately track the day and date and time. here is video for that kzread.info/dash/bejne/aZx21rqdn8Snf7w.html

  • @masoudkuwait
    @masoudkuwait4 жыл бұрын

    Great video, really helpful, but, can you assist me in adding an ultrasonic sensor [HC-SR04 ] code for these motor code. when the sensor detect someone of 1 meter distance, it shall trigger the motor sequence run. Really means a lot to me.

  • @robojax

    @robojax

    4 жыл бұрын

    okay. if your ultrasonic sensor the distance is "distance" then you say if(distance >=1){ motorStop();}

  • @mpume.dzwane9213
    @mpume.dzwane92133 жыл бұрын

    Hi! Ahmad Shamshiri from Canada, I hope you well. I was wondering if you can make an automatic gate that open and closes using arduino, IR sensor. Thank you my good Sir.

  • @robojax

    @robojax

    3 жыл бұрын

    Hello, Thanks. I hope you are well as well. You did not mention which type of gate, but if it is home gate you could use actuator shown here kzread.info/dash/bejne/d5WjpJilltG5Z8o.html or if it is a tiny robot, then kzread.info/dash/bejne/oXmG2cygoruZlqQ.html good luck.

  • @atulkhatavkar6986
    @atulkhatavkar6986Ай бұрын

    Hi Sir how to change the direction of synchronous AC motor with Limit switch and Arduino. Plz make the video and we will be a delighted subscriber as usual 😂

  • @_rafiaahmad
    @_rafiaahmad4 жыл бұрын

    Sir can we give +5v and GND to relay instead of +9v and -9v?

  • @robojax

    @robojax

    4 жыл бұрын

    We have operating voltage and motor voltage. If relay is 5V, then give it 5V (like shown here) if relay is 12V then connect 12V. But for the motor if your motor is 24V connect 24V if it is 5V then connect 5V.

  • @HelderC86
    @HelderC864 жыл бұрын

    Hola, excelente, el motor solamente logra moverse para una sola dirección, hice el cableado como explicas y el mismo código. Que estará sucediendo? Saludos.

  • @robojax

    @robojax

    4 жыл бұрын

    Gracias. Si no cambió el código, el cableado debe ser incorrecto. Entonces, el cableado o el código son incorrectos.

  • @eduardojose8384
    @eduardojose83842 жыл бұрын

    My load is an actuator instead of a motor so I can open and close. However when the actuator is connected the relay seems to trip and it remains in the closed position (actuator remains on). What could be the root cause? Actuator works fine when tested with a 12v battery and code on Arduino works if the actuator is not connected. Thanks.

  • @robojax

    @robojax

    2 жыл бұрын

    Please watch this kzread.info/dash/bejne/d5WjpJilltG5Z8o.html

  • @crafts4mecrafter763
    @crafts4mecrafter7632 жыл бұрын

    what is the model of the uno board?

  • @robojax

    @robojax

    2 жыл бұрын

    The model does not matter . Get any Arduino board . It will work. Arduino UNo, Arduino Mega, Arduino nano or digispark and others will work.

  • @abdullahbatawil283
    @abdullahbatawil2832 жыл бұрын

    Is this applicable for stepper motor as well?

  • @robojax

    @robojax

    2 жыл бұрын

    No. Stepper motor has 4 or more wires.

  • @mtalhakhalid1679
    @mtalhakhalid16793 жыл бұрын

    Nice tutorial sir i had same relay module 3 chanel one its rating is 10mp andi want to power my water motor with it its rating is 170W which is 3.36Amp is it safe to plug that with relay?

  • @robojax

    @robojax

    3 жыл бұрын

    I can’t say anything. I explained in video. It should be clearly written on the relay. So decide accordingly.

  • @ruturajkale1145
    @ruturajkale11452 жыл бұрын

    Can the same circuitwork on raspberry pi?

  • @robojax

    @robojax

    2 жыл бұрын

    Yes it will work if you way it the proper code.

  • @marcelmendes8468
    @marcelmendes84684 жыл бұрын

    good evening i have a 110v ac motor i want it to start and stay 3 seconds on and off after 3 seconds and turn on 2 hours later how can you?

  • @robojax

    @robojax

    4 жыл бұрын

    Hello, this is for DC motor only.I have tones of videos on timers kzread.infosearch?query=timer

  • @Avogsanstanihindulougf
    @Avogsanstanihindulougf7 ай бұрын

    Hi sir I want halp this tipe circuit making multiple function 5 to 10 dc moter run use project possible?

  • @robojax

    @robojax

    7 ай бұрын

    Hi, Sure you can. but you need lots of pins, you need Arduino Mega with 50 pins and for push buttons you can use only one input, look at this video kzread.info/dash/bejne/c31h3Nymg728lto.html

  • @khalmaxroboticsgh3176
    @khalmaxroboticsgh31762 жыл бұрын

    Iam working on a project that uses 4 wiper motors. I once had a mosfet irf3205 hbridge burnt with 12v power supply using the wiper motors. can I use the reply with multiple wiper motors..

  • @robojax

    @robojax

    2 жыл бұрын

    Find out or measure the current foe the wipers and if it uses las than the rates current of the relay, then yes.

  • @khalmaxroboticsgh3176

    @khalmaxroboticsgh3176

    2 жыл бұрын

    @@robojax thank you very much. When using an h bridge I learnt the ground on the wiper motors are connected to their casing and this can cause a short circuit and damage the motor controller anytime you are controlling more than one wiper motor.. When using a relay, do I need to open the wiper motors and disconnect the ground as its done when using motor drivers

  • @gokulmoolayil
    @gokulmoolayil3 жыл бұрын

    Hi sir ,if i want to stop the motor by turning off 2 relays ,that means - ve is connected to both the pole of motor Or vice-versa +ve is connected to the both pole of motor , in this case will the motor get damaged ?

  • @robojax

    @robojax

    3 жыл бұрын

    Hi, if you connect only ONE terminal for example positive of your battery to anything, including motor, nothing will happen. for anything to happen, we need to complete the circuit. so both positive and negative must be connected so the motor moves or something happens.

  • @lucianocernello3246
    @lucianocernello32463 жыл бұрын

    I am sorry for posting a question in a year old video. But I am currently having issues with two gate motor that have 3 cables, 2 positives and 1 negative for both direction of the motor. Can I just use one relay channel for both movements (Opening/closing) or do I really need to buy a second 2 relay module? As I understand it one of the circuits is always Open so electricity is always flowing so I cannot just plug in two positives in one relay channel or as soon as I install the arduino with the motor it will start opening or closing even if the relay is OFF. I am a bit lost here. I appreciate any help, thanks in advance!

  • @robojax

    @robojax

    3 жыл бұрын

    don't be sorry. this is great question and I love to help if I can. I haven't seen such motor yet. but if you can say it has GND and then two wires for CW and CCW, then sue you can use ONE relay. if you are using ONE relay then the motor can never ben turned OFF by this system. so you will need separate OFF switch. Please watch the introduction to relay video here kzread.info/dash/bejne/gGGaqM1uYajIaNY.html

  • @lucianocernello3246

    @lucianocernello3246

    3 жыл бұрын

    @@robojax Thank you for the answer. After watching the video I understand a bit more what you mean but I think I am still a bit lost. I currently have relay 1 and relay 2 in HIGH so one of the flows of electricity goes to CCW on both motors. If I stop supplying 5v to the relay itself from the arduino would that stop the circuit at all? I don't understand where that OFF switch would go. For more clarity on what I am trying to do, I am using Blynk(with ESP-01 wifi module) to try and make the gate of my house automated for me to enter without getting off my car with the two motors I mentioned

  • @robojax

    @robojax

    3 жыл бұрын

    for ON off switch, please watch this video kzread.info/dash/bejne/loqcmZmwhJCacdI.html where I show how to turn ON or a light. I don't like th B-L... service as it is not free and does not offer free service.

  • @ddbrothers5718
    @ddbrothers57182 жыл бұрын

    Plz make a video on ac single phase motor rotation change

  • @robojax

    @robojax

    2 жыл бұрын

    Very interesting idea. It needs modification of wiring of inside motor.

  • @kirannb5354
    @kirannb53545 жыл бұрын

    Nice

  • @robojax

    @robojax

    4 жыл бұрын

    😄

  • @TechsScience
    @TechsScience5 жыл бұрын

    You can make this project with DPDT switch

  • @robojax

    @robojax

    4 жыл бұрын

    Yes I could. Then you don't need arduino. You are right I should make video . Thanks

  • @castelmichel8670
    @castelmichel86709 ай бұрын

    Can I run 24v motor with this set up? Thanks

  • @robojax

    @robojax

    9 ай бұрын

    I belive I mentioned that the relay is just a switch. so you can turn ON/OFF anything with any voltage. Only pay attention to the load current which should not exceed the rated current of the realy.

  • @nelgalapin8068
    @nelgalapin80682 ай бұрын

    Good Afternoon Sir! Is there a chance that I can put start and stop button in this project? As well as timer?

  • @nelgalapin8068

    @nelgalapin8068

    2 ай бұрын

    Also Sir, I want to make it IoT

  • @garudakurt5166
    @garudakurt51662 жыл бұрын

    is this work with wiper motor ?

  • @robojax

    @robojax

    2 жыл бұрын

    I used relay and as I explained it it is a switch. And I have shown what a relay does.

  • @adipose5724
    @adipose57243 жыл бұрын

    Hello, I have a question. Where are the two extra wires of the dual relay connected to? Why can't my motor rotate, only the two lights of the relay are flashing

  • @robojax

    @robojax

    3 жыл бұрын

    Hello, all the wiring has been explained. nothing left without explaining. first relay has been explained then wring. please watch. This can't be explained better than this.

  • @limarisayala734
    @limarisayala7342 жыл бұрын

    Awesome Video! How did you connect the code to the arduino? Is the code run from a computer and connected via USB? Could a solar panel with a compatible voltage be used instead of a battery as a power source?

  • @robojax

    @robojax

    2 жыл бұрын

    Thanks. your question is very basic. You program on Arduino, then send the code the Arduino board and never needs computer. Arduino Step by Step Course (over 150 lectures) Starts here robojax.com/L/?id=338

  • @limarisayala734

    @limarisayala734

    2 жыл бұрын

    @@robojax thank you. With the relay being connected to a battery, would it still run if you disconnected the arduino from the computer? Or would the arduino and relay need two separate power sources to run?

  • @kjboygaming6681
    @kjboygaming668110 ай бұрын

    Can u help for my project

  • @syphertdg1746
    @syphertdg1746 Жыл бұрын

    Please how do I increase the voltage supplied to the motor to 12v

  • @robojax

    @robojax

    Жыл бұрын

    my friend. it seems you either did not watch or did not understand. your motor voltage is up to you. if you want to run 10V or 100V motor it is up to you.

  • @abdullahsalem3695
    @abdullahsalem36952 жыл бұрын

    Can we control such motor with ultrasonic sensor? I'm just a beginner at ardiuno, I'm going to have a similar case to what you shown in the video, but the reverse of motion will be controlled by ultrasonic sensor, how can this be done with your connection?

  • @robojax

    @robojax

    2 жыл бұрын

    Yes you can. Arduino Step by Step Course (over 100 lectures) Starts here kzread.info/dash/bejne/X2qltdR9haSbkZs.html

  • @abdullahsalem3695

    @abdullahsalem3695

    2 жыл бұрын

    @@robojax Thank you for your reply.I mean,if I connect the motor just how you did with the same coding, and I have already connected and coded the supersonic sensor, how can I take that at distance of 10 cm to send a signal to the motor to stop and then reverse? Is it possible? Do I need extra equipment? Or is there somthing in the coding I can do to send the signal

  • @jimmatrix7244
    @jimmatrix72444 жыл бұрын

    Why did you declare redundant variables for "HIGH" and "LOW"?

  • @robojax

    @robojax

    4 жыл бұрын

    I had to open the code page and read it before I could reply to you. I did not declare . I assigned them to relayON and relayOFF . If I didn't , then for LOW level trigger (turns ON with LOW) and HIGH level trigger (that turns ON with HIGH) the person would be confused. Now we have relayON which always the same for LOW and HIGH level trigger. and this makes it very straight forward.

  • @MrBobWareham
    @MrBobWareham3 жыл бұрын

    Thank you for the explanation you made it easy to understand

  • @alexanderverastegui2199
    @alexanderverastegui21994 жыл бұрын

    Good night friend, how do I stop the sequence of this program in the engines at a certain time and start where I end?

  • @robojax

    @robojax

    4 жыл бұрын

    Use millis() to calculate time and do something see this video kzread.info/dash/bejne/p2Z81cuNg5vUmbQ.html or look at my other videos

  • @alexanderverastegui2199

    @alexanderverastegui2199

    4 жыл бұрын

    @@robojax será que me puede ayudar con el código con un ejemplo lanceroswifi@gmail.com mi correo

  • @alexanderverastegui2199

    @alexanderverastegui2199

    4 жыл бұрын

    @@robojax I have two motors I want to rotate forwards and backwards, but they stop at a certain moment and then pick up or start where they stopped or I order them to do the sequence

  • @8ctopus0000
    @8ctopus00003 жыл бұрын

    Is this a 5V motor or is the battery a higher voltage? Does the Vcc of the relay need to match the V+ of the motor for an opto-relay? Great video, love the diagrams, wiring details and code, really easy to follow!

  • @robojax

    @robojax

    3 жыл бұрын

    I am glad you found it useful. I used 12V power with 12V motor. but you can use 5V or any other voltage you like. Please don't forget to spare your subscription which costs you nothing.

  • @nagarjunakr1782
    @nagarjunakr17822 жыл бұрын

    I have used this relay connection to open and close gate project, but when I try to close gate without motor running with power, its becoming very hard. I have try to rotate motor with bear hands and it was too hard, but if I remove relay wires from motor, then its very easy to rotate motor with hands. Can you help me what should I do to make it easy to rotate with relay connected to motor?

  • @robojax

    @robojax

    2 жыл бұрын

    this is interesting. I realize that the relays are connecting the output wires of the motor creating circuit that when you rotate the motor, it creates brake. I am not sure how you did the wiring, but inside the code somewhere when the motor is not running, we should open or close one or both relays such that the wires from motor are free and not creating a loop circuit with the motor. this is the best I could not as it needs working and practically resolving this. good luck.

  • @nagarjunakr1782

    @nagarjunakr1782

    2 жыл бұрын

    Sir, I have done the same wiring which you have done and its working fine to forward, reverse and stop (keeping both on HIGH) as well. Even relay is not connected to power and if I try to rotate shaft, its becoming more hard. I am using geared DC motor.

  • @VijayaLakshmi-eg4ss
    @VijayaLakshmi-eg4ss2 жыл бұрын

    Good morning Shiri sir, please give me one circuit about xyj 02 timmer relay with2no limit switch and 5rpm synchronise motor?

  • @robojax

    @robojax

    2 жыл бұрын

    Hi, I am not sure what you are looking for. you can search my videos on my channel. here is how to find a video on a youtube channel bit.ly/findKZreadVideo

  • @FranciscoSilva-zt3qj
    @FranciscoSilva-zt3qj4 жыл бұрын

    Can i use a timer instead of using an arduino?

  • @robojax

    @robojax

    4 жыл бұрын

    what is timer? it must be a microcontroller. Arduino is a microcontroller. Some time people put a microcontroller on a module and program it so you can't change it. here is timer kzread.info/dash/bejne/i2Wb2bGkgNfXc8o.html and time with 2 relay kzread.info/dash/bejne/gWRlsKWToZq1YrA.html

  • @FirstLast-tx3yj
    @FirstLast-tx3yj4 жыл бұрын

    I want 2 dc motors to follow certain movement pattern after pressing a botton. I have two bottons red and blue For example: 1st time i press blue: motor 1 (5°CW) 2nd time i press blue: motor 1 (10° CCE) motor 2 (5° CW) 3rd time i press blue: motor 1 (15°CW) Now at any point I might press the red botton then the motors will reverse there movement (move in opposite direction and order). For the whole project I need the two motors, four relays and 2 arduinos and the program right?? I know there is tons more detail but comment on the general view. Please reply to me sir thank you

  • @robojax

    @robojax

    4 жыл бұрын

    Hi, This is a complete project and needs a full or two days to be done. I am very busy and have no time to do that.

  • @FirstLast-tx3yj

    @FirstLast-tx3yj

    4 жыл бұрын

    @@robojax off course it will even take more than that with me. I am not telling u to do my work. I am just asking u if what am thinking is right. Basically just the main components that i need for the recipe. 2 motor, H bridges, arduinos, and then programming right?

  • @robojax

    @robojax

    4 жыл бұрын

    for single motor as shown in video you need Dual relay module (or 2 relays) and for 2 motors, double it. then you will need wires and of course Arduino board. Cheers

  • @FirstLast-tx3yj

    @FirstLast-tx3yj

    4 жыл бұрын

    @@robojax thank you brother

  • @alexanderverastegui2199
    @alexanderverastegui21994 жыл бұрын

    please make a video with this same code using millis instead of delay

  • @robojax

    @robojax

    4 жыл бұрын

    you want something that there is no demand for it. I send you the link. it seems you don't want to learn. I have explained every line and every piece of code. just watch it and it should work here are two videos on millis() kzread.infosearch?query=millis

  • @bbgfxxftghjjjhbfdddddffg8139
    @bbgfxxftghjjjhbfdddddffg81394 жыл бұрын

    I want the dc motor fwd rev without stopping...

  • @robojax

    @robojax

    4 жыл бұрын

    very simple change the code. Learn Arduino in 30 Minutes (video): robojax.com/L/?id=135

  • @BilalKhan-do9il
    @BilalKhan-do9il3 жыл бұрын

    Have you done any video on optical encoder with Arduino ,if yes please share the link,if no please do it😃

  • @robojax

    @robojax

    3 жыл бұрын

    are you referring to rotary encoder? no I have not. yet.

  • @BilalKhan-do9il

    @BilalKhan-do9il

    3 жыл бұрын

    @@robojax yes rotary optical encoders ,please do one!

  • @ritikumrigar2184
    @ritikumrigar21843 жыл бұрын

    hi!! i want to connect this 2ch relay with a reciever so how to connect 2 signal input terminal of relay to one reciever output??? pls help

  • @robojax

    @robojax

    3 жыл бұрын

    Hi, you did not say which receiver. but if the receiver has above 2.8V to 5V, it will work.

  • @ritikumrigar2184

    @ritikumrigar2184

    3 жыл бұрын

    @@robojax is an austar 3ch rc tx rx!!

  • @ritikumrigar2184

    @ritikumrigar2184

    3 жыл бұрын

    @@robojax i have connected reciever with bec from 3s lipo!! i want to use relay for changing direction of motor!! because my esc does not have reverse mode

  • @robojax

    @robojax

    3 жыл бұрын

    if you want to use just receiver, then you need to use two channels. one for CW and once for CCW because receiver outputs different PWM signals. or use arduino to decode it . I don't have any video on RX Tx with Arduino

  • @ritikumrigar2184

    @ritikumrigar2184

    3 жыл бұрын

    @@robojax i was thinking of using two channel relay, when it is normally open it will rotate in one direction and when i press a button which is channel 3 on my reciever it will change polarity so i can use reverse mode for motor!! is it possible?

  • @roystervi
    @roystervi4 жыл бұрын

    Hi am testing with a battery and a meter and I could only get it to read power in one direction.. what am I doing wrong? why its not read - 4.17 and +4.17

  • @robojax

    @robojax

    4 жыл бұрын

    check wiring. watch it multiple times. do not change the code.

  • @roystervi

    @roystervi

    4 жыл бұрын

    @@robojax thanks l got it working. I am using esphome code for my homeassistant. I had to add "interlock: [Id name] plus "interlock_wait_time: 1000ms. My setup is 2 12v DC attic fans and you can't go forward to reverse right away or the power supply will pop a fuse so adding a delay of 1000ms work great. I'm using 2 30amp 5v relays anything else would burn up.

  • @robojax

    @robojax

    4 жыл бұрын

    you are welcome. I am glad you were able to fix the issue. Good luck.

  • @aavesh.bagwan
    @aavesh.bagwan Жыл бұрын

    Bro is it safe to do it I am going to use it in my project called hand gesture controlled wheelchair where I am going to control 350 watt motor with this relay.

  • @robojax

    @robojax

    Жыл бұрын

    I have explained the amount of power each relay can take. usually they are rated at 10A. So do the math P(watts) =V÷I, where I is current in Ampere.

  • @aavesh.bagwan

    @aavesh.bagwan

    Жыл бұрын

    @@robojax thanks bro I will do it 👍

  • @watchandearn1564
    @watchandearn15644 жыл бұрын

    or where i can buy this

  • @robojax

    @robojax

    4 жыл бұрын

    which part? Arduino is Programmable board which is sold everywhere. Then we have relay module. Because it has two relay, it is called dual relay. you can buy them from Amazon, eBay or AliExpress.

  • @gautamgupta101
    @gautamgupta1012 жыл бұрын

    what is the rating of motor that he used

  • @robojax

    @robojax

    2 жыл бұрын

    Motor used in this demonstration is HTBRR04206705B. I've added details in the code page as well.

  • @watchandearn1564
    @watchandearn15644 жыл бұрын

    hi do you sale such chips i am interested to buy

  • @robojax

    @robojax

    4 жыл бұрын

    which part? Arduino is Programmable board which is sold everywhere. Then we have relay module. Because it has two relay, it is called dual relay. you can buy them from Amazon, eBay or AliExpress.

  • @SonPham-ww6sw
    @SonPham-ww6sw Жыл бұрын

    Your tutorial is so awesome. Can you tell me how to connect the switch or sensor for the door to open and close by itself?

  • @MultiTechEducation4U
    @MultiTechEducation4U3 жыл бұрын

    Nice Video , Mr. Ahmed Shamsheeri, want to Join u sir.

  • @robojax

    @robojax

    3 жыл бұрын

    Here is $200 Arduino course for free Arduino Step by Step Course (over 100 lectures) Starts here robojax.com/L/?id=338

  • @MultiTechEducation4U

    @MultiTechEducation4U

    3 жыл бұрын

    Its for rich students, what for poor~😊

  • @MultiTechEducation4U

    @MultiTechEducation4U

    3 жыл бұрын

    Today I launch a video introducing my plateform there I praised your site and will send link to mu poor students

  • @MultiTechEducation4U

    @MultiTechEducation4U

    3 жыл бұрын

    In this video I already mentioned about Robojax

  • @ahmadalbabchannel4412
    @ahmadalbabchannel44123 жыл бұрын

    How to control forward reverse using switch?

  • @robojax

    @robojax

    3 жыл бұрын

    I have explained it وافق watch the video and learn. then from other videos with push button which I can see yo posted comments, just use that push button to change the HIGH to LOW or LOW to high to make the motor rotate in different direction. I have tones of videos on push buttons. Even motor with push button. Search for it.

  • @ahmadalbabchannel4412

    @ahmadalbabchannel4412

    3 жыл бұрын

    @@robojax for the coding?

  • @ahmadalbabchannel4412

    @ahmadalbabchannel4412

    3 жыл бұрын

    Can make 1 Video for.. Forward And Reverse dc motor use Switch - Forward Stop Reverse ..please..😭

  • @isz9772
    @isz9772 Жыл бұрын

    Sir can you make one video same like this but using 2 switch to change the directions of motor🥺but still using the same connection

  • @robojax

    @robojax

    Жыл бұрын

    very interesting. I will try to make that video. thanks

  • @isz9772

    @isz9772

    Жыл бұрын

    Thnks🥺

  • @bazgamingshorts1690
    @bazgamingshorts16902 жыл бұрын

    Salam sir

  • @bazgamingshorts1690

    @bazgamingshorts1690

    2 жыл бұрын

    Sir please generator module share

  • @manmohansingh8786
    @manmohansingh8786 Жыл бұрын

    How can I control the speed of motor?

  • @robojax

    @robojax

    Жыл бұрын

    You should have searched my channel but I am in good mood and I did the search for you kzread.info/dash/bejne/qaJpppmjYdzIqLw.html

  • @Yientrbl
    @Yientrbl3 жыл бұрын

    how to control motor using 2 relay with ir remote control

  • @robojax

    @robojax

    3 жыл бұрын

    yes and I have tones of videos on Infrared. Simple search shows it kzread.infosearch?query=remote

  • @kjboygaming6681
    @kjboygaming668110 ай бұрын

    Hi

  • @NarendraSharma-zd8gx
    @NarendraSharma-zd8gx2 жыл бұрын

    Sir I want Drive motor Clockwise and anticlockwise with start button like that when I press button Motor Drive Clockwise for Ten seconds and Stop and Press again button Motor Drive anticlockwise for Ten seconds and Stop. This program running continuosly continuosly press button Motor Drive Clockwise ten seconds and Stop Press again motor Drive anticlockwise ten seconds and Stop

  • @robojax

    @robojax

    2 жыл бұрын

    this video is about motor. what are you talking about? please post your question under the related video. if your question is not related to video, then posted it on Arduino forum forum.arduino.cc/

  • @NarendraSharma-zd8gx

    @NarendraSharma-zd8gx

    2 жыл бұрын

    Please Help me

  • @robojax

    @robojax

    2 жыл бұрын

    I have already helped you. Is google yo translate it if you did not understand it

  • @crafts4mecrafter763
    @crafts4mecrafter7632 жыл бұрын

    do you still reply to questions?

  • @robojax

    @robojax

    2 жыл бұрын

    Why you say “still” ? I am not dead yet. Lol

  • @robojax

    @robojax

    2 жыл бұрын

    I read every single comment and if there is a question that is not answered in the video I reply.

  • @wiktor_nosa
    @wiktor_nosa4 жыл бұрын

    wiring to module start at 10:20

  • @robojax

    @robojax

    4 жыл бұрын

    I have already provided the link to all section of the video in the description.

  • @haroonrasheed1375
    @haroonrasheed13753 ай бұрын

    With 40 degree rotation

  • @crafts4mecrafter763
    @crafts4mecrafter7632 жыл бұрын

    sorry i dont see any links

  • @robojax

    @robojax

    2 жыл бұрын

    Check again. All my videos have link in the description of below the video.

  • @husseinahmedhussein1570
    @husseinahmedhussein15702 жыл бұрын

    الكود فين

  • @robojax

    @robojax

    2 жыл бұрын

    عندما تتخطى الفيديو ، هذا ما يحدث. تحت كل مقاطع الفيديو هناك وصف. لدينا روابط في منطقة وصف الفيديو أسفل الفيديو.

  • @marianoronha593
    @marianoronha5933 жыл бұрын

    Gazolinas do carro está pronta tá estados unidos último foguetes essa gazolinas será mais evoluídas para gazolinas bioferas ok sim agora sim nunca o amiga sou mente rica ok eclaro que sim e tou feliz

  • @marianoronha593
    @marianoronha5933 жыл бұрын

    Ferragens dele e primeiro mundo ok feito com mesmo material do avião e revestidos ok como colagens de fora erefeita com cristal e junsao ok deretendo cristal ok portas dele cores e de diamantes ele lindos 120carros ok sim ok sim PACTa tá com migo Denize ok

  • @robojax

    @robojax

    3 жыл бұрын

    Olá, usei o google para traduzir e não entendi o que você está tentando dizer. Desculpe.

  • @marianoronha593
    @marianoronha5933 жыл бұрын

    Os carros dou filho Rubens Denize bortoletto Gabi tirando leia ela eu ok mal amiga essa mulherzinha não presta esse carro edanize eda mãe do Sandro Rodrigues ok eteu leia ok Maria tá nojo de você ok eu colho amiga Denize você que querida tudo ótimo ok

Келесі