Introduction: How to Use DC to DC Buck Converter LM2596
This tutorial will show how to use LM2596 Buck Converter to power up devices requiring different voltages. We will show which are the best types of batteries to use with the converter and how to get more than just one output from the converter (indirectly).
We will explain why we have chosen this converter and for what kind of projects can we use it.
Just a small note before we get started: When working with robotics and electronics please don't overlook the importance of power distribution.
This is our first tutorial in our series on Power Distribution, we believe that Power Distribution is often overlooked and that this is a big reason why many people lose interest in robotics in the beginning, for instance they burn up their components and are unwilling to buy new components from the fear to just burn them up again, we hope that this series on Power Distribution will help you understand how to better work with electricity.
- LM2596 DC to DC Converter
- 9V Alkaline Battery
- Arduino Uno
- Jumper Wires
- 2S Li-Po or Li-Ion Battery
- 2A or 3A Fuse
- Servo Motor SG90
- Small Breadboard
Step 1: Pinout Overview
Here You can see how the LM2596 DC to DC Converter Module looks like. You can notice that the LM2596 is an IC, and the module is a circuit build around the IC to make it work as an adjustable converter.
Pinout for LM2596 module is very simple:
IN+ Here we connect the red wire from the battery (or the power source), this is VCC or VIN (4.5V - 40V)
IN- Here we connect the black wire from the battery (or the power source), this is ground, GND or V--
OUT+ Here we connect the positive voltage of the power distribution circuit or a component powered
OUT- Here we connect the ground of the power distribution circuit or a component powered
Step 2: Adjusting Output
This is a buck converter meaning that it will take higher voltage and convert it into lower voltage. To adjust the voltage we have to do couple of steps.
- Connect the converter with the battery or other power source. Know how much voltage you have inputted in the converter.
- Set the multimeter to read the voltage and connect the output of the converter to it. Now you can already see the voltage on the output.
- Adjust the trimmer (here 20k Ohm) with a tiny screwdriver until the voltage is set to the desired output. Feel free to turn the trimmer in both directions to get the feeling how to work with it. Sometimes when you use the converter for the first time you will have to rotate the trimmer screw 5-10 full circles to get it working. Play with it until you get the feeling.
- Now that the voltage is appropriately adjusted, instead of the multimeter connect the device/module you want to power.
In the next couple of steps we would like to show you couple of examples on how to produce certain voltages and when to use these voltages. This steps shown here are from now on implied on all of the examples.
Step 3: Current Rating
Current rating of the IC LM2596 is 3 Amps (steady current), but if you actually pull through it 2 or more Amps for a long period of time it will heat up and burn out. As with most of the devices here we also have to provide sufficient cooling for it to work long and reliably.
Here we would like to draw an analogy with the PC's and CPU's, as most of you already know, your PC's heat up and crash, to improve their performance we need to improve their cooling, we can replace the cooling with a better passive or air cooler or introduce even better with liquid cooling, it's the same thing with every electronic component like IC's. So to improve it we will glue a small cooler (heat exchanger) on top of it and this will passively distribute the heat from the IC to the surrounding air.
The image above shows two versions of the LM2596 module.
First version is without the cooler and we will use it if the steady current is below 1.5 Amps.
Second version is with the cooler and we will use it if the steady current is above 1.5 Amps.
Step 4: High Current Protection
Another thing to mention when working with power modules like converters is that they will burn out if the current goes too high. I believe that you have already understood that from the step above, but how to protect the IC from the high current?
Here we would like to introduce another component the Fuse. In this specific case our converter needs protection from 2 or 3 Amps. So we will take, let's say a 2 Amp fuse and wire it according to the images above. This will provide the necessary protection for our IC.
Inside the Fuse there is a thin wire made of a material which melts on low temperatures, the thickness of the wire is carefully adjusted during the manufacturing so that thae wire will break (or unsolder) if the current goes above 2 Amps. This will stop the current flow and the high current won't be able to come to the convertor. Of course this means that we will have to replace the Fuse (because it's melted now) and correct the circuit which tried to draw too much current.
If you want to know more about the fuses please refer to our tutorial on them when we release it.
Step 5: Powering 6V Motor and 5V Controller From a Single Source
Here is an example that includes everything mentioned above. We will summarize everything with the wiring steps:
- Connect the 2S Li-Po (7.4V) battery with the 2A fuse. This will protect our main circuit from high current.
- Adjust the voltage to 6V with the multimeter connected on the output.
- Connect the ground and the VCC from the battery with the converter's input terminals.
- Connect the positive output with the VIN on the Arduino and with the red wire on the micro servo SG90.
- Connect the negative output with the GND on the Arduino and the brown wire on the micro servo SG90.
Here we have adjusted the voltage to 6V and powered up the Arduino Uno and the SG90. The reason why would we do that instead of using the 5V output of the Arduino Uno to charge the SG90 is the steady output given by the converter, as well as the limited output current coming from the Arduino, and also we always want to separate the motor power from the power of the circuit. Here the last thing is not actually achieved because it is unnecessary for this motor, but the converter provides us with the possibility to do that.
To understand more on why is it better to power the components this way and to separate the motors from the controllers please refer to our tutorial on batteries when it's released.
Step 6: Powering 5V and 3.3V Devices From a Single Source
This example shows how to use the LM2596 to power two devices with two different types of voltages. The wiring can be clearly seen from the images. What we have done here is explained in the steps below.
- Connect the 9V Alkaline Battery (can be bought in any local store) to the input of the converter.
- Adjust the voltage to 5V and connect the output to the breadboard.
- Connect the Arduino's 5V to the positive terminal on the breadboard, and connect the grounds of the Arduino and the Breadboard.
- The second device powered here is a wireless transmitter/receiver nrf24, it requires 3.3V, normally you could power it directly from the Arduino but the current coming from the Arduino is usually too weak to transmit stable radio signal, so we will use our converter to power it.
- To do that we need to use a Voltage Divider to reduce the voltage from 5V to 3.3V. This is done by connecting the +5V of the converter to the 2k Ohm resistor, and 1k Ohm resistor to the ground. The terminal voltage where they touch is now reduced to 3.3V which we use to charge the nrf24.
If you want to know more about the resistors and the voltage dividers please refer to our tutorial about that when it's released.
Step 7: Conclusion
We would like to summarize on what we have shown here.
- Use LM2596 to convert voltage from high (4.5 - 40) to low
- Always use a Multimeter to check the voltage level on the output before connecting other devices/modules
- Use LM2596 without a heat sink (cooler) for 1.5 Amps or lower, and with a heat sink for up to 3 Amps
- Use a 2 Amp or 3 Amp Fuse to protect LM2596 if you are powering motors drawing unpredictable currents
- Using converters you are providing stable voltage to your circuits with sufficient current which you can use to reliably control motors, in this way you will not have reduced behavior with the batteries voltage drop over time