Can somebody help me with Arduino radar problem ?

hi I'm working on a radar project for school I uploaded the the sketch and everything was fine here are the sketches I'm working with :

sketch_feb04c_new.ino (2.0 KB)

sketch_211223a_radar.pde (5.4 KB)

when i connect the Arduino the servo works just fine but when I start the processing sketch the servo resets and the radar screen get stuck even though the servo is still moving and the the sensor is conected

but if i disconnect the servo motor and restart the sketch the sensor work's just fine.
Note that they did work together just fine before but when tried again it didn't and then it did and then didn't so I'm kind of lost here any help would be appreciated thank you.

Don't power the servo from the Arduino.
Also, when the Processing sketch gets stuck, it has crashed. Press ESC on the computer and maybe click on the screen a couple times, you will get a notification about the sketch not responding, or something like that. There will be an error message in the Processing sketch, what does it say?

It doesn't crash I just tried reseting the Arduino and it worked then disconnected the Arduino and connected it again and it did it again.

I mean really don't power the servo +5V from the Arduino if the power to the Arduino is your PC USB port. You'll blow the port, servos demand lots of current and your USB port isn't designed to deliver it.

Take the servo out entirely and try again. Same everything, just disconnect the servo, all three wires. I don't know what servo you're using but it's a good way to ruin the USB port.

1 Like

Ok thank you so much
And I just tried reseting it again after a few moments from connecting and it worked again but even if this fixes it I think you're solution is far better so thank you

No problem. You have a little brother or sister? They're always handy for menial tasks, have them hold the sensor and oscillate it across the 180 degrees or so the servo would be doing until you work out how to power that servo separately. Don't use your cat if you have one, they can't be trusted in this line of work.
The servo connection to Arduino should always be digital control pin and ground only. The 5 volts you have to get from an external power source.
Did you know you can change the screen size of that sketch to match the screen resolution? Might come in handy when you show it off at school.
Good luck.

Ok thanks :sweat_smile:

1 Like

By the way I just tried sending else and it seems that it was the problem apparently if I press start in processing and the motor was not on the starting angle of zero the sketch would lag but if I time it works just fine tried a couple of times and it kept working might as well be the be the dumbest thing ever but it worked :joy:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.