CUK CONVERTER

Photo of author

By Jackson Taylor

As an Amazon Associate we earn from qualifying purchases.

INPUT SOURCE -SOLAR PANEL (MAXIMUM OPEN LOOP VOLTAGE =20V) OUTPUT LOAD– BATTERY OF 12V ,WITH CONSTANT VOLTAGE OF 14V 

CIRCUIT

Circuit diagram

PROGRAM

//feed back by 10k and 1k
//adc value ---0.75 for 8
//adc=2733/4.88 ==560
//to get adc value =v/.11
//8----150
//7.5--139
//7--132
int p=115;
void setup()
{
 setPwmFrequency(9, 1);
 analogWrite(9,p);
 Serial.begin(9600);
}
void loop()
{
 int a=analogRead(2);
 delay(1);
 Serial.println(p);
 if(a>340)
 {
   p=p-1;
   if(p<0)p=0;
   analogWrite(9,p);
 }
 if (a<320 )//&& a>100
 {
   p=p+1;
   if(p>220)p=p-1;
   analogWrite(9,p);
 }
}
void setPwmFrequency(int pin, int divisor) {
   byte mode;
   if(pin == 5 || pin == 6 || pin == 9 || pin == 10) {
     switch(divisor) {
       case 1: mode = 0x01; break;
       case 8: mode = 0x02; break;
       case 64: mode = 0x03; break;
       case 256: mode = 0x04; break;
       case 1024: mode = 0x05; break;
       default: return;
     }
     if(pin == 5 || pin == 6) {
       TCCR0B = TCCR0B & 0b11111000 | mode;
     } else {
       TCCR1B = TCCR1B & 0b11111000 | mode;
     }
   } else if(pin == 3 || pin == 11) {
     switch(divisor) {
       case 1: mode = 0x01; break;
       case 8: mode = 0x02; break;
       case 32: mode = 0x03; break;
       case 64: mode = 0x04; break;
       case 128: mode = 0x05; break;
       case 256: mode = 0x06; break;
       case 1024: mode = 0x7; break;
       default: return;
     }
     TCCR2B = TCCR2B & 0b11111000 | mode;
   }
}
/**
 * Divides a given PWM pin frequency by a divisor.
 *
 * The resulting frequency is equal to the base frequency divided by
 * the given divisor:
 *   - Base frequencies:
 *     o The base frequency for pins 3, 9, 10, and 11 is 31250 Hz.
 *     o The base frequency for pins 5 and 6 is 62500 Hz.
 *   - Divisors:
 *     o The divisors available on pins 5, 6, 9 and 10 are: 1, 8, 64,
 *       256, and 1024.
 *     o The divisors available on pins 3 and 11 are: 1, 8, 32, 64,
 *       128, 256, and 1024.
 *
 * PWM frequencies are tied together in pairs of pins. If one in a
 * pair is changed, the other is also changed to match:
 *   - Pins 5 and 6 are paired on timer0
 *   - Pins 9 and 10 are paired on timer1
 *   - Pins 3 and 11 are paired on timer2
 *
 * Note that this function will have side effects on anything else
 * that uses timers:
 *   - Changes on pins 3, 5, 6, or 11 may cause the delay() and
 *     millis() functions to stop working. Other timing-related
 *     functions may also be affected.
 *   - Changes on pins 9 or 10 will cause the Servo library to function
 *     incorrectly.
 *
 * Thanks to macegr of the Arduino forums for his documentation of the
 * PWM frequency divisors. His post can be viewed at:
 *   http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235060559/0#4
 *
 */

What Is a Cuk Converter and How Does It Work?

A Cuk converter (also written Ćuk, and sometimes called a Cuk regulator) is a DC-DC converter that can produce an output voltage either higher or lower than its input. It is related to the buck-boost converter, but it has an inductor on both the input side and the output side. Because of this, the input and output currents are fairly smooth, which means less ripple and less noise on the solar panel and the battery. The converter is named after Slobodan Ćuk, who developed it.

The circuit uses a small number of parts:

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video
  • Two inductors, one at the input and one at the output.
  • A coupling capacitor that carries energy from the input side to the output side.
  • A switch, usually a MOSFET, driven by a PWM signal from the Arduino.
  • A diode and an output capacitor.

When the switch is on, the input inductor stores energy from the source. When it turns off, that energy charges the coupling capacitor, and the output inductor supplies the load. The duty cycle of the PWM signal sets how much energy moves across each cycle.

Voltage Relationship

For an ideal converter in continuous conduction, the output voltage magnitude is:

Vout = Vin × D / (1 − D)

Here D is the duty cycle. Below 50% duty the converter steps down, and above 50% it steps up. In this project the panel can reach about 20V and the battery needs about 14V, so the ideal duty cycle at full panel voltage is around 0.41 (14 / (14 + 20)). Real circuits need a slightly higher duty cycle because of switch and diode losses, so treat this only as a starting estimate.

Inverted Output

A standard Cuk converter gives an output with the opposite polarity to the input. When you wire the battery or load, check the polarity against the circuit diagram. Connecting it the wrong way can damage the battery or the Arduino. Also keep the feedback divider voltage within the range the Arduino analog pin can read.

See also
CUK CONVERTER WITH MPPT FOR 12V BATTERY CHARGING FROM SOLAR PANEL USING ARDUINO

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works