navitron
 
Renewable Energy and Sustainability Forum
UK's most popular Renewable Energy Forum May 25, 2012, 10:59:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address - following recent spam/hack attempts on the forum, all security is set to "high", and "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: UPDATE ON DECC APPLICATION FOR LEAVE TO APPEAL TO THE SUPREME COURT | Yingli Green Energy's PV Module Ranks No.2 in TUV Rheinland Energy Yield Test | Navitron Solar Showers at Glastonbury for Year 5!
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: 1-wire sensor inconsistency  (Read 4734 times)
wookey
Hero Member
*****
Offline Offline

Posts: 2672


WWW
« on: June 12, 2008, 02:29:10 AM »

I've now got my control system working (after a fashion), The design is:

embedded Linux box (balloonboard) connected to IO boards via I2C. There is a pcf8574A which multiplexes 8 Digital IO lines onto I2C and a DS2482-800 which multiplexes 8 1-wire channels onto I2C. One IO channel is used to drive the solar pump via a transsitor and relay (this taxed me a little as the chip drives active-low which required a PNP transistor instead of NPN and a relay operating at the same 5V as the rest of the circuit - took me a while to work that out and find corresponding bits in the shed). Currently there are only 2 sensors - on separate channels, driven down cat 5 UTP ethernet cable. Using 3 wires: one pair for GND and signal, and a third wire for +5v. Each data line has 100R inline.

For software the digital IO is accessed directly via the pcf8574 kernel module so
echo "0" > /sys/bus/i2c/0-0038/write turns the pump on (and all the other channels)
echo "255" > /sys/bus/i2c/0-0038/write turns the pump off.

The 1-wire stuff is driven using owfs via owserver configured to use /dev/i2c-0 for IO.

Control is currently a rather ropey shell script - that's due for brisk improvement.

This was all working quite nicely on a breadboard and I put it onto vero last night/tonight.

However my solar panel sensor now reads a permanent 85C if I read <deviceID>/temperature but a rather more convincing 17C (at 11pm) if I read <deviceID/fasttemp>

The tank sensor reads similar numbers on both these files - i.e. is behaving normally.

Any of you who've played 1-wire before know what the difference between /fasttemp and /temperature is on owfs/18B20? Seen this behaviour before?

Have I manged to cook my sensor already? It has a nominal max of 125C which is obviously a bit feeble for this application, although at least one other person has run a panel using an 1820 for several years ( A thermomax panel so max manifold temp may well be relatively limited). I suspect that a standard thermistor sensor into an A/D port may be more reliable in the long term, but I thought it was worth trying the direct 1-wire approach. I do only have 5 tubes in so far and have left the pump on (almost) permenently for the last 3 days, when I'm not in/fiddling, so really excessive temps seem unlikely.

I'll put some more tubes in once I'm convinced things are working reasonably reliably :-)
Logged

Wookey
Mike N.
Sr. Member
****
Offline Offline

Posts: 357


« Reply #1 on: June 12, 2008, 10:26:28 AM »


However my solar panel sensor now reads a permanent 85C if I read <deviceID>/temperature but a rather more convincing 17C (at 11pm) if I read <deviceID/fasttemp>


Hi Wookey

I have to admit that I don't understand all your techy stuff, but I do recognise the 85 degree figure. We have a string of about 20 1-wire sensors monitoring our system.  We put two sensors in crucial places in case one failed. Although it might be a bit stable door, if you do have to get up there and replace it, it wouldn't hurt to put two up for the extra couple of quid.

The 85 degree figure does seem to be the 'default fault' figure. We've never had a wrong reading that has been anything else than that. We have had two sensors that have thrown off spurious readings of 85 at random. One was replaced and the other is still doing it. I don't know if we are monitoring temp or fast temp, but will ask Geraint. We modified the software so that if a reading of exactly 85 appeared, it is ignored and told to read it again. This seems to have solved the problem in our case but if yours is consistently reporting 85, you might wait some time. Angry

I have a chocolate block on a flying lead so that I can temporarily put a new sensor onto the system and check it. This avoids potential problems due to wiring, interaction with other sensors etc.

Mike
Logged
wyleu
Guest
« Reply #2 on: June 12, 2008, 12:32:45 PM »

I've max'ed out one-wire sensors without obvious damage so I wouldn't worry too much about that.
85 degrees doesn't ring any bells with me. My data logs are all on a machine that hasn't been turned on since it's PSU decided it was best served by moving on to bigger and better things than powering a PC so I can't do much of a trawl at the moment without server surgery that I will get around to real soon now.

I've also stuck several one-wire sensors in critical places as the I know I have at least one sensor in the floor that isn't well, althou' the rest on either side of it function perfectly well.
I also tend to daisy chain cables to sensors as that way you have two electrical paths to devices in the event of the inevitable fault finding. It's very hard to know it the sensors in the panel are alive if you can't put a device beyond them from the point of view of the hub.
Can you get a laptop near to the device and test it using onewire view or OWFS to check it out?
Logged
wookey
Hero Member
*****
Offline Offline

Posts: 2672


WWW
« Reply #3 on: June 13, 2008, 04:01:48 PM »

OK mike, cheers, that's very helpful. 3 days later it is still working just fine reading '/fasttemp' but '/temperature' is jammed on 85. I guess this makes it 'poorly' but still apparently also 'working'. And clearly doubling up sensors (at least) is a good plan. Hmm, Farnell seem to want nearly 3 quid each for them; must be a better source than that.

Wyleu - I like the ideal of sitting on the roof with a laptop reading numbers :-) I really ought to get one of those serial/USB readers, but having made it work the hardcore way without one it seems almost a shame to get one now.
Logged

Wookey
wyleu
Guest
« Reply #4 on: June 13, 2008, 07:29:47 PM »

I would strongly suggest getting one, i's a known good starting point, and as with most projects there can often be moments of complete self doubt where having a known good reference can save you hours. Just think what one good search and replace might do to your source if you accidentally catch a variable in a timing loop for instance.
Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #5 on: June 14, 2008, 08:34:59 AM »

Wookey
I suspect you may have a timing marginality with the convert command.
When I screwed up my PIC controller code and didn't send convert correctly it returned 85 degrees.

According to the man page for OWFS DS18B20 'fasttemp' works in 9 bit mode and 'temperature' in 12 bit.
From the DS18B20 data sheet the conversion time for 9bit is 95 msec while 12 bit is 750 mSec.

Will slowing things down a bit fix it?

Eric
Logged
wookey
Hero Member
*****
Offline Offline

Posts: 2672


WWW
« Reply #6 on: June 14, 2008, 11:15:45 PM »

I would strongly suggest getting one, i's a known good starting point, and as with most projects there can often be moments of complete self doubt where having a known good reference can save you hours.

This is very true, and would have made loads of sense before I built an 12C to 8-channel 1-wire board. But now I have one (2 in fact), I don't really need one of the USB/serial thingies. I did fully intend to buy one but was always slight grumpy at the 20 quid plus price tag and never got round to it. Looks like I'm about to order a load of hobby-boards stuff so I suppose I'll give in and include one. It could well save me 20 quids worth of grief at some point.

eric - right. I worked out the 9-bit/12bit thing (also explaining what temperature11 and temperature10 are :-), eventually. As you say, timing difference seems relevant. I'm relying on owfs to DTRT for all that but I may need to add/remove resistors and check connections on the bus. So far I've only got one sensor on each bus, so it really ought to work...
Logged

Wookey
wyleu
Guest
« Reply #7 on: June 15, 2008, 11:01:41 AM »

Anyone got owfs to run on windows yet? It say's it should but I can't get it to recognize devices?
Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #8 on: June 15, 2008, 06:14:46 PM »

Wyleu,
Take the easy way out and use LogTemp. It worked first time for me with no hassle.
Logged
wyleu
Guest
« Reply #9 on: June 16, 2008, 09:44:55 AM »

OWFS does some really lovely things across networks that make it very much the preferred way to go for this particular punter.
Logged
wyleu
Guest
« Reply #10 on: January 16, 2009, 01:00:08 PM »

Wookey confirmed with regard to 85C. If your quick it's up on http://www.pachube.com/feeds/1266 at Sensor 11

23 <http://195.112.27.196:81/admin/onewire/reading/23226/>     Jan. 11, 2009, 9:59 a.m.     85.0     85.0     Jan. 11, 2009, 10:16 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23418/>     Jan. 11, 2009, 12:15 p.m.     6.75     85.0     Jan. 11, 2009, 12:32 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23490/>     Jan. 11, 2009, 1:06 p.m.     6.8125     85.0     Jan. 11, 2009, 1:23 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23514/>     Jan. 11, 2009, 1:23 p.m.     85.0     85.0     Jan. 11, 2009, 1:40 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23562/>     Jan. 11, 2009, 1:57 p.m.     6.875     85.0     Jan. 11, 2009, 2:14 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23658/>     Jan. 11, 2009, 3:05 p.m.     7.0     85.0     Jan. 11, 2009, 3:22 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23778/>     Jan. 11, 2009, 4:30 p.m.     7.0625     85.0     Jan. 11, 2009, 4:47 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23898/>     Jan. 11, 2009, 5:55 p.m.     7.125     85.0     Jan. 11, 2009, 6:12 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/23946/>     Jan. 11, 2009, 6:29 p.m.     7.1875     85.0     Jan. 11, 2009, 6:46 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24282/>     Jan. 11, 2009, 10:28 p.m.     7.3125     85.0     Jan. 11, 2009, 10:45 p.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24618/>     Jan. 12, 2009, 2:26 a.m.     7.5625     85.0     Jan. 12, 2009, 2:43 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24690/>     Jan. 12, 2009, 3:17 a.m.     7.5625     85.0     Jan. 12, 2009, 3:34 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24738/>     Jan. 12, 2009, 3:51 a.m.     7.6875     85.0     Jan. 12, 2009, 4:08 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24762/>     Jan. 12, 2009, 4:08 a.m.     85.0     85.0     Jan. 12, 2009, 4:25 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24786/>     Jan. 12, 2009, 4:25 a.m.     85.0     85.0     Jan. 12, 2009, 4:42 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24834/>     Jan. 12, 2009, 4:59 a.m.     8.1875     85.0     Jan. 12, 2009, 5:16 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/24882/>     Jan. 12, 2009, 5:33 a.m.     8.5     85.0     Jan. 12, 2009, 5:50 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25002/>     Jan. 12, 2009, 6:58 a.m.     9.25     85.0     Jan. 12, 2009, 7:15 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25050/>     Jan. 12, 2009, 7:32 a.m.     9.5625     85.0     Jan. 12, 2009, 7:49 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25122/>     Jan. 12, 2009, 8:23 a.m.     9.9375     85.0     Jan. 12, 2009, 8:40 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25146/>     Jan. 12, 2009, 8:40 a.m.     85.0     85.0     Jan. 12, 2009, 8:57 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25170/>     Jan. 12, 2009, 8:57 a.m.     85.0     85.0     Jan. 12, 2009, 9:14 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25194/>     Jan. 12, 2009, 9:14 a.m.     85.0     85.0     Jan. 12, 2009, 9:31 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25218/>     Jan. 12, 2009, 9:31 a.m.     85.0     85.0     Jan. 12, 2009, 9:48 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25266/>     Jan. 12, 2009, 10:05 a.m.     10.5     85.0     Jan. 12, 2009, 10:22 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/25338/>     Jan. 12, 2009, 10:56 a.m.     11.0     85.0     Jan. 12, 2009, 11:13 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/29394/>     Jan. 14, 2009, 10:53 a.m.     11.4375     85.0     Jan. 14, 2009, 11:10 a.m.
23 <http://195.112.27.196:81/admin/onewire/reading/31746/>     Jan. 15, 2009, 2:41 p.m.     12.375     85.0     Jan. 15, 2009, 2:58 p.m.

Logged
sunshinekid
Full Member
***
Offline Offline

Posts: 162



« Reply #11 on: February 07, 2009, 09:08:28 AM »

I agree with ericw - there's probably a timing issue with reset or convert.  The default temperature from the DS1820 is 85 degrees and you get this if the device was not reset properly or the CONVERT_T command was not received correctly or you've read too quickly before the first CONVERT_T has executed.  The simple fix may be to play with the pull-up resistor - I ended up using a 1K resistor with a  20m network.  I think the old resistor was 4.7K but this gave CRC (data) errors at high temperatures.  Dropping to 1K fixed this.

I guess the cause of this was that my network was 'right on the edge' of giving errors and a hot sensor tipped this over.

The manual for the DS1820 is here:

http://pdfserv.maxim-ic.com/en/ds/DS18S20.pdf

Best of luck

Steve
Logged

If you know what you're doing, you're not learning anything.
wdh
Full Member
***
Offline Offline

Posts: 151


« Reply #12 on: February 07, 2009, 11:33:30 AM »

... Currently there are only 2 sensors - on separate channels, driven down cat 5 UTP ethernet cable. Using 3 wires: one pair for GND and signal, and a third wire for +5v. Each data line has 100R inline.

...

This was all working quite nicely on a breadboard and I put it onto vero last night/tonight.

However my solar panel sensor now reads a permanent 85C if I read <deviceID>/temperature but a rather more convincing 17C (at 11pm) if I read <deviceID/fasttemp>

... Seen this behaviour before?

Have I manged to cook my sensor already? ...

85C seems to be the standard reply you get when the sensor module hasn't done its stuff properly.

There seem to be three common causes
- not allowing enough time before readout to do the conversion (yes, I think the actual time may vary with the temperature being measured) - this seems to be a particular (but easily fixed) problem with diy low-level and hence fast (eg Arduino) software.
- assorted power issues causing the sensor to reset before the conversion is finished - this seems to be the common problem when running off 'parasitic power' - and yes, noted that you say you are supplying 5v - and with parasitic power there seems to be an effect involving the on-sensor capacitor that provides the juice for the conversion processing whereby the capacitor 'leaks' faster at higher temps, causing the sensor to read fine at low temps and then suddenly jump to 85C. Even if there is 5v, is there enough current? Can you check the voltage during a conversion? Would some extra capacitance at the sensor help?
- or maybe the sensor was really cooked. Perhaps seeing excessive temperature during soldering. Was it a very low wattage 'electronics-type' iron?
Logged
sunshinekid
Full Member
***
Offline Offline

Posts: 162



« Reply #13 on: February 07, 2009, 03:18:41 PM »

I took a peek in the data sheet and here's the power-up 85C setting.

Cheers

Steve


* DS1820powerupstate.GIF (24.35 KB, 626x492 - viewed 538 times.)
Logged

If you know what you're doing, you're not learning anything.
wdh
Full Member
***
Offline Offline

Posts: 151


« Reply #14 on: February 07, 2009, 09:25:42 PM »

I took a peek in the data sheet and here's the power-up 85C setting.
...
Its 85 after a reset (as well as power-up!)
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!