Electrical – How to convert 5V to 3.3V for all pins of wemos D1 mini when interfacing it with Atmega16

atmegaavrwifi

I am trying to interface Wemos D1 Mini to Atmega16 and have communication between them using TX and RX pins.According to the datasheet, the maximum allowed current for the Wemos mini is 3.3V for all IO pins while the Atmega 16 is giving 5V at it's IO terminals.For this problem, I could come up with just one solution and that is to use a voltage regulator. But this solution will require three voltage regulators, 1 for powering Wemos D1 mini and 2 for TX and RX lines. This solution seems to complicate the design. So is there an elegant solution for converting 5V to 3.3V?
I am completely novice to the field of electronics and this is my very first project so there might be a mistake in my understanding of basic concepts.So if that's the problem then please let me know.
Thank you.

Best Answer

  1. You need voltage regulator to power this Wemos with 3.3V. That's for sure.
  2. Next check in the documentation - maybe your Wemos is powered from 3.3V but is capable of tolerating 5V inputs? (so called "5V tolerant inputs")? If so then you don't need to do anything.
  3. If not, then For Rx you don't need any conversion of voltages. Because even if Wemos outputs 3.3V for High and 0V for Low signal it will be still properly received by the Atmega.
  4. And for Tx you need to convert voltage. You can use dedicated level shifters (or sometimes called level converters). Alternatively you can use just 2 resistors to make a voltage divider and for this purpose it should be ok.
  5. Instead you can also power Atmega from 3.3V - but see Atmega datasheet to see what is the biggest crystal you can then connect. Because if your Atmega is running from 16MHz crystal, then 3.3V is probably too low for this speed.
Related Topic