Sandaysoft

Support forum for Cumulus weather station software
It is currently Sun May 26, 2013 7:23 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 74 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: 1-wire info and recommendations
PostPosted: Sun Jan 02, 2011 9:56 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
I've been experimenting with software - running a loop continuously reading a 1-wire chip and reading data. This is just the simple DS18B20 thermometer chip, so no variation in output over a period of just seconds. Tests have shown data gathering to be very fast - a million reads in 5 seconds. But is this actually taking a new temperature reading every 200us? I think not! I think it more likely that it's just reading a buffer.

I increased the loop count in 10x steps until the process took several seconds to complete the count. I ended up doing a million loops reading the temperature and the computer clock in about 5 secs. At every 100,000 counts it prints the count, time and temperature and logs the latter two to a file. This is the terminal output :-
Quote:
gina@AMD64-Mint-9 /mnt $ sudo python ~/Weather-1-wire/ReadTemperature.py 28.6686E0020000 ~/Weather-1-wire/Temperature.txt
100000 2011-01-02 21:10:51 1.125
200000 2011-01-02 21:10:52 1.125
300000 2011-01-02 21:10:52 1.125
400000 2011-01-02 21:10:53 1.125
500000 2011-01-02 21:10:53 1.125
600000 2011-01-02 21:10:54 1.125
700000 2011-01-02 21:10:54 1.125
800000 2011-01-02 21:10:55 1.125
900000 2011-01-02 21:10:55 1.125
1000000 2011-01-02 21:10:56 1.125

ATM the only 1-wire chips I have are DS18B20s and a couple of DS2450 4 channel A/D chips. I have not tried a DS2450 as yet. I think that's the next step - get one working and reading an input signal. I have a waveform generator which covers a large frequency range with sine, square and triangular wave output at 0-5v. That should be ideal for testing this chip. I would think other chips that perform A/D would work at a similar speed.

This testing should tell me if it's feasible to sample the anemometer reed switch at 200 times a second. That gives 5ms to communicate with the chip and process the results. It only needs to increment a software counter for each positive (or negative) transition of the reed switch data. Then the counter can be read at the data logging interval chosen, be it say 10secs for real time dials or 5min for normal plotting.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 04, 2011 4:05 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
malc-c wrote:
Gina, it might be that as it's Sunday and they need to give the exact cost of shipping overseas and can't do so that's why they are not processing international orders. It might be worth trying to place the order on Tuesday when (possibly) the offices are manned
Eureka!!! You're right! :) HobbyBoards international sales is/are working :) I have just ordered 5 DS2423 counter chips @ $8 each = $40 plus just over $5 shipping. PayPal converted the total to just under £30 so that works out at about six quid each. That's not too bad. Probably didn't need that many but better than not enough :lol: And they could run out any time.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Thu Jan 06, 2011 12:34 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
I now have a DS2450 four channel A/D chip wired into the 1-wire network and working. I'm feeding a 0-5v very low frequency sine wave into one input and an attenuated version of it into another. I've added it into the logger app which now logs date, time, temperature and four voltages every 10 seconds. In view of the frequent data collection I've added the date into the data file name so I get a new file for each day. So... records per day = 6x60x24 = 8640. Actually, ATM the logging is a little over 10secs since I'm just using a 10sec pause in the logging loop. I'll change the timing to log at exact time intervals later. The readings from the 5v sine wave input go from nearly zero to nearly 5 in a 3 minute cycle, exactly as expected :)

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Mon Jan 17, 2011 5:45 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
Still waiting fro delivery of counter chips from HobbyBoards (probably in Customs) so I've been thinking... Ouch! :lol:

Many decades ago I was involved in a project requiring a number of simple counters - ICs were in their infancy. I came up with an analogue solution to a digital problem - a diode pump circuit. Now I have another totally unrelated use for it! The idea is to transfer charge from a small capacitor to a larger one. The voltage reached in the larger one is proportional to the number of small charges applied. By adding a "current leak" resistor, the average voltage produced is proportional to the frequency of charges applied. Below is a circuit which takes the closing of a reed switch and pair of diodes to pump charge from one capacitor to another. The application I have in mind is the anemometer.
Attachment:
00-diode-pump-cct-a.png
How it works :-
Parasitic power is obtained from the 1-wire bus in the usual way with Schottky diodes and smoothing capacitor. The anemometer reed switch causes the small capacitor to be charged and discharged alternately. During the charging, current is fed into the reservoir capacitor through a diode from the parasitic 5v supply. The discharge current flows through the other diode and resistor to earth. The resulting voltage across the reservoir capacitor may be measured with a DS2438 1-wire chip (called a Smart Battery Monitor) using the current sense A/D converter. This has a full scale input of 250mV. This relatively small voltage compared with the 5v supply maintains adequate linearity.

Component values may be calculated to give a full scale reading of 100mph or whatever is wanted. Resolution is limited to one charge unit (pulse) = half a revolution or the A/D resolution, which I think is 8 bits (1 in 256). EDIT Checked up - signed 10bit so 1 in 512.

A variation of the circuit could involve removing the leak resistor and discharging the reservoir capacitor after each reading but this would require an extra chip.

Of course, this is a bit more complicated that using a DS2423 counter chip with more components but it beats using a CMOS counter and DS2408 8 bit I/O chip.


You do not have the required permissions to view the files attached to this post.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 18, 2011 1:33 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
Yippee!! My counter chips have been delivered :) I guessed as soon as I'd sorted out an alternative, they'd arrive :lol:

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 18, 2011 1:40 pm 
Offline
User avatar

Joined: Thu Dec 17, 2009 2:03 pm
Posts: 787
Location: Hurstpierpoint, West Sussex, UK
Weather Station: WH1081
Operating System: Windows XP & 7 Pro
Gina wrote:
Yippee!! My counter chips have been delivered :) I guessed as soon as I'd sorted out an alternative, they'd arrive :lol:

Always the case :roll: Hopefully you didn't have anything extra to pay :)

_________________
Neil
Hurstpierpoint Weather

Image


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 18, 2011 4:00 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
No, it would seem not :) The package came airmail. The chips are so small and thin that the package was no more than a slightly thick letter. They're about 3mm square and just over a mm thick. Just been "having fun" soldering fine wires onto the pads and then soldering the wires onto 0.1" stripboard to join the DS2450 A/D and other components.

This is the complete wind sensor circuit.
Attachment:
00-0-new-wind-sensor-cct-final.png
How it works :-
Parasitic power is obtained from the 1-wire bus using the 2 Schottky diodes and electrolytic capacitor. This is used both by the 1-wire chips and the sensor circuit. The anemometer reed switch feeds the DS2423 counter chip with a resistor to aid pull down. The reed switch signal is de-bounced in the chip and the operations counted in a 32bit counter. The wind vane operates 8 reed switches and the 47K resistors encode the result onto the 4 analogue inputs of the DS2450 A/D chip. The resistor arrangement is such that not only are the 8 primary points exclusively encoded but the other 8 in-between points are too, with two adjacent reed switches on at the same time.


You do not have the required permissions to view the files attached to this post.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 18, 2011 4:44 pm 
Offline
User avatar

Joined: Thu Dec 17, 2009 2:03 pm
Posts: 787
Location: Hurstpierpoint, West Sussex, UK
Weather Station: WH1081
Operating System: Windows XP & 7 Pro
Gina wrote:
How it works :- Parasitic power is obtained from the 1-wire bus using the 2 Schottky diodes and electrolytic capacitor. This is used both by the 1-wire chips and the sensor circuit. The anemometer reed switch feeds the DS2423 counter chip with a resistor to aid pull down. The reed switch signal is de-bounced in the chip and the operations counted in a 32bit counter. The wind vane operates 8 reed switches and the 47K resistors encode the result onto the 4 analogue inputs of the DS2450 A/D chip. The resistor arrangement is such that not only are the 8 primary points exclusively encoded but the other 8 in-between points are too, with two adjacent reed switches on at the same time.


Well that has cleared any confusion I may have had :ugeek: .................. If only I understood it :lol:

Do you think you would be able to feed your wind data into the FO Transmitter or is that just not feasible.

_________________
Neil
Hurstpierpoint Weather

Image


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 18, 2011 5:56 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
nking wrote:
Do you think you would be able to feed your wind data into the FO Transmitter or is that just not feasible.
Yes, you could do. A different resistor network, one for each reed switch could be used and then connected to the FO transmitter. In other words a copy of the circuit used by FO. Some of the resistors FO use are unusual values and of close tolerance. 1% metal oxide resistors should be alright with the odd values made up from two standard values. If you want the values, I can find it in the FO sub-forum (I think) and copy it here.

EDIT :- This is the thread :- http://sandaysoft.com/forum/viewtopic.php?f=13&t=2685

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 18, 2011 8:06 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
Although not really belonging in the "1-wire" thread, here is a diagram showing the resistors needed to feed into the FO transmitter.
Attachment:
0-new-wind-sensor-cct-FO.png
You could get 16K from 15K and 1k in series. Likewise 64K9 from 62K and 2K7 in series to give 64K7 which would be near enough. If you want to use resistors in parallel, you'd use higher values - formula is 1/R = 1/Ra + 1/Rb. Or R = Ra*Rb/(Ra+Rb). Obviously the series arrangement is easier to calculate!


You do not have the required permissions to view the files attached to this post.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 18, 2011 10:36 pm 
Offline
User avatar

Joined: Thu Dec 17, 2009 2:03 pm
Posts: 787
Location: Hurstpierpoint, West Sussex, UK
Weather Station: WH1081
Operating System: Windows XP & 7 Pro
Thanks Gina - yet another project to look forward to..... :)

_________________
Neil
Hurstpierpoint Weather

Image


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Sat Jan 22, 2011 1:36 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
One thing I've discovered in setting up my 1-wire network is that although you can get RJ11 plugs to work with RJ45 sockets, they are too loose a fit for a reliable connection. Think I'll post this in the General Forum too as it applies more widely than just 1-wire.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Tue Jan 25, 2011 9:35 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
Having got my 1-wire network and sensors working and software logging the results, I've found a niggling problem with the DS18B20 temperature sensor. They are prone to an occasional error resulting in a reading of 85C. I guess I shall have to detect this and re-take the reading when it occurs. I'm rather disappointed - I din't expect this sort of thing from a professional component. This is not just a bad sample - I've Googled the problem and found several references to it. There are other 1-wire temperature sensors but they are not as convenient to use and I have bought several DS18B20 chips with the intention of measuring several different temperatures.

So it's not just Fine Offset stations that suffer from temperature spikes!!

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Mon Feb 21, 2011 7:38 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
I now have a working 1-wire circuit for my new wind sensors. It uses the usual reed switch and magnet for the anemometer but optical encoding for the wind vane (I was unable to produce an effective read switch version). I have overcome the need for more current than available parasitically from the 1-wire network by switching the LEDs on only during the reading process. A fairly large electrolytic capacitor supplies the LED current for the short period they are on, being recharged in the off period.
Attachment:
1-wire_vane_optical_gray-11-02-21.png
The anemometer reed switch is connected to a DS2423 counter chip which accumulates counts - 2 per revolution of the anemometer rotor. The count is then read periodically to determine the wind speed (and wind run). Circuitry to remove switch contact bounce is provided within the DS2423 counter chip.

For the wind direction :- A DS2413 dual PIO chip is used to switch the LEDs and the current in the photo-transistors produces a voltage across individual resistors and the 4 voltages are fed into a DS2450 4 channel analogue to digital converter chip. Using analogue sensing allows variation in light levels, sensitivity and opacity of the encoding disc to be allowed for in the software.

Power to the ancillary components, DS2423 counter and DS2450 A/D is provided parasitically from the 1-wire network by a Schottky diode and reservoir capacitor. The latter is made big enough so that the voltage only drops by a couple of tenths of a volt when the LEDs are on. Another Schottky diode is connected across the 1-wire network to trap possible negative going spikes on the line. This is standard procedure to protect the chips.


You do not have the required permissions to view the files attached to this post.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
 Post subject: Re: 1-wire info and recommendations
PostPosted: Mon Feb 21, 2011 9:49 pm 
Offline

Joined: Sat Feb 21, 2009 12:41 pm
Posts: 1859
Location: Devon UK
Weather Station: FO WH1081PC (Maplin)
Operating System: OS X, Linux Mint, Win7 & XP
Here's a better diagram...
Attachment:
1-wire_wind_optical_11-02-21.png


You do not have the required permissions to view the files attached to this post.

_________________
Gina

Sorry, no banner - weather station out of action. Hoping to be up and running with a new home-made one soon.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 74 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group