Sunday, June 20, 2010

PCB Errata

Design release V0.1.4

 A problem with low voltage cutout has been IDed in the FET driver chip.  More details here:

(Click for larger view)

Design release V0.1.3

(Click for larger view)

Some photos showing corrections:

R6 / R33 moved to bottom of PCB correcting Tx/Rx 


To assemble an Arduino Alternator Regulator, you will need to order the following components:
  • PCB
  • Electronic Parts
  • Heat Sink
  • USB --> TTL adapter board (optional)
  • USB Male – Female extension cable for above
  • ICSP programmer w/6-pin adapter
  • 4x TO-220 Insulated mounting hardware
  • Thermal grease
  • Mounting hardware
    • 4x  #6 x 3/4" pan-head machine screw
    • 4x #6  x 1/4” insulating nylon standoffs

Total cost for all of the above should be will under $100,  and much lower depending on if you implement Bluetooth or not.


I often have a supply of PCBs available, see the right to check that status.  Alternatively you can use the resource tabs above and download the latest GBR files to be used with the PCB fabricator of your choice. (or the CAD files, make mods as you wish and go from there!) When making up the PCBs I use standard thickness and 1oz copper, you can consider upgrading to 2oz copper if you expect to drive high field current (or perhaps two alternators in parallel).  Alternatively, there are open places in the solder mask which can be used to 'reinforce' the field drive traces - just solder on some short wires in those spots to help carry any field current.


For convenience I use for sourcing my parts - to be honest, mostly because they seem to not mind too much (or at least do not complain too much) selling small quantities of parts, and their web page is a bit better then other supply houses when it comes to locating and comparing components.  Under the resource tab 'Parts List' above you will find a .xls sheet with the BOM, I also have places a 'scrubbed BOM' at (as of December 2014) that can be access using this link:

Do note this mouser BOM is for v0.1.4 of the PCB and includes the Bluetooth module.   If you wish to not use the Bluetooth, make sure to check the schematic for part changes - specifically:
  • Do not order the RN-41 Bluetooth module
  • Replace D18 with a 10K resistor
  • Change C19 to a 0.1uF capacitor
 You might also be able to order some of the other needed components from Mouser as well, like a usable heat-sink, the TO-220 mounting hardware, etc.    But then, you might also be able to come up with lower cost sources...

And of course there are other sources than  - nothing magic about anything in the board - do take note the 8Mhz crystal  picked uses 33pf loading caps (it was what was available when I 1st selected parts for this project), if you select a different crystal - make sure to match up the loading caps C13 / C14  to the specs of the crystal.


Perhaps the hardest part to source.  The Arduino Alternator Regulator really does not produce that much heat, but a small amount of thermal capability is needed - mostly on Q1 and U1.  When designing this I selected a heat sink largely for its physical protection.   The part I designed to is a: Hongfa HF92B-120 (   It is designed to support a couple of SSRs (Solid State Relays) and was selected due to its large flat space in the middle.  In fact, the PCB is designed to fit this space with an overall size of  105mm x 55mm.  The problem is this part is a PITA to source - and my experience with the one supplier out of Australia is a little less then positive - esp with regards to shipping costs.  So, here is some additional data for you and some ideas for alternatives:

Heat Displacement of the regulator is documented here:

In most cases, it will be rather modest.  Some ideas for alternatives heat sinks might include:
  • Modify more commonly available heat-sink, removing a fin to get a bit more width if needed.
    • For example:  Orman - Y92B-A150N
    • Wakefield  423K
    • Any Fine Type heat-sink..   Look on Ebay, local supply house, scrap bin
  • Utilize some extruded 'L' shape aluminum stock?
  • A die-cast metal box?
The heat needs of the regulator are rather modest and likely easily solved.  More one want to think about physical protection  (but don't try an all-plastic case, there is some heat carrying needs!)


There is one adapter you will need, and one more you likely will want.  Because a custom boot-loader is needed (a 3.3v opti-boot), you will need to gain access to an ICSP tool.   And ideally a 3.3v capable one.  I use a widely available open-source tool based on the USBasp.  It should be available off of EBay for under $5 or so, make sure you have some way to get to the 6-pin ICSP connector used by the Arduino Alternator Regulator (Either via an adapter board, or just some jumper wires as I use).  There are a few more details involved which I have documented here:

Make sure to note the need to have a good solid 3.3v power source while burning the bootloader - (a USBasp by its self will not be sufficient)  Either hook up the regulator's Enable pin to an external power supply, or you can get sufficient current if you also use the Serial Service Port adapter described next.

The other board which you might find helpful is a USB <--> Serial adapter board.  Once the Bootloader is flashed in you can use this board via the Service Port to load sketches.  It also provided a way to gain access to Serial ASCII string status outputs as well as a way to send ASCII commands to the regulate - if you do not wish to use the Bluetooth module (or wish to 'override' it temperately).  I have designed the regulator to directly connect with certain 6-pin adapters - and I selected those adapters as they are able to supply 3.3v as well as 5v without any switches or jumpers needed.  In this way, all my projects use the same adapter board and you do not need to worry about setting switches.  Take note this is NOT the same pin-outs as used on the small Arduino boards...

I purchase mine from Ebay for around $2 each using the search string: “CP2102 USB 2.0 to TTL UART Module 6Pin Serial Converter STC Replace FT232” .  If you take care to get one with the pinout of this spec you can directly plug it into the Service Port:
      1. DTR
      2. RXD
      3. TXD
      4. +5V
      5. GND
      6. 3V3

Example of 6-pin adapter with correct pin-outs
(Click on picture for larger view)

Of course other serial adapters can be used (you can even pull the ATmega328 out of an Arduino UNO and use that) - you will just need to match up the pins. You do need to make sure you can get access to the DTR signal, as that is used by the Arduino IDE to reset the uC and allow sketches to be loaded.  Do not confuse this with adapters which have a pin labeled 'reset' or 'rst' - often those pins are used to reset the USB adapter, and will not work with the Arduino IDE without modification.


Finally you will need some mounting hardware.   TO-220 insulating hardware and screw sets.  Mouser has them (e.g.: 534-4724 for a couple buck each), or you can order in bulk - myself I again look to Ebay!   Make sure to get some thermal grease as well.

To mount the regulator to the case / heatsink of your choosing you can use nylon standoff spacers that match the off-set you used when soldering in Q1, Q2 and Q4 (the TO-220 parts mounted on the bottom of the PCB).  Used 1/4" - because in the USA 1/4" nylon spacers are easily found.  But of course you can use what you wish.  The 4 mounting holes in the corners of the PCB are 0.120" in diameter (approx 3mm).  I found they are just right to allow taping for a #6 machine screw - a 3.5mm machine screw should work just as well.  I then just ran a machine screw up through the underside of the heatsink, put on a spacer and gently screwed it into the PCB - letting the PCB act as the 'nut'.  If you want you can add threaded nylon spacers to the top of the PCB, screwing onto the protruding stud and perhaps that can hold some type of overall cover.    To see a bit more details on how I mounted my regulator, click here:


See complete documentation "Arduino Alternator Regulator Guide"  under the Reference tab above.

Capture Run Data

After you have things installed and running, consider capture debug data for your own use as well as sending it to me to help improve the core code.  See:  for details on how to do this.



Assembly and Programming


Use the resources in the above tabs to guide you during the assembly of the PCB.    Make sure to refer to the errata for each release (Posted with the schematic above), as well as check out this link for additional hints and details.

Once assembled, you will need to drill mounting holes in the heat sink and using TO-220 insulators screw on the PCB to the heat-sink.

I run a 6-32 tap through the 4x mounting holes on the PCB, and then bring a machine screw up from the bottom of the heat-sink and carefully tighten them using 1/4" spacers between the PCB and the heat sink as shown here:

Showing mounting screws and hardware

 Make sure to also mount the 3.3v regulator on the top side of the PCB (U1) to the side of the heatsink as well.

Loading Bootloader and Firmware

Setting things up.

To install the program, you need to download the Arduino IDE.  Click on the 'Arduino' resource tab above and download the software to your local computer.  Also download the following:
  • Libraries from the Arduino Lib tab, place these in your local lib directory (user/arduino/lib on a windows machine)
  • Source code from Source Code tab.  Place it in your local sketch directory (user/arduino on a windows machine)
  • 3.3v bootloader from the Arduino Lib tab (select the SnartRegBoot folder and follow the instructions in the Readme.txt file).

Once you have done this you can open the arduino IDE.  Then under "Tools/Board" select the 'Smart Regulator (fixed Optiboot - 3.3V, 8 MHz) w/ ATmega328p'. 

 Burning 3.3v bootloader

Before a sketch can be downloaded to the ATmega CPU, the boot loader needs to be installed (if it has not already been done).  TURN OFF ALL THE DIP SWITCHES ON S1!  ( Specifically DIP1, 7 & 8 )  Then following directions here to install the bootloader:

Loading the Firmware

Now you are ready to compile and load the Arduino Alternator Regulator sketch (or program).    Referring to the 'Arduino Alternator Regulator' documentation you downloaded above, read the section titled:  "COMMUNICATING WITH THE ARDUINO ALTERNATOR REGULATOR" on how to connect a 6-pin Serial USB to TTL adapter to the regulator.  You can use other serial adapters, but note the Arduino Alternator Regulator is a 3.3v device so make sure your adapter is compatible.

In the source code you can adjust some of the hardware features, for example:  Define how the Feature_out port should be used  (Lamp, Combiner, Charge Finished, etc).  You can also change any details beyond what is allowed with the ASCII commands.

Note two #define switches: TESTING and DEBUG.  TESTING will run regulator in a simulated mode - allowing bench testing of most new code modifications.   DEBUG will enable additional ASCII status reporting with internal details, see the source for more information on this format.


Hints for loading code using Mac OS X

(Thank you to Terry Slattery for providing these steps)


Install Arduino IDE

  • Downloaded and installed it in Applications.
  • Install the CPU Support files from the 'Arduino Libs' resource tab above
  • Install the Libraries from the 'Arduino Libs' resource tab above.
  • Download latest firmware from the 'Source Code' resource tab above.

Install Silicon Labs CP2102 chip driver

Check what type of USB-Serial device you have - probably by checking the chip on it. It may be a Silicon Labs CP2101, an FTDI, or Prolific PL2303. You may need to load the drivers for whatever chip type you have, so be prepared to do some Internet research to find the appropriate drivers and load them on whatever OS you are using.  (Note:  The suggested USB <--> TTL adapter uses the CP2102 driver chip)

CP2102 drivers for Mac OS X are available from their web site.:

 But the kernel extension wouldn’t load. I researched and found this:
Part of the explanation is that the USB cable didn’t work - some are made only for power. When I plugged the USB-Serial adapter directly into the Mac, the kernel extension loaded. (Hint:  make sure the USB extension cable you purchase is a true USB cable, not jsut a power extension cable)

Check with kextstat and look for ‘silabs’ in the output (it should be the near the bottom.)
    148    0 0xffffff7f8359d000 0x6000     0x6000
com.silabs.driver.CP210xVCPDriver (4.1.1) CF83A369-EA70-3E24-B8FE-7351DCF03430
<136 45 4 3>

A serial device was also created in /dev:

  crw-rw-rw-  1 root  wheel   31,  11 Jan  2 16:41 /dev/cu.SLAB_USBtoUART

Compiling the firmware

In the Arduino IDE (v1.6.6), do the following in the GUI:
     Tools->Ports and select the USBtoUART port.
     Tools->Board and select the Smart Regulator Fixed Optiboot board

Connect the USB-Serial board to the Smart Regulator board. I used individual 6-inch jumpers. This allowed me to plug the USB-Serial board directly into my MAC to avoid questions about the USB extension cables I have. A better connection can be made with a ribbon cable. I made up a 12 ft cable using an old Cat 5 cable to extend the serial link to the board from the USB interface. No need to use a USB cable in this case. The cable needs all wires (the DTR line broke at one point and it is the line that tells the board to reset). Also use the 3.3v line to power the board instead of using an external power supply.

Load the Blink sketch into the Arduino IDE. Change the LED port to ‘8’ from ’13’and click on the UpLoad button. It should compile (I had some warnings about deprecated paths). It also stated how much program storage was used. I looked at the LED and it was blinking. To verify it, I changed the timer value and saw that the LED blinks at a different rate.

Start Make sure that the Board and Port are properly set under Tools. Load the  SmartRegulator code file (I have several - orig, debug, and another).  Then click on Upload to load it.

Loaded the Smart Regulator code. No problems there. I then used ZTerm to connect to the SLAB_USBtoUART port and immediately saw alternator status messages (AST) from the smart regulator. It resets itself on a timeout if it doesn’t see a battery voltage on VBatt+ and VBatt-. I jumpered VBatt+ to Enable and connected a small 12v battery for initial testing. Temp sensors are connected and they change as I heat and cool them with my hand.

Hardware Design Overview

(Last edited April 15, 2014)

The following describes the major subsections of this Ametel / Arduino alternator regulator.  See the tab above 'schematic' to download a full view .pdf file (or the KiCAD files once I finalize the design).  Much of the design is influenced by the need to cover a wide range of operating voltages, from as low as 8v in the case of a depleted 12v battery, to an extreme of 70v which might occur in some cases when equalizing a 48v battery.  Major subsections are divided into:

  • Power Supply
  • Battery Voltage and Current Sensing
  • Temperature Sensing
  • Other Input and Output
  • Alternator Field Drive
  • Communications
  • Protection

The below represents v0.1.0 of the hardware design.  Before I go to PCB fab  I want to look into simplifying things to a 3.3v only design, but need to research the Arduino programing environment to see if it will allow for that...

Power Supply

The Power Supply has a kind of challenging situation.  Between the wide input voltage range needed, the potentially noisy (electrical) environment, and perhaps warm engine rooms - coming up with a solution took a couple of tries.  The baseline requirements are:

   Vin     = 8v - 70v
   Vout   = 12v @ 1-2mA (Charge Pump feed)
   Vout   = 3.3v  @ 70-100mA

The wide Vin range spans engine starting conditions on a rather weak 12v battery, to equalizing of a 48v battery. Turns out the 70v high point limits the available range of regulators greatly.  Very few can work above 60v...

For this design I selected  a cascaded linear regulator design.

Sequential Linear Regulator covers Vin of 8V to over 70v.

 The BDX53C is rated for Vce of 100v and will do the bulk of power drop and heat dissipation.  It will deliver just over 12v under most conditions, tracking Vbat-2v in very low voltage situations (ala very discharged 12v battery where Vbat = 8v).  To handle potently large power dissipation it is mounted  to the heat-sink in the same way the field FETs are. The resulting 12v is used to both pre-regulate for the 3.3v LDO and to feed the Field FET charge pump.  The 3.3v LDO will also need to be mounted to the heat sink in order to gain a bit more thermal headroom.  If just doing Free Air, keep ambient temperature under 120f. 

Of special note is C22 - the 0.1uF cap across the zener diode.  The thinking here is to take advantage of the Hfe inside Q1, in effect 'amplifying' the noise-cutting ability of C22.  During a noise imunity Spice simulations, adding in C22 cut in half the amount of noise passed through to the LDOs; to less than 5mV noise into the LDOs when presented with 100V of white-noise on Enable!  Noise out of the LDOs was shown at 15uV.  I think this will be a nice and quiet power source, even with massive amounts of noise on the supply feed.   The zener diode D13 is actually part of the protection ckt - see Protection section.

D16 provided reverse voltage protection, while D13 is part of the input over-voltage protection ckts.  (See section on 'Protection' for more details..)

Battery Voltage and Current Sensing

A core function of any alternator regulator is the accurate sensing of battery voltage, it is afterall what is 'regulated' in a voltage regulator!  When I was researching battery voltage sensing for the Integrated Controller and Regulator project I looked at lots of examples, most of which centered around using resistor dividers to bring the 12-17v battery voltage to under 5v and then using the native A/D converts of the Atmel CPU.  This simple and effect way when combined with some software filtering will give reasonable insight into the battery voltage.  But there is a major flaw with this approach:  Resolution...

When regulating the battery voltage I wanted to keep it tight. For example, in a 12v battery we might want to regulate the top voltage within the range of 14.4v and 14.5v, or 100mV (in fact, I actually regulate tighter than that - to a 25mV  range).  If we used a 4:1 ratio voltage divider to pre-scale the battery voltage, this 100mV range is reduced to 25mV when presented to the Atmel A/D converter.  Now, the Atmel A/D converts are 10 bits - or 1024 discrete steps.. Given a range of 0v - 5v, that works out to around 5mV per bit.  So you can see, despite starting with 10 bits of A/D resolution,  once we start to focus on the range of voltage we are interested in we end up only having 2, or maybe 3, bits of usable resolution. That is the issue. Trying to do tight regulation with only a few bits of relevant information. Throw some noise in there and one can see how this is perhaps not the best approach.  And if we extend this divider to cover all the way up to 70v, well we will end up with not even 1 bit of resolution.

One can add op-amps to scale and level shift and after looking at that I went a different way.   TI offers a series of really nice voltage and current sampling devices, ala the INA-220 or INA-226.  These are I2C devices, have great resolution, cover a wide range of voltages, and can even do a lot of the oversampling / averaging themselves!  For this regulator I selected the INA-226 device.  It is natively tolerant to 36v and its 15 bit A/D gives us a 1.25mV resolution per bit!  And they are cheap, under $3 each and in the end less cost then the discrete OpAmps approach.  A pre-scaling resistor divider is still needed to cover the whole voltage range up to Vbat of 70v, using a 2:1 ratio still gives me 2.5mV single bit resolution in VBat measurements.  (Side note:  Another reason for selecting the INA-226 vs the INA-220 was problems I had around using high-impedance resistor divider networks to pre-scale VBat.  The INA-226 has a nominal input impedance of 830K-ohms, vs the  320K of the INA-220.  Making for less of an impact to the accuracy of the divider resistor R4/R10)

A key differentiator of this regulator is the the management of Amps in addition to Voltages.  Primarily to measure the true state of charge of the battery.  The INA226 is also capable of very small differential measurements needed to read our 75mV current shunt.  As with the voltage measurement side I needed to do some pre-scaling work to accommodate amp shunts which might be installed in the + line on 48v systems.  The INA282 does this by changing the differential voltage into a single ended voltage, and then referencing that to ground.   Unfortunately for my purpose it also has a 20x amplifier, so I need to run that through a 20:1 resistor divider to get the voltage back into the 75mV range for the INA-226.  In this case I could have instead directly feed the INA282 into an Atmel A/D converter, but I decided to run it through the INA-226 to take advantage of all the over-sampling capability built into the INA-226.  No need to re-do it in software what is already there for free...

Take note that the reference pins of the INA282 are connected to +3.3v vs. Ground. Doing this sets the 'zero current' point around the 3.3v level and allows the INA282 to pass forward negative currents (that is, currents being drawn out of the battery).  Helpful when looking to decide if we need to exit Float mode..

Temperature Sensing

Battery needs are rather temperature dependent.  Their target voltage can very much depending on the battery temperature so adding a temperature prob is a common and very good idea if one truly wants to treat the batteries right.   It is funny how often commercial regulators make a big deal over temperature adjustments, as for FLA batteries the logic is rather simple:

              setPointVolts += (77-batTemp) * 0.0168 ;

Yup, adjust target voltage up or down 16.8mV for each cell in the battery.. E.g., 6 cells in a 12v battery =  0.1V  for every 1f degree above or below 77f.   So, the code is simple, the challenge is doing the actual measurement    For this design I selected to use NTC 10K thermo probes   Simple and reliable, and this time I did use the built-in Atmel A/D converters:

resistor divider is formed between the nominal 10K temperature probe and the 10K resistors R12 and R15.  C6/C7 do dual functions of forming a low-pass filter to cut out the bulk of noise (any remaining noise is filtered out in software via oversampling), and they also provide a lower-impedance input into the Atmel CPU.   And here is a little side trip:  The Atmel A/Ds is actual one A/D with a switcher at its input.  This switcher can select one of the external ports at a time or a couple of internal points, ala CPU temperature!  Code:  AnalogRead(port#) causes the Arduino libraries to  switch to the requested port and then starting an A/D process.  The A/D does this by taking a snapshot of the input voltage and saving it into a temporary working capacitor.  Then it works from that snapshot capacitor to produce the A/D digital value.  And here is the rub:  If the incoming single has a high impedance it can take too much time to bring this internal snap-show capacitor up to the actual voltage - we have infect created yet another low-pass filter with a long time constant (R*C).   Ref section 24.6.1 in the Atmel datasheet (" Analog Input Circuitry") - where it recommends  Zin be 10K or less.  Truth be told we are likely OK with the nominal 5K impedance, but C6/C7 will make sure we get good stable readings when selecting and doing the A/D conversion.  Plus they filter out a lot of unwanted noise...

R16/R17 and the diodes attempt to give a little protection to the CPU from any voltage spikes, the PTC poly-fuses are there in-case one of the probes is shorted to a battery voltage.  (See Protection section for more info).  Finally, R7/R14 provide a little decoupling from ground of any noise that might be picked up by the NTC leads.

While I was add it, I put in an Alternator temperature probe.  This will be used to pull back the alternators output if it starts getting too warm, and faulting if it gets into the danger area..  (BTW, the code also faults if the battery temperature gets too high, approaching the point of a runaway risk)

Other Input and Output

Feature In/Out and Stator Sampling complete the sensing portion of the design.

The 8-position DIP switch is the primary way the user can configure the regulator, for battery size and type as well as alternator derating options.  These are directly wired to the Atmel CPU where I rely on the internal Pull-up resistors to sense if a switch is open or closed.

Feature-in is brought in via a current limiting resistor R8 and clamped for a safe voltage by D10/D20.  R3 acts as a pull-down in case Feature-in is left unconnected, and also as a pre-scaling divider to help reduce the current D10 needs to conduct, esp in 48v systems.  Feature-out is a simple logic level FET,  R34 makes sure the FET is in an off-state during that time between power-on and when the Atmel CPU get booted.

For the stator sampling I used the same circuit I used on the integrated engine controller and regulator.  R30/D21/D14 again form a limiter / clamper while R30/C18 form a low-pass filter with a knee frequency of 800hz.  Sampling a Stator  allows me to lock-step VBat measurements with a stator pulse, resulting in greater accuracy and consistency of voltage regulator.  It also lets me do a RPM calculation as long as the alternator is charging.  As all I am looking for is to provide an Interrupt signal to the Atmel CPU (interrupting on a rising edge), this circuit works well.   But it has a threshold voltage of around 2.4v.  If one wanted a more sensitive stator sample, doing an op-amp pre-conditioning and edge sensing would allow for stator sensing even during no-field conditions by sampling the small stator waveforms as a result of residual magnetism.

Field Drive

The other core function of an alternator regulator is to drive the Field, and in microprocessor based designs using PWM is common.   I had three primary goals I wanted from the Field Drive:

  1. Support for HIGH drive and LOW drive (P and N-type) alternators
  2. Support for Field Currents up to 20A, allows driving of two or even three alternators in parallel
  3. Support for Field Voltage from 12v to 48v, independent of the rest of the battery / system voltage.

Point #3 is perhaps one of the key differentiators of this regulator vs. anything else available.  It allows you to use say a 12v alternator to charge a 24v battery.  The Field stays 12v, but the battery voltage sensing and such are 24v.    Many people are doing this with great success, ala the LN555 type alternator.  It also allows one to have say a 12v engine driving a proper 48v alternator.  Lots of flexibility.  I had accomplished these goals in my integrated engine controller and regulator by using a large number of stuffing options, but wanted in this design to make it self-adjusting. 

Goal # 1 is meet by using N-type FETS in combination with a floating driver chip combined with a series of external wiring jumpers (A, B, C, D) to configure for HIGH drive or LOW Drive.   The FETs I selected (Q2 and Q4) are good for 100V and 33A each.  Running in parallel we can support massive amounts of field current, and the modest PWM frequency means there is little switching loss, hence little heat.

The FET driver is perhaps the most interesting part.  Using a common floating Boost-driver chip to drive the FETs allowed not only the selection of low cost / high performance N-Channel parts, but also decoupled the FETs from the drive logic level and allowing jumpers A-D to be used to configure for  P or N type fields.  A fly in the ointment with these Bootstrap drivers is they all require some level of PWM frequency be present at the Field PWM signal to drive the internal charge pumps.  This meant I would not be able to push the field to Full Field drive.

I did locate one part, LT1910, that solved this nicely by having a built in oscillator independently drive its charge pump.  I used this in the initial design and it works like magic.  However, it is only good for up to 60v, a bit too low to support a 48v battery system during equalization (which can reach 68v for FLA batteries).   My options were:

  • Use the LT1910 and restrict 48v system to not equalize
  • Use the LT1910 and restrict 48v systems to only equalize with LOW drive Fields
  • Use a different part, allowing flexibility and equalization in 48v deployments, but prevent Full Field...

An additional benefit to the last option is the LT1910 is really an odd-duck.  I was not able to locate ANY other FET driver with its own built-in oscillator, while other driver chips are a dime a dozen.

After thinking about this for a while I decided to build my own charge pump and drive it by a separate PWM signal from the Atmel CPU.  In this way I can develop the needed boost voltage to drive the FETs, while also allowing for full PWM field drive.  I found an interesting approach of configuring a FET (Q6 above) to self-switch, eliminating the need for an inverted PWM driver with all its associated issues of race conditions.  (reference: "A Self-Boost Charge Pump Topology for a Gate Drive High-Side Power Supply" by Park and Jahns.  IEEE March 2005).  Building upon this in operation when Q5 is enabled C12 will charge to around 11v via D9, R19, and D11.  When Q5 turns off, R9 then starts to bleed some of that 11v back to the net named 'Floor'.  This starts Q6 to turn on as we now have the 11v in C12 applied across Q6's Gate-Source (with D11 now blocking the bead-back)..  As Q6 turns on, it pulls the Floor up to the level of the main FETs Source (Vs on U3), pushing C12 up with it via R19.  Resulting in the 'Pump' net to ultimately be sitting 11v above the floor - transferring this charge pump voltage into C11 via D8.  R19 is in place to limit peak surge current, protecting both the FETs and the Diodes.

D1/D5 give flyback protection.


There is a need to communicate with the regulator in order to load its firmware.  This is accomplished by a serial port that can be attached via the Service connector.   I expanded the firmware to take advantage of this communications path to also send out status information for operation as well as debug.  Inbound communications can be used to configure all the feature of the regulator beyond what the DIP switches allow.

In parallel with this TTL level serial port I attached a Bluetooth module configured in the SPP mode (Serial Port Profile).  This does nothing more than provide for a wireless link of the same serial information available via the hardwired serial connector.

The pin header SERVICE pinout matches that of a low cost USB-TTL adapter.  R6/R33 and D15, D17, D19, D22 provide protection to the CPU.  The Bluetooth module U6 is connected to receive serial information via the voltage divider R37/R38 - bringing the 5V levels down to 3.3v.   R28 gives a soft coupling into the transmission side.  The ratio of R28/R6 assure any attached hardwired serial adapter board will have priority in sending data to the CPU, while allowing the Bluetooth modules communications to get through in the case of no attached external module.  R27, C19, D18, along with the internal 10K piull-up inside the RN-41 module make up the coupling of a Reset signal as provided by the external USB--TTL adapter and the Arduino programming environment.  Special note:  The Atmel CPU reset pin is very over voltage tolerant.  D18 is there to protect the RN-41 module, which is not as forgiving.  Note also the dramatic change in C19 with the presence of the internal 10K pull-up in the RN41 module.

Finally, R29/D12 give a way to communicate status and error situations to the user in the case that no external terminal is attached.


Protecting the Atmel CPU from voltages greater then 3.3v falls primarily to the use of relatively high value series resistors backed up by a pair of low-Vf diodes.  R30 + D14/D21 in the Stator input line are a prime example.  (The addition of C18 is really there to filter out noise, though it can provide a small degree of protection from high frequency spikes).  I had tried to use Zenor diodes instead of Diode pairs, but the knee sharpness of low voltage zenors are really bad, and I eventually ended up with massive leakage.  So I went to nice clear dual schottky diodes.

One downside of this (and an advantage of using the zeros) is the Diode to +3.3v introduces noise into our nice and clean Vcc..  This noise / over-voltage is absorbed by the normal 3.3v power usage fo the regulator, and adding extra bypass caps helps.  Another risk is too much 'over-voltage' induced current, more then the board can use, may result in the 3.3v line starting to rise above 3.3v.  Example, if the battery NTC temperature probe made contact with a 48v battery,  D6 would shunt the excess voltage into Vcc (3.3v), but R16 would only limit the amount of current to 203mA, well over the 100mA or so total current draw of the board.  Here is where the large 3.6v Zenor D13 comes into play, to shunt that excess current to ground until one of  the poly fuses can blow.  As with all designs, there are trade offs.  Other approaches using Op Amps, or PNP active shunts, etc would provide a bit more protection, but add costs and PCB board space..  Overall, I think the protection in this regulator will work well for all except if someone truly sets out to let the magic smoke out!  (ala, applying 220v AC likely will be a bad thing).


Software Overview