Let's Make Robots!

Motors strange movement???

Hello,

I am working on making a tiny obstacles avoiding robot (with the picaxe 08m). The robot use small dc motors to move and a MaxSonar sensor to detects objects.

Image 1

The problem is that when I set all pins on the picaxe chip to low, the motors movie in pulses, as if its somehow picking up the pulses from the sensor.

Here is my schematic:

Anyone know why its doing this???

Thanks.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
OddBot's picture

According to your schematic there should be no problem with the hardware but you have not given us nearly enough information to help you. What batteries are you using, NiMh or Alkaline? What voltage are you getting?

If you unplug the sensor does the motor still twitch? If it still twitches then the problem is in the software and you need to show us your code.

While the 100nF capacitor will filter high frequency noise you should also have at least 100uF across your supply for suppressing surges when bigger loads like your motor comes on. The sonar emmits a burst of sound at regular intervals. This can cause your batteries voltage to drop briefly.

If you check the sonar datasheet it may even recomend having a capacitor across the power pins of the sonar. The picaxe has a brownout detector. If this is tripped by power surges then that could cause the problem. As a last resort you can disable it. See disablebod in manual 2.

 

 

Faris's picture

I have added the resistor mentioned by octospider and put a 100nf capacitor between GND and VCC. But nothing changed.

So I set all outputs to low again, replaced the motor with an LED, but it kept flashing.

Any Idea?

octospider's picture

Are you sure that you are pulling the outputs low. Could it be that they a set in tri-state mode (floating).

I would put a resistor from the point between the existing resistor and the transistor to 0V. The size depends on the size of you existing resistor, but try with at value between 2k - 5k.

RobotFreak's picture

It's always recommended to put a 100nF capacitor between GND (V-) and VCC (V+) on eyery IC or µC.