Conrol the voltage of a buck converter ....

Does anyone have any clever methods to modify one of these to be able to control the output voltage from the arduino?

Not that it matters anymore but pin 4 of the LM2596 is the feedback pin. The output is a function of the current fed back through the trim pot resistance. The voltage on the feedback pin is pretty consistent at about 1.232 Vdc so it must be the current feeding back that is changing when you adjust it. I'm going to try replacing the trim pot with a 2n2222 transistor with the collector connected to the output and the emitter connected to the wiper pad and control the transistor using a DAC through a resistor. I'll let you know how that works out.

C'mon, just supply an offset current through an external DAC to the circuit. Even with no feedback to the Arduino, setting a specific DAC output will cause a repeatable voltage change. The SMPS IC still handles all feedback and regulation.

Thanks. I'll try that.

I tried injecting an offset voltage using a variable power supply and worked somewhat but it was not consistent or predictable.

Where and how did you inject it? Schematic?

Directly to pin 4 of the LM2596 . I didn't have any success when using the input ground for the injection voltage but when I switched the injection ground to the output then I could change the output from 9V to 4 or 4 or 6 volts with a reasonable amount of stability . The injection voltage was a bench variable voltage adjustable current lab supply set to about 2 or 3V. I could control the voltage but there seemed to be a min and max where if I crossed that threshold the output would go to minimum 1.23V or maximum (the setting of the lab supply for the LM2596 INPUT voltage (I had it set for about 20V in). I got tired of the unpredicability so I gave up. I left the pot in and just turned it all the way CCW so it was basically not affecting my testing. If I did nothing the output was minimum. I couldn't get the voltage to go up with the injected voltage but I could get it to go down. I tried a negative injected voltage and that caused the output to go to min or max.

Well, -that- won't work. You can't just stuff a low impedance voltage in there.

Think of it like a summing amplifier.

Here is a simple schematic of the LM2596:

Think of R2 as the Feedback resistor in an Op Amp. The virtual ground is 1.2V, imagine it as a 1.2V line connected to the noninverting input internally. R1 is the resistor that sums in Ground. Pin 4 of the LM2596-1.2 is like the inverting input of an Op Amp.

So you add a third resistor to pin 4 that we'll call R3. Now.... if you put in a positive voltage, the output will go -down-. So you should select R1 and R2 so that, when the input bias voltage is 0V, the output is at the maximum.

Then when you increase the voltage connected through R3, the output voltage will go down.

That is what I mean.

I'm designing an Arduino controlled power supply and an Arduino controlled multiple Pb cell charger using this method, but using an external DAC to drive the regulators.

Thanks ! I've built summing amps before so I'm familiar with that concept. I didn't think to use a resistor. Can you recommend a value ?

What range of voltage do you need?

What values of resistance are in the circuit now?

To be totally honest I don't even have an application for the LM2596. I only bought it because it was $1 on ebay and I couldn't resist. I have extensive op amp experience so I thought it would be nice to have something to regulate the Vcc for a single ended op amp circuit if I needed it. It was only when I saw this post that I got curious about how to computerize it. All of my arduino projects (and there have been many) are nothing more than home training in uC because I have been an Electronics Engineering Tech off and on for 30 yrs. (the off times were production or semiconductor wafer fab equipment tech) but have never been asked to design a uC based test fixture. Two years ago when I started my current job I had to design a Gate Driver PCB test fixture . About 6 months after completing that I discovered arduino in Oct of 2013 and decided to start uC home study (because I actually didn't even know C programming at that time) .

Hah! I've done that.... I have a wide variety of PIC dev boards including a 32 bit board, a bunch of Arduinos, a Raspberry Pi, some kind of Ti SoC, and a few others that I got because I had money left over in a scholarship that I could not access any other way, or simply because they were cheap.

I have a small power supply board with an LM2596 I bought because there is no way I could even buy the parts for what it cost on eBay from China.

My main focus (initially) was learning how to use the DS18B20 (multiple sensors on the same ONEWIRE bus) to measure temperature because where I work we do a lot of High Power electronics with huge fan cooled heatsinks (one prototype was over 30kVA) . LCD temp readouts and analog voltage measurements
are also useful . Once I got to the point where I could do ATtiny85 circuits and standalone 328s then the
rest was frosting on the cake. They still haven’t asked me to do any uC projects at work but at least I’m ready now.

Hello,

I want to know how can I control LM2956 pin no 5 using arduino io pin.

If I just connect any of the io pin to LM2956 PIN NO. 5 and trying to switch off and on whenever necessary it is not happening.

As part the data sheet this pin can be logical controlled. Thought this is very straight forward and should work if control pun.

If I connect this pin to + of input then the voltage slowly reduces otherwise not.

I tried connecting the ground signals of both lm2596 bord controller board still didn't work.

Surely Some one might of tried this to interface with controller whenever necessary to turn off and on.

Please let me know how this can be achieved.

Regards, Krishna

@pkrishnam12,

Use a 2n2222 transistor :

Collector: => pin- 5 of LM2596 with a 10 k pullup to LM2596 Vcc voltage Emitter => LM2596 GND. base => 1k resistor Arduino digital output pin => other end of transistor base resistor.

As part the data sheet this pin can be logical controlled. Thought this is very straight forward and should work if control pun.

Yes it is if you have any experience with electronics (specifically logic circuitry) or bothered to read the datasheet.

SEE Pages 26, 27, & 28 It clearly show how to use a transistor to control pin 5. It is NOT a "TTL" compatible logic input(if you even know what that means) (google it), consequently connecting a TTL I/O pin to pin 5 is not going to work. (ask yourself why ?) , then measure the output voltage of the arduino I/O pin. The word "logic" says nothing about the type of hardware circuitry or voltage levels. There are numerous logic topologies/hardware, (TTL, CMOS , ECL, are just a few, all of which use different logic levels. The world of logic hardware is not black and white (or should I say , ON & OFF).

SEE Figures 39 (active LOW) & 40 (active HIGH) on page 30 for TTL -COMPATIBLE SHUTDOWN CIRCUITs.

Likewise, the maximum output LOW voltage (VOL) is 0.4 V.

Logic levels

Now go back and read the MINIMUM OFF voltage from the datasheet . See the problem ?

In a nutshell, the ON/OFF pin is a current sink controlled input requiring a VERY low resistance to ground to turn the device ON. The OFF state will result in the absence of such a low impedance connection to ground (such as a transistor) but it is standard procedure to guarantee OFF state with a pullup resistor which keeps the voltage above the Turn-On threshold when the transistor is OFF.

The LM2596 datasheet

Do your homework before posting.

Hi,

I posted this question in this forum thinking some one might have working solution before I start doing that transistor controlled pin no 5 of lm2956.

I was having different version of data sheet in that I couldn't find the section (page 26,27 & 28) that you had mentioned in the reply.

Some 8 years back I worked on hardware designing & after that totally in to firmware, driver application development. Did not get opportunity to work again. Suddenly there was an urgent requirement for which thought I can only fulfill it, bought LM2956 board & started testing on late night of Saturday. Since Sunday shops were closed couldn't get components thought of checking in Google to find any solution and landed here in this forum.

Thought this forum is also meant for discussion and raised question.

If you think I made mistake by posting this basic question I Apologize for that and I exit from this forum.

Anyhow my sincere thanks for your time and answer.

Thought this forum is also meant for discussion and raised question.

If you think I made mistake by posting this basic question I Apologize for that and I exit from this forum.

Nobody said you made a mistake posting on the forum. I said you should do some basic research before posting.

The datasheet I referenced is the datasheet linked in Reply#4 by dc42 of THIS post. (the same thread where you posted your question, which , if you read the post title, is NOT what you are asking. The term for posting a question not relevant to the OP’s thread is “hijacking” . (I doubt he will mind since he is long gone) Read the post title before posting. You are not trying to " Conrol the output voltage of a buck converter …". You are trying to gate the output of a converter, which warrants a new topic.(while that may seem like a form of “control”, it is not what the OP was asking about so hence is deemed irrelevant from a forum perspective. This policy is to keep the threads “PURE” and uncorrupted by discussion not pertinent to the post title.

Since Sunday shops were closed couldn’t get components thought of checking in Google to find any solution and landed here in this forum.

posted this question in this forum thinking some one might have working solution before I start doing that transistor controlled pin no 5 of lm2956.

(there is no need to ask anyone else on the forum if they have done it if it is shown in the datasheet complete with schematics)

All you had to do is read this post from the beginning. (or Google T.I.com and search by part number) The reason we expect would-be posters to research their topic first is that more than half of all would-be questions can be resolved with a Google search. Had you read this post you would have found that datasheet and had you read the datasheet you would have found the examples for exactly what you are asking for . Focus on the content of my suggestion. “Do your homework before posting” does not translate to “don’t post a question on the forum.” It translates to “Don’t post a question until you have researched the topic with Google.” It’s that simple. This may come as a surprise to you but probably 75% or more of ALL people who post on the forum have not even Googled their topic. You see what I mean ?

As I am fond of saying, there is a special Hell reserved for people who don’t read datasheets:

It is a place where nothing works and everything smokes as soon as you apply power…

I was having different version of data sheet in that I couldn’t find the section (page 26,27 & 28) that you had mentioned in the reply.

Texas Instruments is not a small company. It should not be hard to find their website.

Google search for TI.com

Click the first link at the top of the page and that gets you here.

Entering “LM2596” in the search bar yields the links for the converter chip.

Here is the T.I website page for the LM2596.

See the “Download datasheet” link on the right ?

This is what you get when you click on the
“Download Datasheet” link.

which is the same datasheet I linked, which I got from Reply#4 of this post.

Anyhow my sincere thanks for your time and answer.

FYI, it is customary to click someone’s karma button if they nail your question… It’s a way of saying “Thank You” that provides incentive for people to continue to help other people. While the truth is that the people who do most of the helping don’t do it for the karma points, it is nevertheless a nice gesture if they have answered your question. I just thought I should mention that in case you didn’t know

easy example how to control lm2596 module- http://www.fischl.de/dcdccontrol/

Great tutorial ! k =>+1