External power supply for MKRWIFI1010

Hey,

I have a question about how to properly wire up the MKRWIFI1010 when also using an external power supply. I need the external power supply because I connect two strong (but 5V) servos to the arduino.

The MKRWIFI1010 is put in a "ARDUINO MKR CONNECTOR CARRIER" [1], and a single IR sensor is plugged into the D0 pin [2].

The external power supply is 5V, which I feed directly into GND & VCC for the servos. Servo signals are connected to pin 1 & 2 of the MKRWIFI1010.

GND of the external power supply is connected to the GND pin of the MKRWIFI1010, always.
When doing testing via USB that's it, and it all works fine. In particular wifi works.

When I disconnect USB to let it work by itself, I connect the 5V to the VIN of the MKRWIFI1010 (not the carrier board, didn't think that would matter). I do not connect the external 5V to VIN while connected to USB because otherwise the wifi doesn't work, but I honestly can't say I understand that. That is my first question, is this expected?

The second thing is that when I disconnect from USB and put the 5V on VIN, it seems to hang during setup, waiting for the wifi to come up (I loop until connected). Since that seems similar to the other issue above, I'm guessing I'm just plainly doing the external power supply wrong, somehow.

I was trying to find an easy answer but failed so far, sorry :frowning: I'm sure I'm searching using the wrong terms or something. Basically, could somebody tell me how to properly wire up that external power, optimally including so it works with or without usb connected? Or am I messing up something else?

Thank you!

[1] Arduino MKR Connector Carrier | Arduino Official Store
[2] Grove - Infrared Reflective Sensor v1.2

Okay I think I figured out the core of my problem, it seems my external power supply is underpowered given the servos, and so it looks like the mkr keeps getting reset. So that answers that problem.

But I'd still like to understand my other question here:
Assuming the 5V power supply is strong enough, is there any issue to connect it to the VIN even while USB is connected? I assume not? It just so happened to give it isolation of the voltage drop before?

when both Vin and USB are connected the ardiuno uses the USB and Vin is ignored that is why the voltage drop is not a problem during that time.

Even if the 5v supply is "strong enough" inductive loads such as motors(servo) can produce a voltage spike when the motor is powered down that can cause the arduino to reset. this is usually prevented with the use of a "flyback diode" .

According to the documentation it is actually the other way around, from [1]:
"""

  • Vin: This pin can be used to power the board with a regulated 5V source. If the power is fed through this pin, the USB power source is disconnected. This is the only way you can supply 5v (range is 5V to maximum 6V) to the board not using USB. This pin is an INPUT.
    """

Either way, it seems to be working now :-/ Thanks!

[1] FAQ from Arduino MKR WiFi 1010 | Arduino Official Store