DIY Buck/Boost Converter (Flyback)

45,542

321

62

Published

Introduction: DIY Buck/Boost Converter (Flyback)

About: Awesome Electronics Tutorials, Projects and How To´s

In this project I will show you how a buck/boost converter (flyback) works and how you can easily build one that can step up and step down DC voltage efficiently. Let's get started!

Step 1: Watch the Video!

After watching the video you should have the basic knowledge to create your own buck/boost converter. The next steps though will contain additional information to make your life easier.

Step 2: Order the Components!

Here you can find a parts list with example seller:

Amazon.com:
1x ATtiny85: http://amzn.to/2e1mPzU

1x MCP602: http://amzn.to/2e1mPzU

1x 7805 5V regulator: http://amzn.to/2e1mPzU

1x IRLZ44N: http://amzn.to/2e1mPzU

1x 100kΩ Potentiometer: http://amzn.to/2e1mPzU

1x 0.03mH Inductor: http://amzn.to/2e1mPzU

1x 1N5819 Schottky Diode: http://amzn.to/2e1mPzU

2x Screw Terminals: http://amzn.to/2e1mPzU

2x 100nF Capacitor: http://amzn.to/2e1mPzU

1x 100µF, 1x 220µF Capacitor: http://amzn.to/2e1mPzU

2x 10kΩ, 2x 5.1kΩ, 2x 20kΩ, 1x10Ω Resistor: http://amzn.to/2e1mPzU

Ebay:

1x ATtiny85: http://rover.ebay.com/rover/1/711-53200-19255-0/1..
1x MCP602: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

1x 7805 5V regulator: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

1x IRLZ44N: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

1x 100kΩ Potentiometer: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

1x 0.03mH Inductor: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

1x 1N5819 Schottky Diode: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

2x Screw Terminals: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

2x 100nF Capacitor: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

1x 100µF, 1x 220µF Capacitor: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

2x 10kΩ, 2x 5.1kΩ, 2x 20kΩ, 1x10Ω Resistor: http://rover.ebay.com/rover/1/711-53200-19255-0/1...

Amazon.de:

1x ATtiny85: http://amzn.to/2dWIc4j

1x MCP602:http://amzn.to/2dLaboV
1x 7805 5V regulator: http://amzn.to/2dWHC6K

1x IRLZ44N: http://amzn.to/2dL9WKB

1x 100kΩ Potentiometer: http://amzn.to/2dLaikl

1x 0.03mH Inductor: http://amzn.to/2dWIojS

1x 1N5819 Schottky Diode: http://amzn.to/2dLapwo

2x Screw Terminals: http://amzn.to/2aTTLNW

2x 100nF Capacitor: http://amzn.to/2dWJaNW

1x 100µF, 1x 220µF Capacitor: http://amzn.to/2dL9dsO

2x 10kΩ, 2x 5.1kΩ, 2x 20kΩ, 1x10Ω Resistor: http://amzn.to/2aAsWdV

Step 3: Create the Circuit!

Here you can find the schematic and pictures of the circuit that I created. Feel free to use them as a reference. You can also find the schematic on EasyEDA: https://easyeda.com/GreatScott/ATtiny_Buck_Boost_C...

Step 4: Upload the Code!

Here you can find the code that you need to upload to the ATtiny85 before plugging it in the circuit. If you don't know how to upload the sketch then make sure to watch this video of mine:

Step 5: Success!

Awesome! You did it! You just created your own buck/boost converter!


Feel free to check out my YouTube channel for more awesome projects:

http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information:

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

Share

Recommendations

  • Water Contest

    Water Contest
  • Clocks Contest

    Clocks Contest
  • Oil Contest

    Oil Contest

62 Discussions

whats is the logic of using "cont int" instead of "int " ???
i never under stand when to use which.............

1 more answer

"int variable_name" is declaring a variable, which could potentially be altered in the course of the program's execution (accidentally). Pin-numbers should not be considered variable. The hardware is allways connected to the same pin. They are to be considered constants. Hence the "const". "const int" means the name after it is a constant of type integer. Constants are not allowed to be altered during the course of the program. You'll get compilation errors if you try. So this is proper programming ettiquete.

0
user
khavoc

Question 2 months ago

Why do you have the signal going to the IRLZ44N on a voltage divider. Are you using the Mosfet itself to limit the current?

Edit: I just noticed it was 10 ohms and not 10k as the base resistor. I thought it was 2 10k ohm resistors making it a 1/2 voltage divider.

1 more answer

R3 is a pull-down resistor, keeping the mosfet off in case the attiny pin is left at a floating voltage (input-state) like during a reset or off. When the attiny is unpowered you don't want to accidentally switch the mosfet.

R4 is a resistor to limit the in-/out-rush current. The gate acts like a capacitor. Too much current through the pin can blow it's internal circuitry.

0
user
LexenZ

6 months ago

May I know what is the duty cycle of this circuit?

0
user
AbduA7

6 months ago

hello guys , can someone explain to me where i must connect the voltage regulater part

Is it possible that 2 new ATTINY85 from Reichelt are bricked out of the box?

hello,can i use this project for solar charge controller?

thank you

1 reply

hey dude ,, did you build it using a solar charger ?

0
user
AbduA7

6 months ago

hey , i built the same exact circuit as in the sketch with the same components and i uploaded the code to the attiney85 ,,, but it didnt work

i received an output voltage of 5volts at my 20kohms load and the potentiometer was not changing the outpout voltage ,, am thinking that the problem is with the defined pwm inputs and the pot input in the code ,

any suggestions to help make it work?

0
user
LexenZ

6 months ago

The code has seem to be changed, I am unable to replicate the same results as with the previous code... may I have the older code uploaded?

Is there a way to add current control to this also? I am Novice Newb please help

How about a list of specs such as input/output voltage range, output current, etc?

6 replies

I can't seem to produce a 1-2A based on this specs, I am only able to get 0.3A at most to charge a smartphone, any solutions on this?

hey scott, does this circuit can works with input 2-7v,and constant output voltage as 5.5v? i want some advice from you.....i am waiting for your answer please?

you need at least 6 to 7 volts input in order for the 7805 to be able to regulate it down to 5 volts to power the MCU. however, if you power it up with the aforementioned voltages you can use it as a step-down converter to have a 5v5 output.

if we would replace the 1n5819 diode with a 1n5822 diode, wouldn't it be possible to draw up to 3 A ? (ofc if we take into account that our power inductor can handle this)

Sir, can you added also the calculation for getting the component in the later video. Especially using inductor and resistor and capacitor when making something like buck / boost converter. Thanks ^^

1. in your shematic R9 not a resitor is it load ?

2. 100nF ceramic cap. you use only on of them at finished photo or i coudnt see it but shematic & bom 2 of them

3.attiny 85 whats the options for programing bod % ldo enable/disabled, 8mhz (int/ext) ?