Author Options:

Project help? Answered


I am trying to build my own version of OneWheel. [ Working principle similar to that of a segway.]

I am using PMDC motor MY1020Z, sabertooth motor driver 2x60, Arduino Mega, MPU6050, 12V 7Ah Lead acid batteries for my build. I have written a code and it seems to work fine, but occasionally the Arduino stops and motor spins independently of control signals. I would like to have your inputs how I could prevent this glitch and point out any mistakes that I might be making.

I can send the photos of my build, and the arduino code to you.



The issue may not be a coding problem. In order to smooth these glitches out, try to use an Arduino Robot for the potentiometers and accelerometers that directly talk to the Arduino Mega.

Do you want the motor to turn off when the Arduino stops? If so, use a relay. You can have the Arduino engage the relay which will provide power for the motor. When the Arduino stops, the relay turns off and the power gets cut.

Also, what exactly do you mean the Arduino stops? Does it reset?

That might not be a code problem.