DIY Buck/Boost Converter (Flyback)

77,503

357

74

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 (affiliate links):

Aliexpress:
1x ATtiny85: https://s.click.aliexpress.com/e/_d6SPsKP

1x MCP602: https://s.click.aliexpress.com/e/_dZIAwSP

1x 7805 5V regulator: https://s.click.aliexpress.com/e/_d8kqX6x

1x IRLZ44N: https://s.click.aliexpress.com/e/_dWhSrDl

1x 100kΩ Potentiometer: https://s.click.aliexpress.com/e/_dX83GAF

1x 0.03mH Inductor: https://s.click.aliexpress.com/e/_dYct48b

1x 1N5819 Schottky Diode: https://s.click.aliexpress.com/e/_dYR45Bh

2x Screw Terminals: https://s.click.aliexpress.com/e/_dYbstfZ

2x 100nF Capacitor: https://s.click.aliexpress.com/e/_dU4FEsB

1x 100µF, 1x 220µF Capacitor: https://s.click.aliexpress.com/e/_d7dOwRz

2x 10kΩ, 2x 5.1kΩ, 2x 20kΩ, 1x10Ω Resistor: https://s.click.aliexpress.com/e/_dTPpXjt

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

2 People Made This Project!

Recommendations

  • Battery Powered Contest

    Battery Powered Contest
  • Plywood Challenge

    Plywood Challenge
  • Plastic Contest

    Plastic Contest

74 Discussions

0
nzube
nzube

Question 6 weeks ago

Where is the code?

2
SarvjitP
SarvjitP

5 months ago

I'm getting error that TCCR1 PWM11 are not declared. How can I solve this?

0
Iqbal Samin
Iqbal Samin

3 years ago

I can not find MCP602. Can I use NE5532 or LM358?

0
BrandonB171
BrandonB171

Reply 10 months ago

Probably, but I believe its actually MCP6022

0
KIGULAB
KIGULAB

Question 2 years ago on Step 4

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

0
BrandonB171
BrandonB171

Answer 10 months ago

Cont int does is not intended to change, Int does.

1
Valenorious.
Valenorious.

Answer 2 years 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
razim_sha
razim_sha

Question 1 year ago

please anyone tell what is the value of R9

PicsArt_02-05-07.43.28.jpg
0
BrandonB171
BrandonB171

Answer 10 months ago

R9 is a simulated load

0
ZakkyM2
ZakkyM2

Answer 1 year ago

R9 = Load

1
sk492029
sk492029

1 year ago

Not working waste of time

0
mizraim.mtz
mizraim.mtz

1 year ago

I have problems when connecting my oscilloscope to measure the output voltage. When I connect the ground clip the output voltage gets modified to aproximate my input voltage. Someone had a similar problem?

0
erastescientifique
erastescientifique

1 year ago

J'ai essayé de charger le code mais voici l'erreur qui s'affiche : exit status 1
'TCCR1' was not declared in this scope/
que faire s'il vous plait ????

0
sivadasrajan007
sivadasrajan007

Question 2 years 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
1
Relaf
Relaf

Question 2 years ago on Step 5

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

0
khavoc
khavoc

Question 2 years 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
Valenorious.
Valenorious.

Answer 2 years 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.

1
LexenZ
LexenZ

2 years ago

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

0
AbduA7
AbduA7

2 years ago

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

0
Minecrafter211
Minecrafter211

2 years ago

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