Electrical – Arduino project. USB+external power source – works fine. No USB – everything goes crazy

arduinogroundloopspower supplyservousb

I have this circuit:

enter image description here
It is a simple project – a focus system for a taken lens and anamorphic adaptor. I have three pots. The first one I use as a manipulator. The second is used to get the position of the continuous rotation servo (JX DC6015 Mod) – motor#1. The third pot is used to control the position of the other continuous rotation servo (JX DC6015 Mod) – motor#2. There are also some buttons and diodes for calibration purposes. Motor#1 rotates the taken lens and motor#2 rotates the adaptor.

Well, let's look at the circuit. I also have there a 1N4007 diode and a 47uF cap. I use this scheme because the circuit even didn't turned on when I tried to power it from a battery. Now at least it turns on. But let's leave it aside for a moment.

The main problem is that everything works perfect when I use an external AC-DC adaptor (or battery) with Nano's USB connected to my laptop. As soon as I unplug the USB cable the system goes crazy. In case it is connected to the AC-DC adaptor it just starts rotating servos several turns CW and then backwards. In case it is powered just with a battery the servos just rotates CCW or CW very fast and never stop.

It looks for me like I have a GND loop problem. I tried to decouple my pots by adding 3 caps for each pot connecting a signal pin with GND, but things went even worse. It didn't work even with USB connected to Arduino. Servos rotated CW and CCW changing the direction very fast.

I tried two other Arduino controllers, but it was all the same.

I've tested all the GNDs. They are all connected together.

Then I decided to try to isolate VCC and GND from servo putting NME0505SC between power source and Arduino. But it didn't help as well.

What could be done to make it work just from one power source?

Best Answer

In addition to my comment regarding the requirement that the voltage on the Arduino Nano's \$V_{IN}\$ power pin must at all times be 7 – 12 VDC, here are some additional troubleshooting suggestions.

  1. When troubleshooting a power supply problems, do not use a voltmeter. ALWAYS use a digital storage oscilloscope (DSO) (preferred), or an analog storage oscilloscope with sufficient storage persistence (if you don't have a DSO), to observe the power supply's voltage versus time behavior over a sensible time period—e.g, 200 – 500 milliseconds.

  2. Using a DSO, observe the unregulated voltage at the Nano's \$V_{IN}\$ power input pin. Ensure \$V_{IN}\$ never drops below the regulator's minimum input voltage, which for the Arduino Nano would be 7 VDC (see the data sheet for the Arduino Nano). Ensure this unregulated voltage does not exhibit unacceptable problems such as: large voltage spikes; large ripple; the voltage occasionally exits the 7 – 12 VDC window, etc.

  3. Using a DSO, observe the voltage at the Nano's 5 VDC and 3.3 VDC power output pins WHILE YOUR SOFTWARE IS RUNNING. Ensure the voltage at the 5 VDC output power pin is between 4.95 – 5.05 VDC (see the LM1117 data sheet), and the voltage at the 3.3 VDC power output pin is between 3.267 – 3.333 VDC (see the LM1117 data sheet). Check for the presence of large voltage spikes, voltage droops, excessive ripple, etc.—i.e., anything that is abnormal on a DC power supply rail that could cause the Arduino or the surrounding circuitry to "hickup": spontaneous resets, analog-to-digital conversion failures, etc.

One last comment. The Arduino Store webpage for the Arduino Nano gives conflicting values for the required voltage range for VIN. The "Tech Specs" section states VIN's required range is 7 – 12 VDC, which seems sensible (correct) to me. But the "Documentation > Power" section claims VIN's required range is 6 – 12 VDC. That 6 VDC spec is BELOW the LM1117IMPX-5.0's spec'd dropout of 6.2 VDC (see the LM1117 data sheet), which is risky business for a production product. If VIN droops below 6.2 VDC even a little bit, you get "unspecified behavior" from the Nano's LM1117IMPX-5.0 voltage regulator.

Related Topic