Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Ramji Patel
Published © LGPL

ATtiny85 BOOST CONVERTER

ATtiny85 Boost Converter(SMPS)

AdvancedWork in progress6,797
ATtiny85 BOOST CONVERTER

Things used in this project

Hardware components

ATtiny85
Microchip ATtiny85
×1
MOSFET Transistor, Switching
MOSFET Transistor, Switching
×1
5 mm LED: Red
5 mm LED: Red
×1
Terminal Block Interface, Terminal Block
Terminal Block Interface, Terminal Block
×1
1N5819 – 1A Schottky Barrier Rectifier
1N5819 – 1A Schottky Barrier Rectifier
×1
Toroidal Inductor, 560 µH
Toroidal Inductor, 560 µH
×1
Capacitor 100 µF
Capacitor 100 µF
×2
Resistor 10k ohm
Resistor 10k ohm
×3
Resistor 100 ohm
Resistor 100 ohm
×1
Resistor 2.21k ohm
Resistor 2.21k ohm
×1
Multi-Turn Precision Potentiometer- 10k ohms (25 Turn)
Multi-Turn Precision Potentiometer- 10k ohms (25 Turn)
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE
Arduino IDE 2.0 (beta)

Hand tools and fabrication machines

Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering
Soldering Station, 110 V
Soldering Station, 110 V
PCB Holder, Soldering Iron
PCB Holder, Soldering Iron

Story

Read more

Schematics

ATTINY85 BOOST CONVETER

Download the pdf

ATtiny85 DIY Programming shield

ATtiny85 Programming Shield

Code

ATTINY85 BOOST CONVETER

Arduino
download it
#define F_CPU 8000000
int pwm = 1;
int potinput = A2;
int feedbackinput = A3;
int potinputval;
int feedbackinputval;
int pwmval;

void setup() {
  TCCR0A = 2 << COM0A0 | 2 << COM0B0 | 3 << WGM00;
  TCCR0B = 0 << WGM02 | 1 << CS00;
  TCCR1 = 0 << PWM1A | 0 << COM1A0 | 1 << CS10;
  GTCCR = 1 << PWM1B | 2 << COM1B0;
  pinMode(pwm, OUTPUT);
  pinMode(potinput, INPUT);
  pinMode(feedbackinput, INPUT);
  digitalWrite(pwm, LOW);
  pwmval = 0;
}

void loop() {
  potinputval = analogRead(potinput);
  potinputval = map(potinputval, 1023, 0, 255, 0);
  feedbackinputval = analogRead(feedbackinput);
  feedbackinputval = map(feedbackinputval, 1023, 0, 255, 0);
  while (potinputval > feedbackinputval) {
    if (pwmval == 230) {
      potinputval = analogRead(potinput);
      potinputval = map(potinputval, 1023, 0, 255, 0);
      feedbackinputval = analogRead(feedbackinput);
      feedbackinputval = map(feedbackinputval, 1023, 0, 255, 0);
    }
    else {
      pwmval = pwmval + 1;
      analogWrite(pwm, pwmval);
      potinputval = analogRead(potinput);
      potinputval = map(potinputval, 1023, 0, 255, 0);
      feedbackinputval = analogRead(feedbackinput);
      feedbackinputval = map(feedbackinputval, 1023, 0, 255, 0);
    }
  }
  while (potinputval < feedbackinputval) {
    if (pwmval == 0) {
      potinputval = analogRead(potinput);
      potinputval = map(potinputval, 1023, 0, 255, 0);
      feedbackinputval = analogRead(feedbackinput);
      feedbackinputval = map(feedbackinputval, 1023, 0, 255, 0);
    }
    else {
      pwmval = pwmval - 1;
      analogWrite(pwm, pwmval);
      potinputval = analogRead(potinput);
      potinputval = map(potinputval, 1023, 0, 255, 0);
      feedbackinputval = analogRead(feedbackinput);
      feedbackinputval = map(feedbackinputval, 1023, 0, 255, 0);
    }
  }
}

Credits

Ramji Patel

Ramji Patel

26 projects • 18 followers
Myself Ramji Patel. I am an Engineering student and pursuing my B-Tech from Institute of engineering and rural Technology Prayagraj, India.

Comments