# Arduino - Calculating Resistance

I am trying to connect an ESP8266 Wifi Module on a Pro Mini Atmega328 5V 16M Full Specs Here - Specs

The Atmega328 pro mini outputs 5v on the vcc pin while the ESP8266 can handle max 3.3v. How much resistance do i need to make the voltage drop so that i don't damage the module?

Tried Calculating with Ohms law R=V/I R=5-3.3/250mA=6.8 ohm

When i use that resistor the voltage doesn't even come within the 3.3v spectrum What am i doing wrong?

• Never try to adjust a supply voltage with series resistor. Think what will happen when the current draw is changing. It is a very wrong approach. – Eugene Sh. Apr 12 '16 at 18:44
• What should i do instead? – user3812335 Apr 12 '16 at 19:02
• Use a regulator. Or a zenner diode. Or even a couple of regular diodes in series (contrary to resistors, the voltage drop on diodes will be approximately the same for any (high enough) current. – Eugene Sh. Apr 12 '16 at 19:09

Think of it this way, the ESP8266 can be modeled as a resistor, but it does not have a fixed value. Does the power draw from the ESP8266 stay constant, NO! You can think of it as a variable resistor. The supply rail for the ESP8266 needs to stay constant, if it isn't constant, then bad things can happen like latchups or bad calculations. If you look at the figure below, the resistance will be about 3.3V if you have a 3Ω resistance but if the resistance of R2 goes to 6Ω then the voltage between the resistors will no longer be +3.3V. The regulating resistor needs to change with the resistance of the loading resistor.

So what can you do? The loading resistor needs to vary with the current of the microprocessor to keep it at a constant 3.3V. There are these things called transistors that can function as a variable resistor (when people invented transistors, they got really excited). We give the transistor a reference voltage to track and an op amp (there are lots of transistors in an op amp) in negative feedback to keep the transistor at the right resistance to keep 3.3V across the loading resistor.

There is something even better, people invented IC's that have all this in the same package, its called a voltage regulator. They even make fancier versions of a voltage regulator that make the "control" resistor switch on and off millions of times a second to give the right voltage, these are called step down DC to DC converters.

simulate this circuit – Schematic created using CircuitLab

You don't want a resistor, you want a voltage regulator. Those take a input voltage over some range, then make a steady but lower output voltage.

There are many models to choose from that can make a fixed 3.3 V from 5 V in. You need one that can work with 1.7 V headroom and handle whatever the maximum current of your device is.

You also need to make sure the regulator can handle the power dissipation. The 1.7 V it will drop times the output current is the power that the regulator will dissipate as heat. For example, if your device draws 200 mA at 3.3 V, then the regulator will dissipate (1.7 V)(200 mA) = 340 mW. That would be too much for something in a SOT-23 package, but no problem at all for a TO-220 package, for example.

• So Olin let's say that i use this Voltage Regulator LD1117 - 3.3V 800mA.I should have no problem right? – user3812335 Apr 13 '16 at 10:04