Andrew Que Sites list Photos
Projects Contact
Main

May 21, 2015

Experiments with Digital Potentiometers

I tried an experiment with some digital potentiometers that unfortunately ended in failure. I have a buck converter with two potentiometers: one for setting output voltage, and the other for setting a current limit. I removed one of the potentiometers and wired in a digital potentiometer. In theory I should be able to control the voltage from an Arduino. The digital pot takes a simple command from an SPI bus to select resistance, and each device consists of two potentiometers.

Initially things seemed to be going well. The digital pot was easy to wire in, and easy to control with the SPI bus. But I was never able to set the buck converter to anything higher than 6.5 VDC no matter how much/little resistance I set. I could go from 0 to 6.5, but everything stopped after this point.

I tried several things, none of which had an effect. The following day at work I asked an electrical engineer what might be the problem. They pointed out something I had overlooked. Digital potentiometers have some kind of analog switch internally in order to switch resistance. Those switches have a maximum voltage—VCC plus a little extra. Over this voltage, they would not work correctly and the resistance skewed. A quick look at the data sheet and this was clearly my issue. At 5 volts, this device could not handle the input voltages. My converter could have voltages up to 20 volts. They do make a digital pot that can use voltages in this range. Should I continue this route, I may have to pick one up.

May 20, 2015

Digital Potentiometers

Today I played with what I thought to be a buck-boost converter. Turns out when I bought it I didn't read the description very carefully. It is actually just a buck converter and can only lower voltage. This will not work for my application, but does give me a piece of hardware I won't feel bad if I destroy. What am I going to do with/to it?

In addition to ordering the converter, I also picked up some MCP42100 digital resisters. They allow the resistance to be set over an SPI bus interface. The buck converter I picked up has two potentiometers: one for voltage and one for current. My plan is to replace the potentiometers with the digital equivalent. This should allow me to control voltage and current from the Arduino. A very cheap Arduino controlled variable power supply.

The purpose? The first step is just to see I can make it work. If it does work, I want to do this with a buck-boost converter and turn this setup into a smart battery charger. Used in combination with maximum power point tracking (MPPT) and an optimum charge algorithm for lead-acid batteries, I should be able to make a superior to the one I am using—and hopefully eliminate some of the strange problems with measuring current I have encountered.

Pictured is me at Governor Dodge State Park. Picture by Lisa B.

With replacement hardware in hand, I went about fixing everything I blew up in my last experiment. I'm getting better with my hot air rework station and quickly had an ADS1115 replaced. In addition to destroying all three ADS1115 chips, I also managed to short something that destroyed the Atmel CPU on the I/O shield—for the second time. It too was changed out quickly.

It was time to implement a little current protection to protect my replacement A/D converters. I used precision 100k resisters to both protect the circuit, as well as a 22 μF cap for a producing low-pass filter. I quickly had the setup working on my test Arduino, and everything looked good. Then I moved the setup to the I/O shield. This time when I powered the I/O shield up there was no smoke. But after a lot of frustration, I found I was not reading anything across the shunt resister. This only happened on the I/O shield.

I tried hooking up my bench top power supply to the analog input, and it was reading that just fine. But it refused to read anything on the current resister. Using my multimeter I could see that when I plugged in the current sense into the A/D, the voltage dropped to almost zero. I had a thought and tried disconnecting the Sun Dragon's power from the battery. Sure enough, I began to receive correct current sense readings.

I suspect there is something about how the battery charger is wired into this circuit that is causing the problem. The charger connects all the positives together but switches the negatives for doing it's charge functions. This method of uncommon negatives might be causing me problems. I will have to consult some electrical engineers at work to see if they can shed any light on the problem.

The good news is, nothing exploded this time. The protection offered by the resisters kept whatever strange current loop I have going on from hurting the hardware. So despite not working, progress is being made.

   Went on a hike today at Governor Dodge State Park with a friend.  We started on a trail on the north east side of the park, working our way south.  From a rocky outlook I could see an other area of rock I wanted to see.  I asked if we could get there and she did not know.  So we decided to go for it.  Once close to where I thought the rocks should be, we went off the trail in search of the location.  We tromped through brush and up the side of a hill and eventually found what we had been looking for.  After spending some time admiring the view form this location we started back.  Although we tried, there was no trail to find and we had to fight our way through brush and bushes to get back.  It worked out well, although I did get scratched up from some of the less than friendly shrubs.  I ended up a little sunburned on my arms on face, but it wasn't bad at all.  Should tan up and I should be set for the summer.
Graber Pond

Graber Pond

   Did a 10 mile ride today and decided to seek out some place I had not been before.  Looking at the map I found Graber Pond on the north west side of Middleton.  It would take me through an area I had never been and end up putting me in Pheasant Branch Creek Conservancy for the return trip.  The weather has been quite warm the last several days and aside from some pretty steady winds has been good for riding.
   Traveling in the quite new part of the Middleton Hills neighborhood I found a almost park like setup top one of the highest points.  It has a very clear view to the north and north-north-east.  I am always on the lookout for good high locations for photography, especially if a thunderstorm is moving through.  This isn't the best for that because most of our weather arrives from the west, but should I want to photograph the tail end of the storm this location will work.
   After the ride in the evening I hadn't had enough and went on a hike with Steve up Frederick's Hill at Pheasant Branch Conservancy.  Took a couple of low-light shots from the hill and as we were walking around.
   Started receiving SPAM to an address assigned answers.com.  And not that kind just trying to get you back to their site, the classic pill sales kind.  That says to me this site got hacked and their database stolen.  That's a large site for this kind of accident.

May 13, 2015

Sun Dragon fuse problems

   The Sun Dragon setup keeps blowing fuses during the day, and I'm not sure why. I have 1 amp fuses on the battery, which should be more than enough to handle whatever charge/discharge currents. Even looking at the shut resister for the battery I can see that the instantaneous current is never more than 300 mA.  Today is the 4th time I've lost a fuse.  In addition, I seem to have lost the A/D channel used to measure battery voltage.  This just hasn't been my week for hardware.

May 12, 2015

Understanding my mistakes

   I talked an electrical engineer at work about my A/D setup I destroyed yesterday. It was confirmed that wiring the shut resisters directly to the A/D is a problem because the voltage is far above VCC. The voltage across the shunt resister is only ever a few hundred milliamps. However, the voltage at the shunt resisters is between 12 and 15 volts—far above the 5 volts of VCC. I was shown two options for correcting for this. One involved op amps, and the other a couple resisters. Time to buy some replacement hardware and try again.