DIY Buck/Boost Converter (Flyback)

49,882

326

64

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

  • Optics Contest

    Optics Contest
  • Plastics Contest

    Plastics Contest
  • Make it Glow Contest 2018

    Make it Glow Contest 2018

64 Discussions

0
None
sivadasrajan007

Question 5 weeks ago

Hi

i tried to replicate the results with following changes

used a breadboard

1.used an arduino nano

2.replaced irlz44n with irfz44n

3. didnt use 100nf cap at output of 7805

4.used attached code

5,didnt use the feedback circuit

i powered the circuit with a 12v rectified filtered(not regulated) output

when i adjusted the pot and went above 16v something (i suppose 7805) started to make a buzzing noise i kept going up and my nano behaved erratically and windows refused to detect the nano for a while.

can anyone tell me what went wrong?

F7BR3CPIU2NFBDJ.LARGE.jpgScreenshot (41).png
0
None
Relaf

Question 3 months ago on Step 5

May i know the max voltage and the max current this circuit is capable of?

0
None
KIGULAB

Question 9 months ago on Step 4

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

1 more answer
0
None
Valenorious.KIGULAB

Answer 6 months ago

"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
None
khavoc

Question 6 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
0
None
Valenorious.khavoc

Answer 6 months ago

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
None
LexenZ

10 months ago

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

0
None
AbduA7

10 months ago

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

0
None
Minecrafter211

10 months ago

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

0
None
wingweaver77

1 year ago

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

thank you

1 reply
0
None
AbduA7wingweaver77

Reply 10 months ago

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

0
None
AbduA7

10 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
None
LexenZ

10 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?

0
None
Nonametruck

10 months ago

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

0
None
jeverhar

2 years ago

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

5 replies
0
None
LexenZGreatScottLab

Reply 11 months ago

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?

0
None
ManikandanK4GreatScottLab

Reply 1 year ago

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?

0
None
GeorgeN86ManikandanK4

Reply 1 year ago

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.

0
None
BramV38GreatScottLab

Reply 1 year ago

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)