High Voltage Switch Mode Power Supply (SMPS)/Boost Converter for Nixie Tubes




Introduction: High Voltage Switch Mode Power Supply (SMPS)/Boost Converter for Nixie Tubes

This SMPS boosts low voltage (5-20 volts) to the high voltage needed to drive nixie tubes (170-200 volts). Be warned: even though this small circuit can be operated on batteries/low voltage wall-worts, the output is more than enough to kill you!

Project includes:
Helper Spreadsheet
EagleCAD CCT & PCB files
MikroBasic Firmware Source

Step 1: How Does It Work?

This design is based on the Microchip Application Note TB053 with several modifications based on the experience of Neonixie-L members (http://groups.yahoo.com/group/NEONIXIE-L/ ). Get the app note - it's a nice read of only a few pages :

(http://ww1.microchip.com/downloads/en/AppNotes/91053b.pdf )

The illustration below is excerpted from TB053. It outlines the basic principle behind the SMPS. A microcontroller grounds a FET (Q1), allowing a charge to build in inductor L1. When the FET is turned off, the charge flows through diode D1 into capacitor C1. Vvfb is a voltage divider feedback that allows the microcontroller to monitor the high voltage and activate the FET as needed to maintain the desired voltage.

Step 2: Inductor Characteristics

Though very nice, the Microchip app note seems a little backwards to me. It begins by determining the required power, then chooses an inductor charge time without concern for available inductors. I found it more useful to choose an inductor and design the application around that.

The inductors I used are "C&D Technologies Inductors RADIAL LEAD 100uH" (Mouser part 580-18R104C, 1.2 amp, $1.40), (Mouser part 580-22R104C, 0.67 amp, $0.59). I chose these inductors because they are very small, very cheap, yet have decent power ratings.

We already know the max continuous rating of our coil (0.67 amps for the 22R104C), but we need to know how long it will take to charge (rise time). Rather than use a fixed charge time (see equation 6 in TB053) to determine the required coil amps, we can interrogate equation 6 and solve for rise time: (note: equation 6 in TB053 is wrong, it should be L, not 2L)

(Volts in/Inductor uH)*rise_time=Peak Amps


(Inductor uH/Volts in) * Peak Amps = rise time.

-using the 22R104C with a 5 volt supply gives the following-


It will take 13.5 uS to fully charge the inductor coil at 5 volts. Obviously, this value will vary with different supply voltages.

As noted in TB053:
"The current in an inductor cannot change instantaneously. When Q1 is switched off, the current in L1 continues to flow through D1 to the storage capacitor, C1, and the load, RL. Thus, the current in the inductor decreases linearly in time from the peak current."

We can determine the amount of time it takes the current to flow out of inductor using TB05 equation 7. In practice this time is very short. This equation is implemented in the included spreadsheet, but will not be discussed here.

How much power can we get out of a 0.67 amp inductor? Total power is determined by the following equation (tb053 equation 5):

Power=(((rise time)*(Volts in)2)/(2*Inductor uH))

-using our previous values we find-

1.68 Watts=(13.5uS*5volts2)/(2*100uH)

-convert watts to mA-

mA=((Power Watts)/(output volts))*1000

-using an output voltage of 180 we find-

9.31mA = (1.68Watts/180volts)*1000

We can get a maximum of 9.31 mA from this coil with a 5 volt supply, ignoring all inefficiencies and switching losses. Greater output power can be achieved by increasing the supply voltage.

All of these calculations are implemented in "Table 1: Coil Calculations for High Voltage Power Supply" of the spreadsheet included with this instructable. Several example coils are entered.

Step 3: Driving the SMPS With a Microcontroller

Now that we have calculated the rise time for our coil we can program a microcontroller to charge it just long enough to reach its rated mA. One of the easiest ways to do this is to use the hardware pulse width modulator of a PIC. Pulse width modulation (PWM) has two variables outlined in the figure below. During the duty cycle the PIC turns on the FET, grounding it and allowing current into the inductor coil (rise time). During the remainder of the period the FET is off and current flows out of the inductor through the diode to the capacitors and load (fall time).

We already know the required rise time from our previous calculations: 13.5uS. TB053 suggests that rise time be 75% of the period. I determined my period value by multiplying the rise time by 1.33: 17.9uS. This is consistent with the suggestion in TB053 and ensures that the inductor stays in discontinuous mode – discharging completely after each charge. It is possible to calculate a more exact period by adding the calculated rise time to the calculated fall time, but I have not attempted this.

Now we can determine the actual duty cycle and period values to enter into the microcontroller to get the desired time intervals. In the Microchip PIC Mid-range manual we find the following equations (http://ww1.microchip.com/downloads/en/DeviceDoc/33023a.pdf ):

PWM Duty Cycle uS =(10 bit Duty Cycle Value) * (1/ oscillator Frequency) * Prescaler

If we set prescaler to 1 and beat this equation with an algebra stick we get:

10 bit Duty Cycle Value = PWM Duty Cycle uS * Oscillator Frequency

Substitute the Duty Cycle uS for calculated rise time, and assume a 8 Mhz oscillator frequency:

107 = 13.5uS * 8Mhz

107 is entered into the PIC to get a duty cycle of 13.5uS.

Next, we determine the PWM Period Value. From the Mid-Range Manual we get the following equation:

PWM period uS = ((PWM period value) + 1) * 4 * (1/oscillator frequency) * (prescale value)

Again, we set prescaler to 1 and harass the equation for PWM period value, giving us:

PWM period value = ((PWM Period uS/(4/Oscillator frequency))-1)

Substitute Period uS for (1.33*rise time), and assume a 8 Mhz oscillator frequency:

35= ((17.9/(4/8))-1)

35 is entered into the PIC to get a period of 17.9uS. But wait! Isn't the period shorter than the duty cycle? No - PICs have a 10 bit duty cycle register and a 8 bit period register. There is more resolution for the duty cycle value, thus its value will sometimes be larger than the period value - especially at high frequencies.

All of these calculations are implemented in "Table 2. PWM Calculations" of the spreadsheet included with this instructable. Several example coils are entered.

Step 4: PCB Design

PCB & CCT are in EagleCad format. Both are included in the ZIP archive.

I looked at several existing designs when making this PCB. Here are my notes re:important design characteristics:

1.I followed the Microchip APP note and used a TC4427A to drive the FET. This A) protects the microcontroller from flyback voltages coming off the FET, and B) can drive the FET at higher voltages than the PIC for faster/harder switching with better efficiency.
2.The distance from the PWM of the PIC to the FET is minimized.
3. FET, inductor, capacitors packed really tight.
4. Fat supply trace.
5. Good ground between FET and wall-wort connection point.

I chose the PIC 12F683 microcontroller for this project. This is a 8 pin PIC with hardware PWM, 4 analog to digital converters, 8Mhz internal oscillator, and 256 byte EEPROM. Most importantly, I had one on had from a previous project. I used the IRF740 FET because of its high acclaim on the Neonixie-L list. There are 2 capacitors to smooth the HV supply. One is a electrolytic (high temperature, 250 volts, 1uF), the other is a metal film (250 volts, 0.47uf). The latter is much larger and more expensive ($0.50 vs $0.05), but necessary to get a clean output.

There are two voltage feedback circuits in this design. The first allows the PIC to sense the output voltage and apply pulses to the FET as needed to maintain the desired level. "Table3. High Voltage Feedback Network Calculations" can be used to determine the correct feedback value given the 3 resistor voltage divider and desired output voltage. Fine tuning is done with the 1k trimmer resistor.

The second feedback measures the supply voltage so the PIC can determine optimal rise time (and period/duty cycle values). From the equations in step 1 we found that the inductor rise time is dependent on the supply voltage. It is possible to enter exact values from the spreadsheet into your PIC, but if the power supply is changed the values are no longer optimal. If running from batteries, the voltage will decrease as the batteries discharge necessitating a longer rise time. My solution was to let the PIC calculate all of this and set its own values (see firmware).

The three pin jumper selects the supply source for the TC4427A and inductor coil. It is possible to run both from the 7805 5 volt regulator, but better efficiencies and higher output is achieved with a bigger supply voltage. Both the TC4427a and the IRF740 FET will withstand up to ~20 volts. Since the PIC will calibrate for any given supply voltage it makes sense to feed these directly from the power supply. This is especially important in battery operation - no need to waste power in the 7805, just feed the inductor directly from the cells.

The LEDs are optional, but handy for trouble shooting. The 'left' LED (yellow in my boards) indicates that HV feedback is under the desired point, while the right LED (red in my design) indicates it is over. In practice you get a nice PWM effect in which the LEDS glow in intensity relative to the current load. If the red LED turns (solid) off it indicates that, despite its best effort, the PIC can't keep the output voltage at the desired level. In other words, the load exceeds the SMPS maximum output.



Part Value

C1 1uF 250V
C3 47uF 50V
C4 47uF (50V)
C5 0.1uF
C6 .1uf
C7 4u7 (50V)
C8 0.1uF
C9 0.1uF
C11 0.47uF/250V
D1 600V 250ns
IC2 TC4427a
IC5 7805 5volt regulator
IC7 PIC 12F683
L1 Inductor (22R104C)
Q1 IRF740
R1 120K
R2 0.47K
R3 1K Linear Trimmer
R4 330 Ohm
R5 100K
R6 330 Ohm
R7 10K
SV1 3 Pin Header
X2 3 Screw Terminal

Step 5: Firmware

The firmware is written in MikroBasic, the compiler is free for programs up to 2K (http://www.mikroe.com/ ).
If you need a PIC programmer, consider my enhanced JDM2 programmer board also posted at instructables (https://www.instructables.com/ex/i/6D80A0F6DA311028931A001143E7E506/?ALLSTEPS ).

Basic operation:

1.When power is applied the PIC starts.
2.PIC delays for 1 second to allow voltages to stabilize.
3.PIC reads the supply voltage feedback and calculates optimal duty cycle and period values.

4.PIC logs the ADC reading, duty cycle, and period values to the EEPROM. This allows some trouble shooting and helps diagnose catastrophic failures. EEPROM address 0 is the write pointer. One 4 byte log is saved each time the SMPS is (re-)started. The first 2 bytes are ADC high/low, third byte is lower 8 bits of duty cycle value, fourth byte is the period value. A total of 50 calibrations (200 bytes) are logged before the write pointer rolls over and starts again at EEPROM address 1. The most recent log will be located at pointer-4. These can be read out of the chip using a PIC programmer. The upper 55 bytes are left free for future enhancements (see improvements).

5.PIC enters endless loop - high voltage feedback value is measured. If it is below the desired value the PWM duty cycle registers are loaded with the calculated value - NOTE: the lower two bits are important and must be loaded into CPP1CON 5:4 , upper 8 bits go into CRP1L. If the feedback is above the desired value, the PIC loads the duty cycle registers with 0. This is a 'pulse skip' system. I decided on pulse skip for two reasons: 1) at such high frequencies there isn't a lot of duty width to play with (0-107 in our example, much less at higher supply voltages), and 2) frequency modulation is possible, and gives a lot more room for adjustment (35-255 in our example), but ONLY DUTY IS DOUBLE BUFFERED IN HARDWARE. Changing the frequency while the PWM is operating can have 'strange' effects.

Using the firmware:

Several calibration steps are required to use the firmware. These values must be compiled into the firmware. Some steps are optional, but will help you get the most out of your power supply.

const v_ref as float=5.1 'float
const supply_ratio as float=11.35 'float
const osc_freq as float=8 'float
const L_Ipeak as float=67 'float
const fb_value as word=290 'word

These values can be found at the top of the firmware code. Find the values and set as follows.

This is the voltage reference of the ADC. This is needed to determine the actual supply voltage to include in the equations described in step1. If the PIC is run from an 7805 5volt regulator we can expect around 5 volts. Using a multimeter measure the voltage between the PIC power pin (PIN1) and ground at the screw terminal. My exact value was 5.1 volts. Enter this value here.

The supply voltage divider consists of a 100K and 10K resistor. Theoretically the feedback should equal the supply voltage divided by 11 (see Table 5. Supply Voltage Feedback Network Calculations). In practice, resistors have various tolerances and are not exact values. To find the exact feedback ratio:

1.Measure the supply voltage between the screw terminals.
2.Measure the feedback voltage between PIC pin 7 and ground at the screw terminal.
3.Divide Supply V by FB V to get an exact ratio.

You can also use "Table 6. Supply Voltage Feedback Calibration".

Simply the oscillator frequency. I use the 12F683 internal 8Mhz oscillator, so I enter a value of 8.

Multiply the inductor coil uH by the maximum continuous amps to get this value. In the example the 22r104C is a 100uH coil with a rating of .67amps continuous. 100*.67=67. Multiplying the value here eliminates one 32 bit floating point variable and calculation that would otherwise have to be done on the PIC. This value is calculated in "Table 1: Coil Calculations for High Voltage Power Supply".

This is the actual integer value the PIC will use to determine if the high voltage output is above or below the desired level. Use Table 3 to determine the ratio between the HV output and feedback voltage when the linear trimmer is in the center position. Using the center value gives adjustment room on either side. Next, enter this ratio and your exact voltage reference in "Table 4. High Voltage Feedback ADC Set Value" to determine the fb_value.

After you find these values enter them into the code and compile. Burn the HEX to the PIC and you're ready to go! REMEMBER: EEPROM byte 0 is the log write pointer. Set it to 1 to begin logging to byte 1 on a fresh pic.

Because of the calibration, the FET and inductor should never become warm. Nor should you hear a ringing sound from the inductor coil. Both of these conditions indicate a calibration error. Check the data log in the EEPROM to help determine where your problem might be.

Step 6: Improvements

A couple things could be improved:

1.Put the screw terminal closer to FET for better ground path.
2.Fatten the supply trace to the capacitors and inductor.
3.Add a stable voltage reference to improve operation from batteries and supply voltages less than 7 volts (where the output of the 7805 dips below 5 volts).
4.Use the upper 55 EEPROM bytes to log fascinating bit of useless data - total run time, overload events, min/max/average load.



The Instructables Book Contest

Participated in the
The Instructables Book Contest

Be the First to Share


    • Science Fair Challenge

      Science Fair Challenge
    • Go Big Challenge

      Go Big Challenge
    • Make It Modular: Student Design Challenge

      Make It Modular: Student Design Challenge



    Question 3 years ago

    This was made in 2006 why is it being published in 2018? No schematic of the boost converter. will someone answer the question?


    7 years ago on Step 6

    Great instructable Ian. Really appreciate the explanations on SMPS operation, calculations of inductor values etc. Thanks for sharing. :)


    Hey Ian,

    Thanks for the awesome instructables! I really learned a great deal from it and you explained everything so thoroughly. I appreciate it. I'm hoping to use this circuit for a clock I'm building. Because of my design I already have regulated voltage rails so I'm assuming I don't need some of the components. I'm also using a different microcontroller for regulating voltage so the PIC wouldn't be needed. I was wondering if you could help me slim down your design, or at least tell me which components I can omit. I'm not quite versed in analog electronics so this is a bit new to me. I get the basics but I'm still a bit confused. Feel free to PM me. Thanks again!


    Reply 11 years ago on Introduction

    A nixie tube is a neon indicator that instead of displaying a little dot, can be used to display numbers or symbols. They were used to indicate numbers before they invented the LED or LCD.
    A quick web  search for "nixie tube" would provide you with far more information than I can or care to include in a posting.


    11 years ago on Introduction

    How do you fab your boards? Do you use a home etch kit or do you order online? Most places I've checked are pretty steep for one-off orders. Got a recommendation?


    14 years ago on Introduction

    Nice concise,informative instructable,with more than enough info. PS 15Milliamps is enough to kill you.


    Reply 13 years ago on Introduction

    Not if the fingertips are on the SAME hand,but if they ARE on different arms,then the current path IS across the chest,and hence very likely through the heart.


    Reply 13 years ago on Introduction

    Yeah, forgot to mention that. you're right! anyway, its better not to use yourself as a high voltage wire......


    Reply 13 years ago on Introduction

    In the UK it IS .015ma @ 230volts........................


    14 years ago on Introduction

    First of all, thank for this excellent instructable. The spreadsheet is really great. And the idea of calculating the charge and discharge times of the inductor rather than the inductor size, is something most vendor application notes leave out. Very educational. There is a note at the end about making it possible to implement this with power supply less than 7 volts. I think in order to do that you would need to use a different FET, because the IRF740 only fully turns on at 8 volts. I don't know if it's possible to find a logic level FET that works up to this kind of voltage, my local distributors don't stock them. In fact it might work better with a power transistor like MJE13005. Well that is just a guess, but in case anyone is trying to build this circuit to boost from very low voltage it could be interesting to think about FET selection. I am experimenting with implementing this topology but based on dsPIC30F1010 instead.


    15 years ago on Introduction

    Hey Ian,
    Would it be possible/feasible to make a 300W power supply with something like this? Obviously, some modifications would be required.

    I'm building a hot-air rework station, and having trouble finding a (cheap) power supply in the 300W range. I've always wanted to make your SMPS, and it would be cool to use it in my project. The PSU would be used to power a heating element like this: http://www.sparkfun.com/commerce/product_info.php?products_id=73

    I would need to be able to adjust the power going to the heating element, so the pump would probably be powered separately just to keep things simple.

    (I want the couch on your website)


    Reply 15 years ago on Introduction

    Hi John,

    A few thoughts:
    1) Sure, you can make a 300W version with enough/big enough induction coils, but there are much better 'topologies' for such a large SMPS. I would suggest you talk to the helpful people on the Yahoo 'Switchmode' mailing list.
    2)My hot air gun is pretty heavy. I bet it has a transformer coil rather than an SMPS. This would prob. be easier to deal with.
    3) Have you checked the cost of cheap chineese hot air stations? I got mine for only 3x more than the element you link to (about $100). I bet in the end it is cheaper to buy one then put it together, and much safer too. 300 W is a lot of power to provide (in terms of component cost), and you need some heavy duty casing material etc.

    This is the hot air rework station (and soldering iron and smoke extractor) that I bought for around $100 (shop around for better prices then amazon):


    It is the AOYUE 968. This cheap brand is even recommend by sparkfun in their hot air tutorial. I've had mine for almost a year, and I totally love it. The hot air gun is great, but I've really enjoyed having a quality adjustable soldering iron (I used $10 fire starters before this). The smoke extractor saves a bunch of time because I don't have to hold my head away every time nasty smoke rises from the solder and rosin. I believe (have read several times, but not tried) that this iron is compatible with Hakko (expensive/major rework station brand) parts (tips, heating elements, etc).

    As you might divine, I am a fanboi for this tool. It was so cheap, and now i feel not having it was holding me back. I solder QFN on a regular basis without breaking a sweat. Give it some consideration, it was much cheaper than I thought and it will probably last forever for light-medium duty work.


    Reply 15 years ago on Introduction

    Oh yeah, and it has a blue LED. That makes everything cooler!


    15 years ago

    Hello: I wonder if this converter can step up from 12V DC to 300V DC, if so, what is the main component to change? Thanks a lot.


    16 years ago

    Hi Ian Great job on the PS. Having a problem finding R2 & R3, do you have mfg #'s? I'll be building your PIC programer as well. Hope to hear form you. Thanks Charles


    Reply 16 years ago

    R2 is a 470 ohm resistor (standard and common from the r13 resistor range), you should be able to get it anywhere, even radioshack. R3 is a 1k (1000 ohm) linear trimmer resistor (linear potentiometer). This is also super common. It has three legs and looks like a plastic screw. You can substitute other values as well, but I find 1000ohms to give good range and acceptable fine adjustment (see the spreadsheet to estimate the voltage range with different feedback resistors). I just use a single turn pot, though many recomend a multi-turn pot for fine tuning. I've don't think its worth it - the single turn is so cheap (0.10 vs ~2.00 for a good multi-turn). In the dozens of SMPS I've made, I've never had a problem setting the right voltage with a single turn pot. Good luck! Ian