Eratic interrupts

Hi All,

I am making a table tennis robot using diecimila board as the main controller. The project consists of wrecked floppy drive and a tape recorder DC motor and a Hitec servo as an oscillator.

Basic operation is arduino starts the DC motor and positions the robot using the servo. Once the desired angle is reached, the floppy drive stepper motor is activated to feed the ball thru the tube.

So far so good. The problem arises when the ball hopper becomes empty. I am using pin 2 as an interrupt which will suspend the ball feeding and servo mechanism until the hopper is filled again. Even this mechanism is working as expected. However, the interrupt is fired sporadically and the board gets reset in unexpected ways. After much hair splitting, i found out the DC motor while running generates magnetic fields in the surrounding metal parts and fires the interrupt. This i confirmed by switching off the DC motor and running the rest of the setup.

I tried a couple of band aid solutions like putting a ceramic capacitor across the ground and such, but the problem persists.

Any help is appreciated.

Cheers Kannan

It just generally sounds like a power stability/filtering issue. How is the electric motor powered? A schematic of how you have everything hooked up would be very useful to help diagnose the problem.

You also might not have an appropriate pull up/down resistor on your "interrupt" line and noise from the motor is causing the state change. Once again a schematic with actual values of the components used will help determine this.


Thanks for the reply.

Power supply is desktop computer SMPS and the DC motor is 6v DC type , though i supply 12v thru TIP122 with 75% duty cycle pwm signal.

12V | |----| Motor O ^ IN4001 | 1K |----| |------====----- --K TIP122 | PIN 9 |

| |


The hopper switch is a basic limit switch with 1k pullup connected to +5v. So when switch is pressed, pin 2 changes to active low and interrupt fires.

5v | | | 1K | | | | |-------------------------| Pin 2 of 168 | | |---- Switch |



If i switch off the motor or keep it at some distance the problem goes away.

Hope my schematics are helpful:)

Thanks Kannan

Contact bounce on the switch driving the interrupt pin? You might want to add contact debouncing logic inside the interrupt routine, ignoring short duration pulses.


Yeah, I've already tried the debounce lib, but still the interrupt fires when the motor is on. I am trying to shield and ground the entire chassis to arrest the noise.

Thanks Kannan

Ha.. made some progress with the design, it is now interfaced with 3 pin IR receiver and i can control using the Sony remote control. The push button is removed completed. DC motor noise is arrested with 2 ceramic capacitors across the power connections and the middle pin going to the chassis.

However there is another problem i found with the Hitec servo i am using to control left/right Oscillation of the robot. That is whenever i try move the servo to a new position, which is almost every sec BTW, i sense an interrupt on Pin 2 which is already connected to IR.

Though i have put some code to filter out spurious interrupts like this, after some time the the servo stops completely, even though the IR and other parts are working OK.

I am using Diecimila with the Servo lib. Interestingly if i disable the interrupts the servo works forever perfectly. It is weird why it triggers an interrupt every time it moves ?

Any help is appreciated.

Cheers Kannan