Possible interference issue when measuring digipot resistance - Page 1
Forum section: electronics / beginners

author: svef
author_rank: Newbie
timestamp: January 09, 2015, 02:22:44 am
content: Hi all,In short I'm trying to emulate a PTC element using a digipot on a raspberry pi and it seems to work quite well until I actually put it to use. I assume I get some sort of interference but I'm not quite sure where to go next to solve my issue.So, the background. I live in Sweden. It is cold in the winter. We need to heat our houses. I have a heat pump that recycles heated indoor air to heat my house. It regulates its output based on a single temperature sensor placed in the air intake of the pump. This doesn't work so well since the air fed to the pump is drawn from places where it is warmer than normal (like my server and network rack, why not reuse that heat).To solve this I want to feed the pump with a more representative overall temperature value. Since I already have a 1wire network in the house to log temperature in different rooms I thought I could use this. Unfortunately the pump doesn't accept external digital input. It does however allow you to connect an external PTC sensor with a nominal resistance of 1kohm at 25°C to use instead of the one built into the pump. Hence I came up with the idea to use a digipot as a rheostat.I already had a PTC element sent by the manufacturer so I analyzed it found that it was linear: T°C*7.288+812=R?. I chose a digipot from Analog Devices, the AD5254BRUZ1. It is a four channel 1kohm digipot with 255 steps resolution. I run all channels in parallel and have an offset resistor so I can set the resistance with good enough precision in the range that is interesting. It is controlled through i2c.I chose to implement the solution using a Raspberry Pi. The reason for the RPi was that I wanted to move the logging of the 1wire net and some other monitoring and control functions into one single unit. I needed 1wire and a serial port so I choose to buy some stackable expansion cards from abelectronics.co.uk. On top of an RPi B+ I have an RTC Pi Plus, a Raspberry Pi Plus adapter kit and a Com Pi. The RTC Pi Plus has a prototype area where I built my circuit and the adapter is just to get the serial port and 1wire port on the Com Pi to face the right direction.The circuit is very simple, it is really just the digipot and an offset resistor. However, since I want to be able to shut down and power off the Pi without having to shut down the heat pump I have a two channel relay that switches between the digipot and a trim pot. The relay turn on is delayed by an RC-circuit and a transistor to allow the digipot to become fully operational on startup before voltage is applied across the inputs. I run the digipot on 5V and the RTC Pi expansion board already has a logic level converter for the I2C bus so I just connect to that.So I've been testing this solution out for a few days now with mixed results. Basically it works as intended until I plug in the 1wire net. Measuring the output resistance with a multimeter shows fairly stable results. The resistance fluctuates about .3ohms. This is the same for both with and without the 1wire net connected. When I connect the heat pump to the circuit I however get different results. Without the 1wire net it seems to work quite well. The temperature measured by the pump fluctuates about .03 degrees. When I plug in the 1wire net into the Pi things start acting up. First the measured temperature drops 2 degrees (which corresponds to about 15 ohm, a drop in resistance I don't see with the multimeter). The measured temperature then also starts going up and down about 0.5-1 degree cyclically with about a 30 second peak to peak.I assume I have some sort of interference going on but I'm not quite sure where to go next. I've been logging the resistance with a multimeter both with and without the 1wire net connected and in both ends of the cable that connects the heat pump to the Pi in another room. I just can't see the issue with the multimeter. I noticed however that when an external sensor is connected to the pump the voltage across the sensor is only about 0.25V. That seems like very little so perhaps the pump is more susceptible to measuring errors by induced currents in the cable. The cable I use is just a standard power cord. Perhaps I should try a different cable and see if I get different results. I do know however that there is all sorts of funky things going on inside the heat pump, like variable frequency drive and small leak currents that requires the pump to have a separate earth fault breaker. Tearing down the heat pump is out of the question though. It is the middle of winter. I need it running.I do have a second issue as well though. A couple of times the digipot has started drinking current like there was no tomorrow, becoming too hot to touch. The only time it happened when I had a multimeter connected to measure current it went from the normal 30-50mA to overload the 200mA range I had set. I figure the most likely culprit is the I2C data input that gets stuck open (or whatever it is called) but I don't quite know how to investigate that either. Quickly cutting the power is the only remedy I have so far.If anyone has any ideas about what I could try next it would be much appreciated.

author: SeanB
author_rank: Super Contributor
timestamp: January 09, 2015, 05:20:22 am
content: The PTC is either referenced to the internal ground rail or the 5V supply inside the inverter. Your best bet is to get an isolated I2C interface and place the digital pot after the isolation barrier, and then power it with it's own 5V supply ( old Nokia charger and a 5V LDO regulator) so that it can float with the heat pump supply.

author: svef
author_rank: Newbie
timestamp: January 09, 2015, 06:44:05 pm
content: Aha! I thought that since the RPi was running on a wall wart it was floating and ground reference shouldn't be a problem so I was a bit confused at first by your statement. At first it seemed like it would just be a more complicated way of achieving the same result. Then It hit me. I have a 1wire switch with power injection on my 1wire line. It seems that when I involve that in the mix the issues start to appear. I think it would be a wise decision to pull out the digipot to a separate power feed and isolate it as you suggest. I will try to do that and see how it goes.Thanks!

author: SeanB
author_rank: Super Contributor
timestamp: January 09, 2015, 07:02:51 pm
content: Check as well polarity of the thermistor supply, as the digital pot will not like being biased to below it's negative rail.Some might pulse the sensor every few seconds as well to keep self heating down.