Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Gina

Beyond the Event Horizon
  • Posts

    45,326
  • Joined

  • Last visited

  • Days Won

    120

Posts posted by Gina

  1. I'm now looking into accessing the 1-wire devices. The DS2423 (counter), DS2450 (4 line ADC) and DS2438 (battery sensor - voltage, current, temperature) are no problem - I've found and installed libraries for them but the DS2413 ( 2 channel switch) is a problem, I can't find any source of a library for this decice for the Arduino. I may have to change my circuitry unless anyone knows where I can fine the DS2413 Arduino library.

    The DS2413 is used to enable the LEDs used when reading the wind vane direction.

  2. Now have the barometer working and logging to SD file :) The module also reads temperature so I've included that too (called Temp2). However the temperature does not seem very accurate being a degree C or so high. The DHC22 is accurate to half a degree so I'll use that and ignore the BMP085 temperature.

    Here are serial display and SD file contents.

    post-13131-0-75767900-1347986979_thumb.ppost-13131-0-72769600-1347986982_thumb.p

  3. Fixed the time - wanted time to be UTC (alias GMT). Changing the clocks for British Summer Time (Daylight Saving Time in the US) in the weather data causes all sorts of problems so all my weather data is going to be in GMT/UTC. Having looked at doing it it code I thought of a much simpler idea :) Simply turned off "Daylight Saving Time" in Win 7 then ran clock setting sketch again. Then put Win 7 clock back to normal. I've added a "Z" to the date/time data to conform with the ISO standard for UTC but might find this isn't wanted.

    post-13131-0-25815100-1347961130_thumb.p

  4. Change of plan... This makes more sense to me :D Sensor & data I/O list :-

    1. Wind Speed - 1-wire - pin 2
    2. Wind Direction - 1-wire - pin 2
    3. Light Level - 1-wire - pin 2
    4. Rainfall - 1-wire - pin 2
    5. Barometric Pressure - I2C - pins A4 & A5
    6. Inside Temperature & Humidity - pin 3
    7. Outside Temperature & Humidity - pin 4
    8. RTC - I2C - pins A4 & A5
    9. SD card CS - pin10
    10. SD card MOSI - pin 11
    11. SD card MISO - pin 12
    12. SD card CLK - pin 13
    13. Red LED - pin 5
    14. Green LED - pin 6
  5. Sensor & data I/O list :-

    1. Wind Speed - 1-wire - pin 4
    2. Wind Direction - 1-wire - pin 4
    3. Light Level - 1-wire - pin 4
    4. Rainfall - 1-wire - pin 4
    5. Barometric Pressure - I2C - pins A4 & A5
    6. Inside Temperature & Humidity - pin 5
    7. Outside Temperature & Humidity - pin 6
    8. RTC - I2C - pins A4 & A5
    9. SD card CS - pin10
    10. SD card MOSI - pin 11
    11. SD card MISO - pin 12
    12. SD card CLK - pin 13
    13. Red LED - pin 2
    14. Green LED - pin 3

    That leaves Digital pins 5 to 9 and Analog A0 to A3 free ATM. This is using the data logger sield but not the Ethernet ATM - I'll look into that later.

  6. It's alright - got the answer. It's a bus like 1-wire with device IDs but using 2 wires instead of 1. It's also much more limited for range - just a metre they say whereas the 1-wire bus will go hundreds of metres.

    So I can run both the RTC and pressure devices off the A4 & A5 pins. The I2C can be used for communication between 2 Arduinos - that could be useful.

    Looks like I should have sufficient I/O on the Arduino Uno.

  7. Now I'm looking at the sensors - how many and which pins they require. Everything 1-wire goes on one single digital pin, which takes care of wind speed & direction, light level and rain gauge. Temperature/humidity can use DHT22 and one pin but for both indoor and outdoor, that's two. Then we come to the barometric pressure for which I'm thinking of the BMP085 breakout board :- http://www.ebay.co.u...=item4ab97f69cc

    This uses I2C and and Analog pins 4 & 5. Now the data logger shield also uses I2C and pins A4 & A5. Is it possible to run more than one I2C device off the one bus?

  8. Code for logging date/time to SD card file :-


    // fetch the time
    now = RTC.now();
    // log time
    logfile.print(now.year(), DEC);
    logfile.print("-");
    logfile.print(now.month(), DEC);
    logfile.print("-");
    logfile.print(now.day(), DEC);
    logfile.print("T");
    logfile.print(now.hour(), DEC);
    logfile.print(":");
    logfile.print(now.minute(), DEC);
    logfile.print(":");
    logfile.print(now.second(), DEC);
  9. Sorting out the RTC reading (and setting) and the data logging code.

    The data logging shield uses the Dallas DS1307 RTC chip which uses I2C and Analog pins 4 & 5 to talk to the Arduino. Info on this and more is on the appropriate web page :- http://www.ladyada.n...shield/rtc.html

    This provides links to the required library and how to install it plus code to set the clock and read the time.

    Setting the time is simply :-


    RTC.adjust(DateTime(__DATE__, __TIME__));

    which takes the time from the computer on compilation and writes it to the RTC when it's run.

    Reading the clock is just as simple :-


    DateTime now = RTC.now();

    Serial.print(now.year(), DEC);
    Serial.print('-');
    Serial.print(now.month(), DEC);
    Serial.print('-');
    Serial.print(now.day(), DEC);
    Serial.print('T');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);

    Serial.println();

    This shows displaying the RTC time on the computer but the logging to SD file works similarly. I have converted the code to use the ISO standard (up to the seconds).

  10. Some amendments to the data format :-

    1. Date/time - yyyy-mm-dd hh:mm:ss
    2. Wind speed gust - dd.d
    3. Wind speed average - dd.d
    4. Current Wind Direction - dd (0 - 15)
    5. Predonimant Wind Direction (average over a period) - dd (0 - 15)
    6. Light Level - ddd
    7. Outside Temperature - dd.d
    8. Outside Humidity - dd
    9. Rainfall - ddd
    10. Atmospheric Pressure - dddd
    11. Inside Temperature - dd.d
    12. Inside Humidity - dd

    The "Inside" temperature and humidity will be for the obsy, scope room or warm room, as that is where I plan to install the weather station main unit (with Arduino).

  11. Given the time, I would like to set up some sort of brokering system on a central computer with all this sort of data being passed through it such that other applications can say "I'm interested in data of type X" and when a data item of that type arrives it gets passed to that application as well as being stored in a database. The aim eventually being to add bits of automation software that can do different things based on the data that various sensors are collecting or the actions that other applications are taking.

    James

    You run Linux don't you James? That's an ideal OS to do what you want :)
  12. Currently, my weather station software doesn't broadcast the indoor temperature and humidity as to my thinking it isn't of any interest to anyone outside the house. But I may take the temperature and humidity values in the scope room or warm room depending on where I put the unit.

  13. To reduce the data logging rate I might do some data processing anyway. Many data values change very slowly while some such as wind speed can change quite quickly. I might, for instance, take the wind speed and calculate average and gust values. I might average wind direction to even out what's left of the short-term variations.

  14. Thoughts so far on the data format (as CSV file - maybe one file per day) :-

    1. Record number (index)
    2. Date/time - yyyy/mm/dd hh:mm:ss
    3. Wind speed - dd.d
    4. Wind Direction - LLL (N ENE NE etc.)
    5. Light Level - ddd
    6. Outside Temperature - dd.d
    7. Outside Humidity - dd
    8. Rainfall - ddd
    9. Atmospheric Pressure - dddd
    10. Inside Temperature - dd.d
    11. Inside Humidity - dd

    That is the basic raw data. If I make it FO compatible I may do some data processing to make the data into the same format. Things like wind gust and wind average speed, rain in last period and total rain, atmospheric pressure and pressure trend...

  15. I'm working out some details of the data format and logging interval and such like. The new station will be able to hold far more data than the FO station. The FO logger can hold 4080 entries or lines. With 10m logging interval that represents about a fortnight's worth of data - with 1m interval it's only a couple of days. I can't remember how many bytes it uses per record but it would be something like a hundred or so making the FO data memory around half a megabyte. Now I shall be using gigabytes of data storage in either SD or micro SD cards. The data logger shield takes SD cards and I have 8 and 16GB cards on hand and the Ethernet shield takes micro SD cards. I have 2GB micro SD cards. Even the 2GB card is 8,000 times the FO memory! So my memory will take several years of data :)

  16. Yes, 10m high isn't practical. You need planning permission to erect a mast of that height if it has guy wires to hold it up. An unguyed mast doesn't as long as it isn't too high - I forget how high ATM. I currently have a 6.5m high unsupported mast carrying my Maplin anemometer and wind vane. The 1-wire one was 5m high supported on the corner of the goat shed with it's bottom end about 2m above ground level. The 6.5m mast will be replaced when I get round to it as it is a slight obstruction to the NE for my scope - though only once have I been imaging in that direction. That was erected long before I built my obsy.

    I think I'll give up on the Maplin/FO weather station once I get my new home made station up and running. The FO station is not very reliable and there have been all sorts of interference problems, particularly from a nearby electric fence. I've added all sorts of extra circuits and screening to attempt to reduce this with some success but I still get occasional huge spikes in the temperature data. The wind instruments stop sending data every so often for no reason that I can determine. I've not had any real problems with the radio link from the Tx unit, but then again it's a fairly short distance with line-of-sight propagation path (through a window).

    I'm currently planning to use wired comms rather than the radio link used in the FO and other commercial weather stations. That means there are no problems with making everything as low power as possible. However, another Arduino project I have in hand does use radio comms and transmitter in a handheld remote control and that will need minimal power for the battery powered handset. Experience with this project could rub off onto the weather station project and I might be able to produce a "wireless weather station" later on.

  17. That's avery good point James :D I've copied the Fine Offset (versions sold by many companies including Maplin) commercially made anemometer dimensions and their conversion factor. Calibration depends on many factors including height of anemometer and surrounding obstructions. Standard MET Office figures are for a height of 10m in a clear area of ground (as in the middle of a field). In the domestic environment these perfect conditions are rarely met and a compromise has to be made. This generally results in a lower wind speed reading. By how much is a guess.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.