Unstable Operation of Arduino (HC-SR04 Ultrasonc sensor)

Hi Guys,
We have a problem with our robot and need help. We are currently working on a line follower(Pololu 8A sensor array) robot which has also other abilities like sensing coming robot (SR-HC04 Ultrasonic Sensor and Sharp IR sensor) and tracking the robot and small servo motor.

We have tested our robot supplying Arduino Mega 2560(not genuine) from USB port and DC Motors by DC Power source. The operation is as we expected.

Due to the quickly drained 9V batteries we have moved to LiPo. LiPo battery is 11.1V(12.6 when fully charged) 1450mAh C 25.
we are using 2 Voltage regulators with 9V output (L7809) for supplying Arduino and 2 DC motors seperately. We are driving motors by Motor driver circuitry.

  1. Today we have assembled our LiPo battery and tried the robot. Unexpectedly, our robot oscillates slightly more than before and our Ultrasonic sensor seems to measures always below 6cm and does what si need to be done in the case of d=6cm. But using USB port for powering the Arduino there were not any such problem. What might be the problem?
    We have also tried to power all sensors externally not by Arduino 5V source. But the same result.

  2. We may try supplying arduino by Vin pin? Can we use Vin port to supply power ? if yes what is the input voltage range?

Hi, have you got filter and bypass capacitors around the voltage regulators, see their data sheet for info.
Can you post a CAD or picture of a hand-drawn circuit diagram in jpg,pdf or png for us please.
Even though you are supplying the voltregs off a battery, the perfomance of the regulators relys on noise and load transient filtering.

Hope this helps.

Tom.... :slight_smile:

TomGeorge:
Hi, have you got filter and bypass capacitors around the voltage regulators, see their data sheet for info.
Can you post a CAD or picture of a hand-drawn circuit diagram in jpg,pdf or png for us please.
Even though you are supplying the voltregs off a battery, the perfomance of the regulators relys on noise and load transient filtering.

? have used voltage regulators with capacitors 330nF at the input side and 100nF ath the outside. Sorry that I have no visual material to upload now. My question is that If this Ultrasonic sensor works properly when Arduino is powered by USB why it misfunctions when it is powered by battery? Each part works well but not Ultrasonic sensor.

The oscillation is probably to do with the greater current available to the
motors now - the control loop gain should be reduced until it just avoids overshoot.

I'm not keen on powering the motors through a voltage regulator - you just waste
battery power and risk overheating the regulator. Motors aren't fussy about raw
supply rails full of noise and fluctuations.

MarkT:
The oscillation is probably to do with the greater current available to the
motors now - the control loop gain should be reduced until it just avoids overshoot.

I'm not keen on powering the motors through a voltage regulator - you just waste
battery power and risk overheating the regulator. Motors aren't fussy about raw
supply rails full of noise and fluctuations.

You are correct. We have already tried supplying motors without a regulator today but Ultrasonics sensor issue is still continuing.
What can you suggest?

Hi, have you measured the supply voltage at the sensor, and have you tried any bypassing there, ie 10uF, 330uF at it PCB.
330nF is good on the 78 series reg but they also like 10uF on their output.
Are all you gnds good?

Tom.... :slight_smile:

TomGeorge:
Hi, have you measured the supply voltage at the sensor, and have you tried any bypassing there, ie 10uF, 330uF at it PCB.
330nF is good on the 78 series reg but they also like 10uF on their output.
Are all you gnds good?

Tom.... :slight_smile:

I do not think that that is because of regulator capacitors since I have also build 5V regulator and supplied all sensors connected to Arduino 5V pin. I think thae problem is totally because of HC-SR04 Ultrasonic sensor because we have used one and suddenly it did not work and replaced it.

If anyone has an experience with HC-SR04, I need help with the delay term. I think that delayMicroseconds(1000); is the problem because pulse delay is either short or long. We have just find this code and used it because it was working well. I will try changing delay and code a bit to see the result. Can this be the problem?