Arduino firefighting robot trouble

Submitted by Alex on Mon, 07/12/2021 - 23:37

Hello Everyone! Total newbie here. I have built 2 separate but very similar (different code for each) fire fighting robots in the last few days and both did the same wrong thing. I am not the creative type and I didn't come up the schmatics on my own. The first one I found on YT and the second I found here. The first one I made went AWAY from the flame. That seemed easy enough to fix so I switched some wires around. It didn't help and on my third (something in the back of my mind said not to do this on that particualr set of wires, I should've listened but I needed to know) switching of wires it started to smoke. Ended up melting some wires and burning up a motor driver. I thought I should start over with a different model and code, that's when I came across the one here. When I test this one this is what happenes: it turns 180 degrees around ending up facing away from the flame. I followed the directions EXACTLY and checked and double checked. I think it is very stange that I'm having the same problem with both builds. The first one I used four wheels and four motors and though maybe I crossed some wires on that one, but the one I found here only uses two wheels and motors' very staightforward wiring on that one. Also I used two separate sketches, the ones provided by the individuals who posted their projects. Intuitivelt this seems like a simple problem to figure out, but I have not been successful yet. Can anyone help?

Have you cheked the wirings of the motor and sensor?

  Joined February 12, 2018      696
Monday at 02:11 PM

Yes, I have checked the wiring multiple times. The sensors' DO pin is connected to Arduino pins 8, 9 and 10, VCC to 5V of Arduino via breadboard and ground of Arduino via breadboard. I switched the pins on the left and right sensors to troubleshoot, no change. The motors are connected to the motor driver pins A+ A- and B+ B- which seemed the only obvious place to connect them and I assumed that one motor goes to A and one motor to B, not one wire from each motor going to A and one wire from the same motor going to B.

  Joined July 12, 2021      2
Monday at 11:15 PM

You need to understand whether the motor is turning reversly! If so, you need to change wiring or change the code.

  Joined February 12, 2018      696
Monday at 02:11 PM

Thanks so much, Sourav! You are correct, I changed the motor wiring and it goes towards the flame now. I assumed that red motor wires went to + and the black to - but it seems that they can be arranged in whatever way works for the user! Now I just need to figure out how to slow down the robot, I didn't write the code as I mentioned above so I'm not at all sure where or how to slow the speed of the motors. 

  Joined July 12, 2021      2
Monday at 11:15 PM

Glad to hear that.

Please make a new thread and ask the question as a new question so that everyone could know your problem and help accrodingly.

 

Thanks a lot.

  Joined February 12, 2018      696
Monday at 02:11 PM