Tag Archives: E3645A

Temperature Controlled Fan


I’m currently mainly working on my new anemometer design but once in a while I get distracted. For example when my Keysight E3645A lab power supply was making so much noise that I could hardly concentrate. That’s when the idea of this fan controller was born.


Of course, the best temperature controlled fan in the world doesn’t help if you really need the cooling the fan is providing. But very often a small fraction of the cooling would do just fine most of the time. In my case the supply does control the speed of the fan. But it doesn’t seem to measure the temperature at all but seems to calculate the necessary cooling in a worst-case condition. An for a supply that may be rack-mounted together with lots of other heat dissipating gear the worst-case might be quite demanding. But my supply just sits on a shelf at, say, 22 degrees ambiant. And most of the time I’m hardly pulling any current. When working with microcontroller designs it’s rare for me to pull more than a few tens of milliamps. So little cooling is needed most of the time. But the E3645A (this one here does a better job) ran its fan at crazy speeds while the case still had this cold metallic feel to it.  So we can definitely do better.


So the first step was to open the supply and to see what kind of fan it uses and how it is controlled. After beaking some seals and opening the case I found a 60x60x25mm 12V fan of Chinese origin. I also found out that the supply uses linear control. So there’s no PWM or anything but the supply voltage just varies in (I think) four steps from 7.4 to 12 volts. Most surprisingly, this voltage is not ground-referenced but symmetric around ground, i.e. plus/minus 6 volts.


I was pleased to see that the fan connects to the main board by means of a standard two-pin 100mil header. So I could just plug anything in between the board and the fan.


That’s exactly what my first idea was. Stick with the original fan and just put a PWM controller in between. I’ve just recently made some LED dimmers and the technology needed here seemed to be very similar. So Rev A of my fan controller was born.


It’s simple: A linear 5V regulator, a PIC16F18325 microcontroller, an LMT86 temperature sensor and a N-channel mosfet. The PIC chosen here runs at up to 32MHz on an internal oscillator, has an internal voltage reference (of 1.024, 2.048 or 4.096V), six PWM modules and plenty of other nice features while comming in a small 14-pin package. So all I need to do is to measure the temperature, calculate the desired fan speed and set the PWM duty cycle accordingly.


My first surprise came when I first wanted to program the PIC. My trusted Mikroelectronika MikroC for PIC compiler doesn’t know that chip. And neither does my MikroProg programmer. So after a little bit of research I ordered a PICkit3 and downloaded the MPLAB IDE. As a nice side effect I can now also compile code for and program the fancier PICs like the DSPics and PIC32s. I might do that before long.


So I did the necessary programming (and debugging) and attached a small fan. It all worked but I had to chose a quite low PWM frequency in order to make the fan spin at lower duty cycles. And probably as a result of the low PWM frequency the motion of the fan didn’t look or sound very smooth.


With the larger fan from the supply things only got worse. I had to lower the PWM frequency even more into the tens of Hz range so it would spin at all. And even like this I couldn’t get it to run at low duty cycles. Of course, the low frequency caused nasty vibrations so I gave up on this approach. I read online that other people successfully use PWM on their fans but at least this model wasn’t happy to be PWM-dimmed. Does anybody know more about this? Was this an option in the old days before brushless motors were the norm? Is it that brushless motors aren’t unsuitable for this kind of control alltogether or does it depend on the specific model? Please use the comments section below if you can shead some light on this.


But I don’t give up easily so after a bit of research I ordered a four-wire fan conforming to the so-called Intel spec. Besides ground and +12V they have two control lines. A PWM line that lets you control the fan speed by means of a (25kHz nominally) PWM singal. And a so-called TACH singal that allows you to read the current fan speed. The PWM line has internal pull-ups to (depending on the fan) 3.3 or 5 volts so you just need to pull it low. The TACH signal needs an external pull-up resistor and gets pulled low by the fan twice per revolution. So you’re getting a digital signal with a frequency of twice the fan speed.


I ordered a EBM Papst 622/2 HHP which is the right size and somewhat more powerful than the original fan. The new board has a somewhat odd shape so I can use one of the fan’s mounting screws to mount the board as well. Note that all the copper has been removed around the mounting hole. The fan is attached to a heat sink which is grounded while our board runs on a split suply. So ground as our board sees it is not actually ground but a negative voltage so we have to be careful.


The new Rev B design runs on 3.3 volts in order to be compatible with any fan independent of the fan’s internal logic voltage. I’ve also used a different temperature sensor – a classic LM35.


Like the Rev A there is an LED to visually indicate what’s going on. There are also three pins on the microcontroller that are intended to be used as debug pins so I put some vias there to make it easy to connect a scope probe.


Above you get an idea of what the TACH signal looks like. It’s a quite low frequency singal since there are only two pulses per rotation. So the measured 104Hz shown on the screenshot correspond to 3120 RPM.


Having a TACH signal to measure and three debug outputs to worry about made the software development somewhat more involved but it was well worth it. I’ve used the debug pins as follows:

  • Actual (i.e. mesured) fan speed. 100% corresponds to 10000RPM
  • Target fan speed. 100% corresponds to 10000RPM
  • Measured temperature. 100% corresponds to 100 degrees centigrade

So from the duty cycle measured by a scope you can easily read the speeds and temperature.


Of course this is only possible since there are some unused PWM modules left. But as I said, this PIC has 6 of them and only two are needed to measure the fan speed and another to control the fan.


The transfer function from temperature to fan speed can be freely defined in software. In the screenshots above the fan was running at 1500RPM up to a temperature of 30 degrees. Above that the speed would rise linearly until reaching its maximum of 9000RPM at a temperature of 55 degrees.


One could easily implement a PID control if one was so inclined but the slowly chaning nature of the temperature in such a setting makes this largely unnecessary so at least for now only the proportional part is taken into consideration when calculating the PWM frequency.


As you can see, the little board is nicely held in place by one of the fan mouning screws. By the way, the LED blinks roughtly once per second and its duty cycle corresponds to the target fan speed relative to the maximum fan speed of 9000RPM. So if the LED is on one-third of the time the target fan speed is one-third of the maximum speed or 3000RPM.


Unfortunately for my application, the supply senses the current consumed by the fan and shuts down if not enough current flows. This is probably a good idea and prevents the supply from possible damage if the fan is unplugged for example.


I found that it is possible to run the fan at a lower speed without the supply complaining but with fan speeds below about 4000RPM the there were conditions causing an error condition. So I ended up connecting a 1W 150ohms resistor in parallel to keep the supply happy even with the fan running at only 1500RPM.


I believe that my settings are very much on the safe side. At a a temperature of around 50 degrees measured inside the case the airflow matches the one of the original fan at max speed. But needless to say this kind of fiddling voids the warranty and is always done a one’s own risk. The reward is a supply that is now hardly audible and much more pleasant to use.


The zip file contains the eagle files, PDFs and software of both revisions.

Keysight E36103A Lab Power Supply Review

20160310_KeysightE36103__011I don’t usually do reviews but I just got a Keysight E36103A Lab Power Supply today and since it’s a newly released model there’s not much independent information out there so far. At least when I ordered mine 7 weeks ago I was unable to find a single proper review. So I thought I’ll share my first impressions.


Talking of independence: I bought mine through regular retail channels and I am not in any way affiliated with Agilent/Keysight. As mentioned, I just had it for a few hours now so it’s not a thorough review but rather a my first impressions for now. I guess most of you can read a data sheet yourself so I’ll focus on other stuff here.



This is what impresses me most about this supply is its display. It is not large but has a very nice contrast and is very readable from just about any angle. I’ve taken some photos trying to show this. Just click on the thumbnails to enlarge them.

20160310_KeysightE36103__009 20160310_KeysightE36103__008 20160310_KeysightE36103__007 20160310_KeysightE36103__006 20160310_KeysightE36103__012  20160310_KeysightE36103__010

The display is even easy to read from far above or below. I have mine sitting on a shelf above so I really appreciate that. Again some examples:

20160310_KeysightE36103__017 20160310_KeysightE36103__016 20160310_KeysightE36103__015 20160310_KeysightE36103__014 20160310_KeysightE36103__013

What I also like is that now I can see both the set AND actual values for voltage and current at the SAME time. This is something I miss in the E3645A.

Fan Noise

This is a big issue for me but it’s difficult if not impossible to get any useful information from the datasheet. I can’t do sound pressure measurements or anything like that but here’s my impressions. Of course this thing has a fan. A fairly small fan so the fan noise is rather high-pitched compared to other equipment. The fan comes on as soon as the supply is powered on but runs very slow as long as the output is off. It’s still audible but not loud at all. That’s important to me since I  have the supply on with its output off for quite a large proportion of the time. I turn the output on when I need it but don’t want to wait for the startup of the supply, recall the last settings and everything. My Keysight E3645A is a nightmare in that respect. It sounds like a airplane about to take off even with the output off. [2016-04-09: I’ve finally done something about it, see here] Yes, the fan of the E3645A can also vary its speed but its really loud even at the lowest speed and gets worse from there.


As the E3645A, the fan speed seems to depend on output current rather than temperature. When you turn the output on, the fan immediately speeds up quite a bit. When you then pull a fair amout of current the fan speeds up even more. But overall, fan noise is fairly well controlled. I prefer the E36103A’s fan noise at the highest speed to that of the E 3645A’s at its lowest speed setting. I think its not only quieter but I also find it less annoying despite the higher pitch.


But nevertheless, there is a fan and it is clearly audible, especially with the output on. Unfortunately, large heat sinks have gone out of style it seems.

Programming and Readback Accuracy


To me, readback accuracy is even more important than programming accuracy. I don’t care so much if my DUT is running at 3.3 or 3.32 volts but I like to know reliably and precisely what the voltage and current are. Especially when I’m calculating the efficiency of some switching regulator like my MPPT solar charger. I don’t want to set up 4 DMMs for that (and I don’t have 4). So I want reliable readings from the supply.


The datasheet states a readback accuracy of 0.05%+5mV and 0.05%+1mA, respectively. So the voltage readback accuracy is similar to the E3645A (0.05%+2counts) but current readback is much improved (vs. 0.15%+5mA).

Similarly the E36103A features better programming accuracy: 0.05%+7mV (vs. 0.05%+10mV) and especially 0.05%+1mA (vs. 0.2%+10mA).

I should note that the comparison for voltage is not quite fair since the E3645A has a much higher maximum output voltage of 35V and 60V compared to the 20V of the E36103A.


I have quickly hooked up a pair of DMMs to the supply and have found the readings of the DMMs to correspond very well to those of the supply as you can see on the photos.

Small Current Readback Accuracy

This supply has the nice feature of being able to measure very small currents quite precisely. That’s really nice when working with microcontrollers and the like that hardly consume any power when in sleep mode or running at a low clock speed.

I’ve done some tests with the supply connected to a 1% 1 megaohm resistor and an Agilent U1253A DMM that features a similar low current range. I have disconnected the voltage DMM just to be sure it doesn’t affect the measurement.

Since the resistance is 1MOhm we can expect 1uA of current per Volt. So at the maximum output voltage we’ll only draw 20uA. That’s really not much given the specified 0.25%+40uA readback accuracy (up to a maximum of 8mA).

With nothing connected to the output I have observed measurements in the range of 0 to 25uA which is well within spec. When looking at the difference in measured current before and after connecting the 1MOhms resistor, the results are reasonably close to the actual values.

Here are some photos that illustrate that point:


20160310_KeysightE36103__028 20160310_KeysightE36103__029


20160310_KeysightE36103__030 20160310_KeysightE36103__031



All in all I found the small current feature to be very usable (and well within spec). But unlike with currents in the mA to A range, a DMM like the Agilent U1253A performs much better as you can see from the photos.


Package Content


I didn’t check what exactly is suppoed to be in the box but found everything I expected but also nothing more.


Besides the supply itself and a power cord there is a certificate of calibration, a CD with some software as well as some warranty papers.



This is, of course a physically small supply and the datasheet will tell you precisely how large it is. I basically expected it to be half the size of the E3645A (which it technically is) but was surprised how small it was when I took it out of the box.


It doesn’t really show on the photos but it looks even smaller than half the size. I guess that’s because of the rubber padding around the E3645A which the E36103A doesn’t have.



Ethernet and USB connectivity is one of the big selling points for this series of power supplies. I find it surprising how long Agilent got away with RS232 and GPIB. I often control my scope over BenchVue and I’m looking forward to do the same with this supply. I’m also planning to send commands from C# programs in order to do some calibration and things like that.


So far I haven’t tried any of that yet but I’ll definitely share my experience once I got a chance.


Another thing I really like is the sense terminals on the front rather than on the back. I found I don’t use them on the E3645A since it’s just too much of a hassle to attach sense leads to some screw terminal located at the back of the supply.

User Interface


I haven’t even glanced at the user manual but have found everything to be quite intuitive.

The Lock/Unlock feature is nice to prevent you from changing your output voltage/current by accident. A short press of the Lock/Unlock button and the thing is locked. It then takes an a bit longer (maybe half a second or so) press to unlock it again. I like it.


All the (few) menues are straight forward and easy to find/use.

Concluding Remarks

Again, I’ve only had my hands on this thing for a few hours but so far I’m very happy with what I saw and I’m looking forward to using the E36103A as my main lab supply going forward.  It was an impulse buy really. I saw it on sale online for 823 Swiss Francs (USD 835 at the time of writing)  including shipping and taxes and everything and just ordered it from my cell phone on my way to work one day 😉

If you have specific questions please just leave a comment below and I will try to answer it.

Arduino MPPT Solar Charger Shield – Software

There have been two previous posts on this project: one on the concept and the hardware and one on hardware testing. You probably want to check them out first if you’re not yet familiar with this project. Or even better: Click here for an overview over this project.

Maintaining an input voltage of 17 volts even if that means a lower-than-desirable voltage at the output

Now that we know that we have a functioning MPPT solar charger we are ready to talk about the software (or the sketch as the Arduino folks call it). It’s quite simple, really. So this will be a short post. And yes, you can download the sketch. There is a link at the end of this post. As always, I appreciate any feedback, comments and the like.

There is a number of basic tasks the arduino needs to perform in order for this shield to be useful. I’ll go through them one by one.

Controlling the DC-DC converter

At the heart of this project there is a synchronous step-down (or buck) DC-DC converter that is controlled by a PWM signal from the arduino. So one of the tasks is to set the frequency and duty cycle of that PWM signal.

We let the PWM signal run at the maximum frequency the arduino allows with an 8 bit resulution. Thats simply 16MHz (the Arduino’s frequency) divided by 256 (the 8 bit resolution), or 62.5 kHz. So the prescaler will be 1.

As you can see from the shields’s schematic, we need to output the PWM signal from Pin 6 (by the Arduino’s pin numbering, not Atmel’s). In order to do this kind of low-level stuff you’ll have to read the Atmega328’s data sheet. There is usually no Arduino-ish shortcut if you really need to controll what’s going on.

Luckily it’s just a few lines of code to set things up. All in the function buck_setup(). There are three more little functions to control the DC-DC controller once it’s set up:

buck_enable() and buck_disable() are very simple and just turn it on and off, respectively. buck_duty(uint8_t duty) is only slightly more involved. It changes the duty cycle to the value you pass to it. Besides that it ensures that the duty cycle stays within certain limits.

Test setup with resistor-based dummy load

You don’t want it to go to 100% since in order to keep the bootstrap capacitor C6 charged you need a little bit of off-time. In order to drive the upper FET you need a voltage higher than the panel’s voltage and that’s exactly what C6 is for. So we enforce an upper limit on the duty cycle.

Likewise, you don’t want your duty cycle to go below 50% because in that case you would be pumping energy from the battery to the pannel. A synchronous step-down converter is basically the same thing as a synchronous step-up (aka boost) converter with input and output confused. So we also want to enforce a lower limit on the duty cycle.

The upper and lower limits are set through the #defines DUTY_CYCLE_MINIMUM and DUTY_CYCLE_MAXIMUM.

Measuring voltage and current

The shield has all the hardware necessary to measure both voltage and current both at the input as well as on the output. We’ll just need to write some simple software to make good use of that hardware.

Unlike with the PWM singal where we had to do some low-level bit fiddling ourselfs we can just rely on convenient Arduino library functions to do the job. Basically, analogRead() is all we need here.

Nicely regulating so that the input stays at 17 volts

I’ve written a function called read_values() that uses analogRead() to read all 4 values (input voltage, output voltage, input current and output current) 16 times each, averages the results and converts the ADC reading to proper voltages and currents.

The necessary multipliers are defined as floats in VIN_MULTIPLIER, VOUT_MULTIPLIER, IIN_MULTIPLIER and IOUT_MULTIPLIER. I’m doing all the voltage and current measurements in floating math. Yes, this is not at all efficient but we don’t need the Arduino’s computational power for anything else most of the time so this is fine here. Just keep in mind that you can save a lot of resources here if you ever need to do so.

Displaying voltage and current on the LCD

Our hardware also involves a 2 lines x 16 characters LCD so we can show the world what we are measuring. Again, we can rely on standard Arduino functionality to do the job. There is an LCD library that does everything we need.

So my function write_display() can focus entirely on formatting. The upper line shows the voltages in Volts, the lower line shows the currents in Milliamps. The input is on the left hand side of the display, the output on the right.

Deciding what to do

In the first section we’ve discussed the functions necessary to controll the DC-DC converter. But in order to use those functions, the Arduino needs to first decide what to do.

66% duty cycle at 21V input voltage gives the desired 13.8V at the output

This is where the function buck_update() comes into play. You could consider this the heart of this sketch. This is where all the relevant decisions are made. When to turn the converter on, when to turn it off, when to increase the duty cycle, when to decrease it… You get the idea.

The behaviour of buck_update() is controlled by 8 #defines. I list them here together with the values I have used:

#define ENABLE_VOLTAGE 18.0
#define DISABLE_VOLTAGE 15.0
#define INPUT_CURRENT_LIMIT 2000.0

I think they are quite self-explanatory, especially if you look at how they are used inside buck_update. It’s quite simple: If the panel’s voltage rises above 18V, turn the converter on. Once the converter is on, try to archieve a panel voltage of 17V without exceeding 13.9V at the output. If the panel’s voltage drops below 15V turn the converter off again.

At 55% duty cycle with a 16.9V input voltage we’re getting only around 9.2V at the output

Besides that the function is also looking at the input and output current and makes sure certain limits are not exceeded. But with a 30W panel it should never be possible to reach those limits anyway.

Putting it all together

Now all we need to do in the loop() function is calling read_values(), buck_update() and write_display(). Since writing to the LCD is quite slow we are only doing it every 32nd time we read the values and update the PWM signal.

With this sketch I’ve hooked the MPPT Solar Charger up to my lab power supply. (a Keysight E3645A, my newest toy *g*) and my extremely simple but occasionally useful resistor-based dummy load.

The enable and disable voltages are simple and work as expected. Maximum output volage is also not tricky. If the voltage at the output goes too high, the duty cycle is decreased and everything is fine again.

There’s not much to photograph when you’re writing and testing software

More interesting was to see how the shield would regulate when faced with a limited current budget at the input. For that the supply was set to a voltage of 21V (about a 12V solar panel’s open-circuit voltage) with a current limit of 100mA to 500mA. That’s quite a nasty supply, quite a bit trickier to handle than a real solar panel. Try to pull just a bit too much current and the voltage will drop to zero…

Also, the resistors at the output are not a realistic load for the converter. A car battery will pull no current at 12 volts or so (unless overly discharged) but will quickly start to sink large currents when the voltage goes just a bit higher and the battery is charging.

But I think the setup is good enough to test the sketch. And it handles the challenge quite well. With all resistors on (i.e a 100/6 ohms load) and a 300mA current limit, the input voltage sits at 17V (our target input voltage) while 9.25V appear at the output. At 400mA, the output voltage rises to 10.7V with the input still at 17V. At 600mA the input is still at 17V but with the output now at 13.15V. If I take the current limit even higher, the output voltage rises to 13.82V but not any higher, just as we want. The input voltage rises to 21V (since this is a lab supply and not a panel) with a corresponding drop in current to 530mA.

Quite realistic: The charger is pulling as much current as it can with the current limit at 530mA and reaches an output voltage just above 12 volts

I’m honestly quite happy with the project as it is now. The idea definitely works and I’m motivated to design a new, deployable version with some fancy features that will use much less power at the same time. I’ve already done quite some work on that new version but it will take another few weeks until I get to describe that project here.

Until then I will show you some other, smaller projects that I’ve already finished but didn’t have time to document yet. So you will first see a number of smaller, simpler projects over the next few weeks.

Before I forget: There’s the Arduino sketch for download. And click here for an overview over this project.

Update: Now there’s an entirely new design.