Components and supplies
Resistor 150 KiloOhm
Resistor 10k ohm
Resistor 47 kOhm
Resistor 390 Ohm
Arduino Micro
Capacitor 100 nF
Capacitor 1 NanoFarad, Ceramic
Capacitor 1000 µF
Diode BYM 26 C
Transistor BC 550 C
Capacitor 820 MicroFarad, 350 Volt
Resistor 8.2 MegaOhm
Power-MOSFET BUK 437-400 B
Inductor 82 MicroHenry, ferrite, 3 Ampere
Project description
Code
High Voltage Boost Converter
c_cpp
Code and Description on how the software for a high voltage boost converter works
1/* 2 High-Voltage Converter and Flash-Light 3 ====================================== 4 5 Control a DC-DC converter to generate High Voltage for Flash and trigger flashlight once the required 6 working-voltage is reached. This project uses an Arduino Micro (5V power) with Aref connected to a voltage 7 of 4.096 Volts. Pin numbers refer to the Arduino Micro Pin numbering 8 9 Revision History 10 ---------------- 11 2017-06-12 wasc High voltage generation code 12 2017-07-09 wasc Added code for triggering flash-light 13 2017-07-28 wasc reformatted to fit with the published paper 14 15 ------------------------------------------------------------------------------------------------------------------ 16*/ 17 18 19// define constants and variables with global scope in this module 20 21// Part 1: High Voltage boost converter 22const int PWM11 = 11; // this PWM (Timer-Counter 0) can be configured to run quite fast, see setup() 23const int HighVoltageInput = 6; // Analog 6 input (A6) is used to read the high voltage value 24const int MaxPulseWidth = 255; // Maximum value for the pulse width setting (hardware determined) 25const int BoostPulseWidth = 210; // Pulse width to be used in PWM when HV is generated 26const int SleepPulseWidth = 3; // Pulse width to be used in PWM when HV has reached working value 27const int MaxHighVoltageValue = 445; // this is the value to set the expected High Voltage 28 // 110 = approx. 50V 29 // 220 = approx. 100V 30 // 445 = approx. 200V 31 // 560 = approx. 250V 32const int HVhysteresis = 10; // To ensure sufficient trigger pulse width for thyristor, trigger pulse will end 33 // only when high-voltage has decreased by hysteresis value 34 35// part 2: electronic flash-tube 36const int FlashPin = 7; // Digital Pin 7 is used as output to fire the flash 37 38 39 40// ----------------------------------------------SETUP------------------------------------------------------------- 41// This function is executed one single time at the start of the microcontroller (HW&SW initialisation) 42void setup() { 43 44 // Set Arduino Micro Pin D11 as PWM-output and set the prescaler of Timer/Counter 0 to 1x to allow 65kHz 45 pinMode( PWM11, OUTPUT); 46 TCCR0B = 0x01; // This will result in a frequency of about 65 kHz at PWM11 47 // This changes the predefined Arduino environment -- see hardware manual 48 // INFO: This changes also the delay() function which provides much shorter delays now! 49 50 // use the 4.096 Volts reference at Aref pin 51 analogReference( EXTERNAL ); 52 53 // set Digital Pin 7 as output 54 pinMode( FlashPin, OUTPUT); 55 digitalWrite(FlashPin, LOW); // Just to be sure the Thyristor will not be triggered yet 56 57} 58 59 60 61// ------------------------------------------------------LOOP------------------------------------------------------- 62// This function is executed repeatedly forever (make sure it can run through quickly and will not be stuck in a waiting loop) 63void loop() { 64 65 // define some variables to be used here 66 int PulseWidth; // the pulse width to be set in the PWM, computed by algorithm below 67 int HighVoltageValue; // the ADC reading for the high voltage 0 = 0V to 1023 = 409.5V 68 69 70 // This is the control section to control the generation of the high-voltage. A timer of the Arduino is used as PWM 71 // to generate the pulses for the simple boost converter. The microcontroller generates the pulses and controls the pulse 72 // width to generate the desired high voltage value. 73 74 // measure the high voltage value with analog input 75 HighVoltageValue = analogRead( HighVoltageInput ); // will be used for setting the required pulse width of the PWM 76 // as well as (in this sample code) to trigger the 77 // flash-light when working voltage is reached 78 79 //now compute the required pulse width 80 if (HighVoltageValue <= MaxHighVoltageValue) PulseWidth = BoostPulseWidth; // Full Pulse width while high voltage is below target value. 81 else PulseWidth =SleepPulseWidth; // Once high voltage reaches target voltage, reduce 82 // pulse width so far as to disable the Power FET 83 84 // now set the PWM to the desired pulse width 85 analogWrite( PWM11, (MaxPulseWidth - PulseWidth) ); // Note: Pulse is inverted by hardware to ensure proper operation 86 // when pin is tri-stated (e.g. at startup) 87 88 89 // Trigger flash when expected high voltage is reached. This results in a 'traffic flashlight'. 90 // Here would be the place to trigger the flash for another reason, e.g. based on an photosensor signal, electrical contact etc. 91 if (HighVoltageValue >= MaxHighVoltageValue ) digitalWrite(FlashPin, HIGH); // trigger flash when expected voltage is reached 92 else if (HighVoltageValue < (MaxHighVoltageValue - HVhysteresis)) digitalWrite(FlashPin, LOW); // stop trigger pulse only when the high voltage 93 // has decreased below the working voltage 94 95} 96 97 98INFORMATION 99The Arduino development and run-time environment is very comfortable and offers -- together with the microcontroller hardware -- analog outputs in form of pulse width modulators (PWM). For switch mode power supplies in general and also the push converter shown here, the inductor (or coil) and capacitors will be smaller and cheaper the higher the working frequency is. The working frequency of the PWM offered by Arduino is quite low: However the Arduino development environment offers the possibility to change the values in the microcontrollers configuration registers quite easily. This is done by the code line 100TCCR0B = 0x01; 101This changes the value in the timer-counter control-register 0B and changes the pre-scaler (see the hardware manual of the microcontroller for details). As a result the PWM used here is running 64 times faster and ends up with a frequency of approx. 65kHz. 102Note: The change of this pre-scaler is also influencing some other functions used in Arduino, e.g. the delay() function. This is however not really a problem, since in a real-time application the delay() function is not really of use. 103The rest of the code is quite straight forward: The PWM is used to generate the high voltage, which is stored in this example in capacitor C3. 104As mentioned in the hardware section above, the hardware circuit is inverting the pulse and the software's PWM setting must consider this inversion: This is done with the subtraction in the command where the PWM's pulse-width is set: 105analogWrite( PWM11, (MaxPulseWidth - PulseWidth) ); 106The pulse width can be selected in a wide range. For a fast loading the pulse width should be as wide as possible (it can be easily adapted here to other values of the inductor/coil). The pulse width can be chosen in a way to keep electromagnetic radiation low: The inductor (L) and the capacitors (C) form an LC system which resonates and turning the power-MOSFET off when voltage and current are close to zero can be achieved by adequate selection of the pulse width. 107The high-voltage generated will be monitored with the help of an analog input (we use Analog Input 6 in this case). While the high voltage is below the expected value, the pulse width will be set to a large value to allow for a good performance in loading the capacitor. as soon as the desired voltage is reached, the sample code is turning the power-MOSFET off (when using a very narrow pulse, the power-MOSFET will not be turned on and off). This is resulting in a simple direct digital control also called a 'bang-bang' regulation. 108if (HighVoltageValue <= MaxHighVoltageValue) PulseWidth = BoostPulseWidth; 109else PulseWidth =SleepPulseWidth; 110While such a simple regulation of the high voltage is sufficient here, a DC-to-DC converter using this circuit (e.g. to generate 48 volts for telephony) may require a slightly better regulation. Such a regulation can be implemented easily by using a few lines of code replacing the above bang-bang regulator and selecting more values for the pulse width (e.g. pulse width proportional to the difference of the expected high voltage minus the actual high voltage to achieve a P-regulator).
High Voltage Boost Converter
c_cpp
Code and Description on how the software for a high voltage boost converter works
1/* 2 High-Voltage Converter and Flash-Light 3 ====================================== 4 5 6 Control a DC-DC converter to generate High Voltage for Flash and trigger flashlight 7 once the required 8 working-voltage is reached. This project uses an Arduino 9 Micro (5V power) with Aref connected to a voltage 10 of 4.096 Volts. Pin numbers 11 refer to the Arduino Micro Pin numbering 12 13 Revision History 14 ---------------- 15 16 2017-06-12 wasc High voltage generation code 17 2017-07-09 wasc Added code for 18 triggering flash-light 19 2017-07-28 wasc reformatted to fit with the published 20 paper 21 22 ------------------------------------------------------------------------------------------------------------------ 23*/ 24 25 26// 27 define constants and variables with global scope in this module 28 29// Part 1: 30 High Voltage boost converter 31const int PWM11 = 11; // this PWM 32 (Timer-Counter 0) can be configured to run quite fast, see setup() 33const int 34 HighVoltageInput = 6; // Analog 6 input (A6) is used to read the high voltage 35 value 36const int MaxPulseWidth = 255; // Maximum value for the pulse width 37 setting (hardware determined) 38const int BoostPulseWidth = 210; // Pulse 39 width to be used in PWM when HV is generated 40const int SleepPulseWidth = 3; 41 // Pulse width to be used in PWM when HV has reached working value 42const 43 int MaxHighVoltageValue = 445; // this is the value to set the expected High Voltage 44 45 // 110 = approx. 50V 46 // 47 220 = approx. 100V 48 // 445 = approx. 200V 49 50 // 560 = approx. 250V 51const int HVhysteresis 52 = 10; // To ensure sufficient trigger pulse width for thyristor, trigger 53 pulse will end 54 // only when high-voltage 55 has decreased by hysteresis value 56 57// part 2: electronic flash-tube 58const 59 int FlashPin = 7; // Digital Pin 7 is used as output to fire the 60 flash 61 62 63 64// ----------------------------------------------SETUP------------------------------------------------------------- 65// 66 This function is executed one single time at the start of the microcontroller (HW&SW 67 initialisation) 68void setup() { 69 70 // Set Arduino Micro Pin D11 as PWM-output 71 and set the prescaler of Timer/Counter 0 to 1x to allow 65kHz 72 pinMode( PWM11, 73 OUTPUT); 74 TCCR0B = 0x01; // This will result in a frequency of 75 about 65 kHz at PWM11 76 // This changes the predefined 77 Arduino environment -- see hardware manual 78 // 79 INFO: This changes also the delay() function which provides much shorter delays 80 now! 81 82 // use the 4.096 Volts reference at Aref pin 83 analogReference( 84 EXTERNAL ); 85 86 // set Digital Pin 7 as output 87 pinMode( FlashPin, OUTPUT); 88 89 digitalWrite(FlashPin, LOW); // Just to be sure the Thyristor will not be triggered 90 yet 91 92} 93 94 95 96// ------------------------------------------------------LOOP------------------------------------------------------- 97// 98 This function is executed repeatedly forever (make sure it can run through quickly 99 and will not be stuck in a waiting loop) 100void loop() { 101 102 // define some 103 variables to be used here 104 int PulseWidth; // the pulse 105 width to be set in the PWM, computed by algorithm below 106 int HighVoltageValue; 107 // the ADC reading for the high voltage 0 = 0V to 1023 = 409.5V 108 109 110 111 // This is the control section to control the generation of the high-voltage. 112 A timer of the Arduino is used as PWM 113 // to generate the pulses for the simple 114 boost converter. The microcontroller generates the pulses and controls the pulse 115 116 // width to generate the desired high voltage value. 117 118 // measure the 119 high voltage value with analog input 120 HighVoltageValue = analogRead( HighVoltageInput 121 ); // will be used for setting the required pulse width of the 122 PWM 123 // 124 as well as (in this sample code) to trigger the 125 // 126 flash-light when working voltage is reached 127 128 //now compute the required 129 pulse width 130 if (HighVoltageValue <= MaxHighVoltageValue) PulseWidth = BoostPulseWidth; 131 // Full Pulse width while high voltage is below target value. 132 else PulseWidth 133 =SleepPulseWidth; // Once high voltage 134 reaches target voltage, reduce 135 // 136 pulse width so far as to disable the Power FET 137 138 139 // now set the PWM to the desired pulse width 140 analogWrite( PWM11, (MaxPulseWidth 141 - PulseWidth) ); // Note: Pulse is inverted by hardware to ensure proper 142 operation 143 // when 144 pin is tri-stated (e.g. at startup) 145 146 147 // Trigger flash when expected 148 high voltage is reached. This results in a 'traffic flashlight'. 149 // Here would 150 be the place to trigger the flash for another reason, e.g. based on an photosensor 151 signal, electrical contact etc. 152 if (HighVoltageValue >= MaxHighVoltageValue 153 ) digitalWrite(FlashPin, HIGH); // trigger flash when expected 154 voltage is reached 155 else if (HighVoltageValue < (MaxHighVoltageValue - HVhysteresis)) 156 digitalWrite(FlashPin, LOW); // stop trigger pulse only when the high voltage 157 158 // 159 has decreased below the working voltage 160 161} 162 163 164INFORMATION 165The 166 Arduino development and run-time environment is very comfortable and offers -- together 167 with the microcontroller hardware -- analog outputs in form of pulse width modulators 168 (PWM). For switch mode power supplies in general and also the push converter shown 169 here, the inductor (or coil) and capacitors will be smaller and cheaper the higher 170 the working frequency is. The working frequency of the PWM offered by Arduino is 171 quite low: However the Arduino development environment offers the possibility to 172 change the values in the microcontrollers configuration registers quite easily. 173 This is done by the code line 174TCCR0B = 0x01; 175This changes the value in the 176 timer-counter control-register 0B and changes the pre-scaler (see the hardware manual 177 of the microcontroller for details). As a result the PWM used here is running 64 178 times faster and ends up with a frequency of approx. 65kHz. 179Note: The change 180 of this pre-scaler is also influencing some other functions used in Arduino, e.g. 181 the delay() function. This is however not really a problem, since in a real-time 182 application the delay() function is not really of use. 183The rest of the code is 184 quite straight forward: The PWM is used to generate the high voltage, which is stored 185 in this example in capacitor C3. 186As mentioned in the hardware section above, 187 the hardware circuit is inverting the pulse and the software's PWM setting must 188 consider this inversion: This is done with the subtraction in the command where 189 the PWM's pulse-width is set: 190analogWrite( PWM11, (MaxPulseWidth - PulseWidth) 191 ); 192The pulse width can be selected in a wide range. For a fast loading the pulse 193 width should be as wide as possible (it can be easily adapted here to other values 194 of the inductor/coil). The pulse width can be chosen in a way to keep electromagnetic 195 radiation low: The inductor (L) and the capacitors (C) form an LC system which resonates 196 and turning the power-MOSFET off when voltage and current are close to zero can 197 be achieved by adequate selection of the pulse width. 198The high-voltage generated 199 will be monitored with the help of an analog input (we use Analog Input 6 in this 200 case). While the high voltage is below the expected value, the pulse width will 201 be set to a large value to allow for a good performance in loading the capacitor. 202 as soon as the desired voltage is reached, the sample code is turning the power-MOSFET 203 off (when using a very narrow pulse, the power-MOSFET will not be turned on and 204 off). This is resulting in a simple direct digital control also called a 'bang-bang' 205 regulation. 206if (HighVoltageValue <= MaxHighVoltageValue) PulseWidth = BoostPulseWidth; 207else 208 PulseWidth =SleepPulseWidth; 209While such a simple regulation of the high voltage 210 is sufficient here, a DC-to-DC converter using this circuit (e.g. to generate 48 211 volts for telephony) may require a slightly better regulation. Such a regulation 212 can be implemented easily by using a few lines of code replacing the above bang-bang 213 regulator and selecting more values for the pulse width (e.g. pulse width proportional 214 to the difference of the expected high voltage minus the actual high voltage to 215 achieve a P-regulator).
Downloadable files
Hardware Information
describes the way the high voltage boost converter works
Hardware Information
Hardware Information
describes the way the high voltage boost converter works
Hardware Information
High Voltage Push Converter
Simple and inexpensive circuit allowing Arduino to generate a high voltage
High Voltage Push Converter
Comments
Only logged in users can leave comments
ArminSchweizer
0 Followers
•0 Projects
Table of contents
Intro
0
0