Wemos D1 Mini question

I am using a Wemos D1 Mini for an IoT demonstration.
I have

  1. A SG90 servo 5V, 360mA (max)
  2. A motion sensor 5V, 65mA
  3. A battery charging board and voltage regulator outputting 5V, 1A (max).

The microUSB port on the Wemos will be used for uploading code.

I could connect a microUSB male to the charging board and then manually swap between the charging USB and the code upload USB but that feels clunky.

I could directly supply 5V from the charging board to the Wemos (via 5V VCC rather than the USB) AND the servo AND the motion sensor separately, but I lack the electronics knowhow to think through the wiring.

Any comments? Thanks

1 Like

The best solution for this is to simply upload the code via OTA.

connect the 5v out of your charger to everything and forger about the USB, once you get your worflow going is very easy.

Also, are you aware you are connecting 3.3v logic to 5v logic, right ?

The servo should be happy but I don’t know about the motion sensor

Pretty sure the D1 mini has an onboard regulator. It has a USB input, and 5 volt and 3.3 volt outputs

Oh your taking about the things that interface to it. Yeah, you don’t want to drive the 3.3v inputs on the D1 with 5v outputs. The reverse can usually work though. The D1 outputs can likely drive units on the peripheral boards.

Wemos’s D1 is 5v tollernat but 3.3 sometimes is not enought for a 5v device

If you’re not familiar with OTA, here’s a tutorial: https://randomnerdtutorials.com/esp8266-ota-updates-with-arduino-ide-over-the-air/ (assuming you’re using the Arduino IDE, there will be something similar with PlatformIO/VSCode)

Thanks for the input.
I realised that I haven’t explained myself very well (hopefully the diagram helps).
Thanks for the reminder about OTA updates.
For other reasons, I still want to keep the USB port available for upload.

If you do that you will need a diode blocking 5v getting back into the charger.