High voltage generation from 3.3-5V

This post describes my standard DC-DC HV converter

You know, to power up geiger tubes or photomultipliers there the need of high voltage at very low current drain. How to generate 400, 1000 or more volts from a single 5V supply or better 3,3V? Simple, let’s build a boost converter (Wikipedia). In this post I’ll describe my standard building block, the PWM drived, voltage multiplied boost converter. I’ve used it in many circuits, as notable example please take a look at my HV converter project page.

How does it works? Let’s look at the following picture. In my implementation the active element of the circuit, a N-type mosfet called BSP300, is capable to handle 800V and it only needs a proper PWM waveform generated by an MCU like Atmega328 from an Arduino or STM32F103 or other MCU’s to work.

My boost converter circuit

Briefly speaking, the input supply (5V) “charges” the magnetic field around the inductor L1 when the mosfet Q4 is energized by a positive PWM waveform (5V). The PWM signal is applied on the BSP300 gate. When the PWM signal reach the low state (0V) of it’s duty cycle, the mosfet disrupt the circuit causing the generation of an overvoltage across the inductor leads. Please visit Wikipedia for more info on PWM.

Duty cycle example

This overvoltage is caused by the magnetic field collapsing aroun the inductor. The overvoltage is rectified by a Shottky diode or, in my case by a voltage multiplier network. This voltage multiplier network is formed by D1/D2/D3/D4 and C2/C3/C4 and multiply input voltage by a factor of 4. The voltage multiplier network is a standard Cockcroft-Walton design.

Voltage multiplier basic circuit

At the output of the diode or the network usually you’ll add a capacitor to filter out the voltage ripple and then you have your high voltage ready to be used. The V_ADC output goes to an ADC input of the choosed MCU and makes possible to the MCU to know the output voltage then regulate it varying the PWM waveform duty cycle. The series of R1-R2-R3-R4 forms a 40Mohm resistor. With R5 that is 100kohm, this series of resistors is a voltage divider network. The voltage across R5 is 400 times smaller than the voltage across the complete resistor series. Mathematically Vr5=[Vin/(R1+R2+R3+R4)]*R5 so with 1600Vin you’ll get aprox. 4V. If your MCU runs from 5V and your ADC’s reference voltage is 5V you’ll stay in it’s input range. If you’ll use different reference voltage you’ll need to change the voltage divider ratio.

I’ve found this boost converter components calculator from Adafruit but I’ve found more usefull to use a standard MC34053 calculator and use it’s output inductor value as reference.

Adafruit calculator

How to generate the PWM signal? Take a look at this little “Arduino” code. It’s self explaining and it’s easy to be ported to whatever MCU and language you use.

Some notes about components selection

  • L1 must be a 3.3mH ferrite core inductor with the lowest internal resistance avaiable. It’s value is experimental, I’ve found that my circuit works best with this value. The inductor used is this ELC-11D332F
  • Diodes must be Shottky and rated minimum for 400V reverse voltage. Low leakage current fast recovery type are a must! Suggested model: BYG21M-E3/TR
  • Capacitors of the voltage multiplier must be rated minimum for 400V and they value is 4.7nF.
  • The BSP300 couldn’t be substituted. That mosfet is specifically designed to be drived by a PWM waveform from a MCU and it’s high voltage capability it’s essential. It’s also cheap and easy to found.

Some notes about my Arduino code

  • In this code I’m using A7 ADC pin to sample the generated voltage.
  • Pin 9 is PWM output to the BSP300 gate
  • A2-3-4-5 pins have internal pull up resistor enabled. This four pins are connected to a dip switch to select desired output voltage. The dip switch shorts to ground the selected line, the MCU read it as input.
  • The software calculate the desired output voltage via a simple function “read_jumper()”.
  • I’m also using a custom function called analogWrite16() because this function makes a 3Khz PWM output. The standard Arduino’s analogWrite() barely reach 900Hz frequency.
  • The frequency is very important because changing frequency you’ll need to change the value of the L1 inductor and also the capacitors of the voltage multiplier.
  • The circuit is designed to work at 3Khz.
//MadExp PMT adapter firmware v0.1
//Copyright 2018(C) Papadopol Lucian Ioan
//------------------------------------------------------------------------------
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//------------------------------------------------------------------------------

//Define some pins
const int analogInPin = A7; // Analog input pin

//Voltage conversion constant
const float conversionFactor = 0.00488;

//Global variable
int Output;

//Startup setup code
void setup() {
setupPWM16();

//Jumper pullups
pinMode(A2, INPUT_PULLUP);
pinMode(A3, INPUT_PULLUP);
pinMode(A4, INPUT_PULLUP);
pinMode(A5, INPUT_PULLUP);
}


//Main LOOP
void loop() {

//Reading voltage set point and reading actual converter output voltage
int Setpoint = read_jumper();
int sensorValue = analogRead(analogInPin);
int Input = sensorValue * conversionFactor * 400;

//Some calculation for PWM correction (more voltage? less PWM exc...)
int k = 0 ; //Costante di correzione

if (Input < Setpoint) {
k = (Setpoint - Input) / Input;
Output = Output + 2 + k;
}
if (Input > Setpoint) {
k = (Input - Setpoint) / 10;
Output = Output - 2 - k;
}
analogWrite16(9, Output);

int setpoint_minus_delta = Setpoint - 20;
int setpoint_plus_delta = Setpoint + 20;
if (Input <= setpoint_plus_delta && Input >= setpoint_minus_delta) {
analogWrite(5,255);
analogWrite(6,0);
}
if (Input > setpoint_plus_delta || Input < setpoint_minus_delta) {
analogWrite(6,255);
analogWrite(5,0);
}

}

//PWM @ 16bit resolution! From 0 a 4095 not 0-255 like stupid arduino library!!!
/* Configure digital pins 9 and 10 as 16-bit PWM outputs. */
void setupPWM16() {
DDRB |= _BV(PB1) | _BV(PB2); /* set pins as outputs */
TCCR1A = _BV(COM1A1) | _BV(COM1B1) /* non-inverting PWM */
| _BV(WGM11); /* mode 14: fast PWM, TOP=ICR1 */
TCCR1B = _BV(WGM13) | _BV(WGM12)
| _BV(CS10); /* no prescaling */
ICR1 = 0x0fff; /* TOP counter value 4095 12bit */
}
/* Comments about the setup
Changing ICR1 will effect the amount of bits of resolution.
ICR1 = 0xffff; (65535) 16-bit resolution
ICR1 = 0x7FFF; (32767) 15-bit resolution
ICR1 = 0x3FFF; (16383) 14-bit resolution etc....

Changing the prescaler will effect the frequency of the PWM signal.
Frequency[Hz}=CPU/(ICR1+1) where in this case CPU=16 MHz
16-bit PWM will be>>> 16000000/(65535+1)=244,14Hz
a 12 bit fa 16Mhz/(4095+1)= 3.9Khz
*/
/* 16-bit version of analogWrite(). Works only on pins 9 and 10. */

void analogWrite16(uint8_t pin, uint16_t val)
{
switch (pin) {
case 9: OCR1A = val; break;
case 10: OCR1B = val; break;
}
}

//Read jumper function
int read_jumper() {
int point;
int jumper_presel = 0;
int jumper_state1 = digitalRead(A2);
int jumper_state2 = digitalRead(A3);
int jumper_state3 = digitalRead(A4);
int jumper_state4 = digitalRead(A5);

if (jumper_state1 == 0) {
jumper_presel = jumper_presel + 8;
}
if (jumper_state2 == 0) {
jumper_presel = jumper_presel + 4;
}
if (jumper_state3 == 0) {
jumper_presel = jumper_presel + 2;
}
if (jumper_state4 == 0) {
jumper_presel = jumper_presel + 1;
}

point = (jumper_presel * 50) + 500;
return point;
}

TF530 Amiga accellerator

Surfing the web searching for an Amiga 500 accellerator board, I’ve found a series of youtube videos about the TF530 project. TF530 is a Open Source Amiga 500 accellerator board with IDE interface made and published by Stephen Leary. You must build it by yourself, no one will sell you one, is not a commercial product, it’s kind of open source hardware project.

Characteristics:

  • MC68030 CPU @ 25Mhz
  • FPU MC68882
  • 2Mb fast ram
  • IDE interface

You can find basic information, PCB layout, bill-of-material and software on Stephen’s github account:

https://github.com/terriblefire/tf530

I’ve also made a zip with all the documents files, firmware exc. that I have. You can download it here tf530-master

I’ve ordered the PCB from dirty pcb website the V2. At the moment it’s no more avaiable except that I’ve 9 PCB’s for sale at 5€ each plus shipping. Contact me for info. I found also that the V3 PCB’s is for sale on Seedstudio website.

I’ve also downloaded the zip with the V3 gerbers D_714439_tf530v3

The assembly of the board is not difficult if you have a reworking station. The board uses SMD high pin count chips and soldering without proper equipment could result in a mess. The best think to do will be ordering the PCB plus a methal stencil and use soldering paste/reflow oven. Despite of my suggestions I’ve made mine using a standard soldering iron but is hard to do.

The installation requires, in my V2 PCB case, soldering to wires from the board to the A500 edge connector. Pins are OVR and INT2. The V3 don’t need this. The MC68000 must be removed and the board takes it’s places. You need to solder on the bottom of the tf530 board two rows of pins that will engage into the CPU’s socket.

The last think to do is flashing the CPLD’s with the correct firmware. The XC9572XL-VQ64 CPLD is an hard to find part because is non-rohs part. You can substitute with XC9572XL-VQG64C the rohs version (10€ each!). I’ve used Xilinx jtag programmer.

The jtag chain must be like in this photo. The Amiga must be turned on because the chips needs to be powered.

After programming the CPLD’s you can disconnect your JTAG cables and reset the Amiga.

It works! Now, you can add an HDD to the IDE port. I ve tried to use an IDE/CF adapter but I’ve found all kind of problems with it. In the end I’ve bought an IDE/mini IDE adapter and connected the board with a short piece of standard IDE cable to the adapter+notebook HDD. It works! I’ve also added a “relocator PCB” from Leary that moves the board from under the keyboard to the more free of space top of the case.

And now, how it works? Uhm… terrible!!! Seriously it works terrible with counterfeit games. With some original, some counterfeit and all amiga OS it works great. Simply, the counterfeit games and a lot of games in general are not compatible with this 68030 CPU.

The board itself still suffers from some gliches like freezing keyboard or caps look led blinking randomly but it’s usable. Not that bad for 80€. This is the price I’ve paid for pcbs plus components. And now, the last but not the last, SYSINFO!

Amiga DB23 to SCART cable

I needed an Amiga DB23 to SCART cable. Searching online I’ve found this website Ian Stedman

Thank you Ian for the nice work!

I’ve tryed to follow he’s schematic but at first I don’t understand connection diagram because there is no reference of how pins are numbered. They are viewed from the front or from the back??? I’ve made a try and got it! Below you can see he’s original schematic plus my reference addon.

And this is the final result on a LED tv

5V to 900V step-up converter module

INTRODUCTION

This project response to my need of an universal high voltage power supply to be used with mostly all type of geiger tubes that I have in my collection.

I’ve needed a selectable output voltage between 300V and 900-1000V, low power output, on board pulse counter and maybe a display. All powered by 5V

THE PROJECT

I’ve started the design of this voltage converter scrapping my “Madexp PMT adapter” power supply section. For more info visit www.madexp.com
In that old project I’ve generated 900-1600V out with a single 5V source from USB via a simple TTL variable duty cycle oscillator.
I’ve replaced that oscillator with an Atmega328P MCU so I was capable to add programmable voltage output via 4 bit parallel interface, pulse counting and if I need, an 0.96″ OLED display.
Into this schematic there is a missing 100pF capacitor from pin INT0 to ground. The oled display have also two 1K pull up resistors on I2C lines
On the first prototype I’ve easily reached 1650V of output but into the second (current) production prototype I could not exced 900V because of the insufficent spacing between HV multiplier and the MCU. This is not an issue because  mostly all geiger tubes works with less than 900V.
The board is thinked to be used as a module of a bigger project or stand alone.
As module of a bigger project, you can simply omit the OLED display and connect the 8 pin connetor to your project. The 4 bit parallel interface selects voltage output and the ACK pin goes HIGH when the output voltage selected is reached/stabilized.
If you wish to use the module as stand alone, you can connect the OLED and a geiger on the + and OUT pins, 5V supply from a battery (voltage regulator NOT included) and you can see the voltage, pulses per minute (CPM) and last minute reading on the display. The output voltage is selected by make a soldering bridge on voltage selection jumpers. It permit you to made a pocket size geiger counter with very low effort.
If you wish to made a geiger clicker without display you cold simply connect a little speaker between pin 1 of the 8 pin connector marked as “^” and GND, omit OLED.
The 3 pin output connector have a geiger katode connection marked as “OUT” and also permit you to exclude the pulse counting and conditioning section connecting the powered item directly between HV and GND.

There is also a JTAG connector for uploading new firmware via a USBAsp programmer. During operation the jtag pins 3 and 4 becomes RX/TX uart. Pin 1 is GND.

The voltage selection jumpers are made to select output voltage when the board is used stand-alone. Make a solder bridge according with the table below and you’ll get the corresponding output voltage out.

SOFTWARE

The firmware is in currently developement but it’s already stable, counts pulses, display voltage and also send info like pulses/voltage via UART.

KICKSTARTER

This project was published on Kickstarter and was active for pledges during all the month of September. I’ve realy appreciated the 30 pledges (one was for two boards) received, that made me capable of buy all the tooling needed to build the boards and further inprove their design.

At the moment the boards are travelling around the globe to reach their owners. I’ve send most of them to USA and Australia but also to Japan, Germany, Switzerland, Canada, Spain, Russia, Ireland and UK. I’m very happy about this result. This make me feel like a multi national corporate, it stimulate my hungry for new projects. Thank you again and stay tuned, you’ll see some new crazy project soon!

MANUAL

Here you cand download the board manual complete with schematic MadexpHV manual 0.3

CM108AH USB soundcard on a chip

I’ve found great difficulty to find an application note of this USB soundcard on a chip. I ve decided to share here the info that I’ve found. I’ve made various PCB’s with this chip on it without any trouble so it’s very reliable. NOTE: USB series and pull-up resistors R1/R2 of 22ohm and R3 of 1.5Kohm are absolutely needed. YOU MUST INSERT THIS RESISTORS OR THE CIRCUIT WON’T WORK. L1 and L2 and C3/C4 are not so important, in fact the circuit will work without them but I suggest to be included in your design for EMI filtering.

Headset application note

For example my PMT adapter use this chip in order to sample PMT pulses and connect to PC. Theremino MCA in fact uses the audio codec chip as hi-speed/hi-quality ADC

Schematic V2.0

CM108AH this is the original datasheet

USB-FOB This USB Radio interface uses a CM108AH and there is a full schematic!

MadExp PMT adapter

You can download the Madexp PMT adapter Kickstarter version manual here: manual
UPDATE 18 Feb. 2018 I’ve analyzed my home radioactive background simply leaving the MadExp PMT connected and running for 100 minutes on the table top. The result is this:

UPDATE 10 Feb. 2018
I've completed my first example of MadExp PMT adapter and it's NaI(Ti) probe. 
I'm making some test with it. Three audio samples was recorded with it and are listed below.
This one is my location gamma backround
This is an Am241 alpha emitter capsule from smoke detector
This is the sound of an highly active (15mSievert/h) Pechblende uranium ore

In this video you can see my first PMT test.

How to power and aquire signal of a scintillation probe?

You I need some high voltage and signal conditioning circuit! Inspired by the Theremino PMT project, I’ve decided to build my own customized version of their circuit. http://www.theremino.com/blog/gamma-spectrometry

My project goal is to make an all-in-one photomultiplier tube power supply and audio ADC powered by a single USB cable. The high voltage generator is regulable in the range 700-1500V with a simple trimmer.

Corrent status of the project:

  • Schematic at version 2 (erros corrected)
  • PCB routing ready
  • First batch of PCB’s arrived from chinese manufacturer
  • First complete prototype ready and working
Schematic V2.0

To enlarge the schematic right click on the image and select “Show Image” or download it and zoom with your image viewer.

In order to make the CM108AH working you absolutely need to add the 47 ohm series resistors on USB D+ and D- data lines with a pull-up resistor of 1.5K from the ic’s 3,3V out to D+. I’ve lost a lot of time to understand this simple thing… but not so obvious!

This is the PCB board top layer

With my CNC engraver I’ve made some engravings to the PMT adapter enclousure… as a first test I’ve messed with the cutting deep/speed.

The video below is my first test of the circuit

First test connecting the adapter to my pc soundcard. The program is Theremino MCA, is not calibrated… I need to set each control of the MCA at the right position so I need some time for setting up it.

Testing a camera lens containing thorium
Testing a natural Pichblende sample from a mine situated in northen Italy.

Homebrew a Geiger rate meter

Hi! In order to count pulses generated from Geiger tube when striked by a ray, we need a counter. If we combine a pulse counter with an high voltage supply for the Geiger tube, we have made a rate meter.

This is my inplementation:

Homebrew rate meter for geiger tube

On the left there is the power on/off switch and the BNC female connector where you connect the Geiger probe. In the center the 16×2 LCD display shows on the top line the result Counts Per Minute (CPM) of the… last minute. On the lower left there is a 60 second countdown to show how much time remain to update the CPM line. On the lower right there are the total pulses counted from the last 60 second countdown. It reset each 60 seconds. On the front panel, top right, you can see the voltage selector (400/1000V) to power the tube. The 1Kv position is for photomultiplier tube. The “pulse” RCA connector is used to send the tube pulses, amplified, to a PC soundcard or other devices for future use.

HV main board lower side
HV power supply plus linear regulators and pulse amplifier

 

 

 

 

 

 

 

 

 

 

 

 

 

The HV section is very simple, a single transistor oscillator that drive a CFL lamp transformer from an old LCD display.

The rectified output is leveled by a series of zener diodes and filtered by a C-R-C-R-C network of 10nF@2Kv rating blue disk cap. and 1Mohm 1/4W tru-hole resistor.

HV power supply schematic, CRC filter omitted. 5V supply filter omitted too…

The output noise is down below 4mVpp at 1000V!!! with 80-100Megaohm load. The pulse amplifier is used to reverse the pulse polarity from negative to positive, enlarge it and drive the counter circuit. I’ve copyied it from the Theremino website at the section  Theremino PMT

Pulse amplifier adapted trom Theremino PMT

The counter, finaly, was made by an Arduino nano that drives the LCD and count the pulses incoming on the interrupt pin D2 on the falling side of the pulse. The source code is splitted in various images.

Library initialization, pin definitions
Global variables, custom characters definition
countPulse interupt funcion
Timers and display.