0

Fair warning: I'm an electronics n00b.

I'm trying to get an Arduino Uno R3 to send data over 9600 baud serial to a Wemos D1 Mini Pro.

What worked (mostly):

Powering (5V) Arduino off a 4 AA barrel jack battery pack. Measured voltage between Vin and GND as ~4.5V (the batteries were somewhat old). 4.5V is low enough to be safe as 5V input for the (3.3V) Wemos, which can be powered off its 5V pin (it's the input to the board's 3.3V regulator). I tied the Arduino's GND and Wemos's, took the Arduino's Vin pin to Wemos's 5V pin (providing it ~4.5V), and connected Arduino's TX to Wemos's RX via a voltage divider (a 2.2 kΩ resistor and a 4.7 kΩ; verified <3.3V with a multimeter).

And, everything worked, for a few brief, glorious minutes. Arduino sent 1 byte over serial every 3 seconds, alternating the builtin LED each time. Wemos read them and served up a web page showing the latest values. But, after a few minutes, the Wemos started to read data the Arduino shouldn't be sending (0x00 bytes; the Arduino program was only sending uppercase ascii letters). I noticed that the Arduino builtin LED, that's supposed to be alternating every 3s, was blinking rapidly. I think I drained the batteries too far to provide both the Wemos and the Arduino with enough power, and the Arduino got stuck in a boot cycle (and I suppose it's sending 0x00 over its TX pin while booting).

What didn't work:

Since changing batteries frequently would be a pain, I tried plugging the Wemos into a micro USB wall adaptor, and the Arduino into a 12V 1A barrel jack wall wart, and unplugging Arduino's Vin from Wemos's 5V (leaving GND tied together). Plugged both adaptors into a single power strip, and turned it on. Both boards powered up, and were running their programs (I could connect to the Wemos over WiFi and it would serve me a page; the Arduino builtin LED was alternating every 3 seconds as expected). A multimeter read the voltage between Wemos RX and GND as 3.34V, but the Wemos wasn't receiving any serial data.

After that experiment, I switched back to the battery pack, wired Arduino Vin to Wemos 5V again, swapped out 2 of the 4 batteries, and everything works.

TLDR:

I powered a 5V Arduino off 12V and a 3.3V Wemos off 5V, and the Wemos couldn't read serial data being transmitted by the Arduino. When I powered them both off a 4.8V battery pack, everything worked. Why didn't it work when they had separate supplies and a common ground?

Sorry for the wordy question; I'm confused enough to not know which details are relevant!

  • wasn't the 5 V usb adapter some smart type charger with usb communication to negotiate the charging current? – Juraj Feb 21 '18 at 7:35
  • 1
    power the wemos Vin (5 V) from 5 V of arduino with arduino connected to 12 V adapter – Juraj Feb 21 '18 at 7:36
  • Not sure about the smartness of the USB charger... I've gotten the impression that the Arduino's 5V regulator might not be able to source enough current to power a Wemos. I found a reference earlier today to ESP8266's drawing up to 850 mA under heavy WiFi load, and electronics.stackexchange.com/questions/67092 says that the Arduino 5V can source less than 900 mA if Vin is above 7V. Anyway, I'm not really looking for workarounds (I plan on trying a USB power bank next) - I'm more interested in learning why it didn't work. – godlygeek Feb 21 '18 at 7:53
  • 1) I do not believe that 850 mA. The 5 V pin is not a workaround, it is it's purpose. 2) You could try for wemos a simple AC/DC (USB) adapter without data lines connected. The data lines go over USB chip to Rx/Tx pins. 3) Charging power banks turn off if only small current is drawn. – Juraj Feb 21 '18 at 8:06
  • Your question is interesting and useful to others, but it's tooo looong. Delete most of it, keep the TLDR (which is all we need to know) and add schematics to show the alternatives. A short question is better than a long one. – user31481 Feb 21 '18 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.