0

I'm using the following simple code snippet to write to the D3-pin of my Arduino Nano RP2040 connect.

for(int i = 0; i <= 0xff; i++) {
  analogWrite(3,i);
  delay(10);
}

USB is connected and I have a voltmeter connected between the D3- and the 3V3-pin.
Result: The voltage increments over time, is then reset and starts incrementing again.
Everything as expected so far.
So I disconnect USB and connect the Arduino VIN-pin and the two GND-pins to a 9V power supply.
The builtin LED on the board turns on, but when I connect the voltmeter to D3 and 3V3 again, I get a constant voltage of 3.3 volts.
Why?

5
  • do you have while (!Serial); in setup()?
    – Juraj
    Jul 1 at 10:39
  • It is odd you are measuring voltage with respect to 3v3. Voltage is almost always measured with respect to ground. A 9 volt battery is convenient Arduino power source. But even a slightly used 9 volt battery may cause unexpected results. Consider swapping out the 9 volt battery for a power supply that can deliver at least as much current as the minimum USB allowed current of 500mA.
    – st2000
    Jul 1 at 12:11
  • My setup()-function is empty, loop() contains only the code above. I'm pretty new to arduino. I didn't know that usually voltage is measured against ground. When I measure against ground I get a constant 0V. My power supply is actually a variable ratio transformer that can go up to 12V. For the time being, I've set it to 9V, but I also tried different voltages with the same result. Jul 1 at 13:02
  • You might want to add "RP2040" to your title. There's a huge difference between an Arduino Nano and an Arduino Nano RP2040.
    – st2000
    Jul 1 at 14:20
  • @st2000: I edited the title. Jul 1 at 14:38

2 Answers 2

0

Examining the Arduino Nano RP2040 schematic here, we can see that VUSB and VIN are only separated by D2. Further, if VUSB works as expected then it follows that VIN will likely work as well.

Assuming this, a reasonable explanation of why VUSB works as expected and VIN does not may be made by claiming the VIN power source is not capable of supplying the necessary current.

What is the necessary current is unknown. Examining the Arduino Nano RP2040 data sheet here we see in section 2.2 that the power consumption of the Arduino Nano RP2040 board as TBC (To Be Confirmed).

Consider using a power source capable of providing several Amps of current. The minimum current a USB port must be able to provide is 0.5 Amps. But many USB sources can provide more. If it is necessary to know the exact current drawn when the Arduino Nano RP2040 is operating as expected, consider obtaining commonly available USB current meters.

4
  • Thanks for your advice, but my transformer provides 1.1A max (more than twice compared to USB). Jul 1 at 14:41
  • The unexpected behavior could be from something we have not even discussed. However, I have see both USB power supplies that can supply many more times the minimum 2.0 USB required current. And I have seen bad power supplies that fall short of what is claimed on the label. There's a WIFI radio on that board. Likely with it's own processor. Is it running? How much current will it draw? If it is not easy to switch power supplies, consider switching to an ordinary Arduino Nano.
    – st2000
    Jul 1 at 14:53
  • I have no USB current meter, but I have a USB power adapter that you plug directly into a wall socket. This one is rated with 550mA max and does indeed work. Therefore I know exactly that my transformer is stronger. Jul 1 at 14:54
  • The only other idea I have, make sure your power supply wires are not unusually long or thin. Also, check the variable power supply. I don't put a lot of trust in these types of supplies (wall transformers with a switch to set the voltage). Make sure the setting switch is working and the expected voltage appears at its output.
    – st2000
    Jul 1 at 14:58
0

I found it out!
I don't have an oscilloscope, but I had the idea that my transformer maybe puts out a "wavy" DC current.
I put an electrolytic capacitor parallel to the outputs of the transformer and now it works.
So it seems that Arduinos are pretty sensitive to DC currents that still have remaining AC portions.

Not the answer you're looking for? Browse other questions tagged or ask your own question.