I wrote before about selecting a hold capacitor for power source switching. The principle is simple: should the battery voltage from the solar panel setup become too low, the solar powered web server will be able to switch to a Power over Ethernet (PoE) power source using a relay. The power during switching must be seamless so the server doesn't reset during the transition from the battery source to the PoE source. To acomplish this a capacitor is placed on the power supply before the DC/DC converter that allows the stored energy from the capacitor to be used while the relay transition is taking place. The voltage in the capacitor will slowly be depleted until the relay has engaged the alternative power source. Because this capacitor is placed before the DC/DC converter, the 5 volt supply going to the server will never sag as long as the voltage to the DC/DC converter doesn't drop too low.
Now I have parts and I wanted to verify this was going to work. I placed my relay on the breadboard, which wasn't easy because the pin-out was rather strange. But with a little finessing (i.e. pushing hard to bend the pins) I was able to install it on the breadboard (picture). I wired the inputs of the relay to my bench power supply, one running around 8 VDC and the other 12 VDC. Both these voltages are enough to power the DC/DC converter. On the output side of the relay I placed the capacitor—a 220 µF 35 V electrolytic that was more than double what I calculated I would need.
I drove the relay with the fixed 5 VDC power from my bench supply (the first time I have used all the voltages from my supply at once) and watched the voltage of the power in the capacitor on my oscilloscope. Switching the relay I saw the voltage transition, but really no observable sag in power during the transition. I used the setup to run ππ and could see the computer did not notice the power transactions.
According to my oscilloscope, the voltage drop during the relay switch over was 1.32 volts taking just under 2 milliseconds. I would likely not wait for the battery voltage to sag to 8 volts before switching, but even if I did I can live with the observed numbers.
Pictured is the trace of a switch from 8 VDC to 12 VDC. The voltage starts off a steady 8 VDC, but then begins to drop as the relay disengages from the 8 VDC supply and begins to travel to the 12 VDC supply. This lasts roughly 2 ms and the voltage sags from 8.24 volts to 6.92 volts as shown by the horizontal cursors. Then the relay makes contact with the 12 VDC supply and the capacitor begins to charge up. About half way into the charge is an other tiny reversal of voltage. This is the metal contact of the relay bouncing off the 12 VDC side briefly. The charge transitions to the 12 VDC and the switch over is complete. Xiphos found observing the physical side effects of a relay transition evident from an oscilloscope interesting, and on reflection so do I. Having used an oscilloscope regularly in my work for 17 years I sometimes forget just how cool the insights they bring are.
The parts for the monitor circuitry having arrived, it is now time to put the parts to work. First on the list was the current sense circuit. I attempted this once before with poor results. The op amp circuit I was trying to build had a ridiculous amount of gain to work with the 0.01 Ω current sense resister I had. When that failed to function it was time to admit I am suck at designing analog circuits. However, I am pretty good at utilizing my resources, and since I work with several electrical engineers I had help. I was directed to an Analog Devices current sense part, designed to do exactly what it was I wanted to do. This part has a 60x gain meaning I could use a 0.1 Ω sense resister and still have a full voltage range going into the analog to digital (A/D) converter.
There was only one problem with this part: it was only available as a surface mount part—an 8 lead MSOP. These are quite small and don't work on through-hole breadboards. Again EEs to the rescue. I was recommended a small board that converts surface mount parts to through-hole. The trick is you have to be able to attach the surface mount part to the converter board. Today was the day to give it a shot.
My new soldering iron has all the bells and whistles, and with my inspection microscope I felt I had a pretty good chance of attaching this tiny part to the converter board. I initially tried using the hot air rework wand. I could see this was melting the solder, but the solder was not joining to the pins on the part. Thinking I need more solder on the converter board I tried switching to my smallest soldering tip (which is impressively small) and quite easily added more solder. Now I had so much solder I couldn't get the chip to sit on the pads. Since I had pretty good luck with the tinny soldering tip I tried using that which worked great. I quick touch to each pin and the device was cleanly soldered to the converter board. My inspection station allowed me to do all of this work with ease and turning the board to the side allowed me to verify the solder joins were all secure.
With the current sense chip soldered it was time to build a test circuit. I used my breadboard to wire a circuit was a 0.1 Ω sense resister, some 100 Ω load resisters, and the current shunt amplifier. I powered the current shunt amplifier with 5 VDC from my fixed power supply, and used one of the variable sides to run power through the shunt resister and load resisters. I placed my oscilloscope across the shunt resister and on the output of the shunt amplifier. The results were exactly what I expected and the circuit works perfectly.
I will need to make voltage dividers for the higher currents because the gain of the shunt amplifier is so high, but that isn't a problem. This portion of the circuit—the most tricky (if any part is tricky)—is functional.