Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Observatory Environment Instrumentation


Gina

Recommended Posts

In addition to measuring how high the water rises in the hole underneath my observatory, I also want to display and record such things as temperature and humidity both in the scope room and outside plus sky condition and if it's raining.  May be nice to know how the warm room is faring too.  Also, highly relevant to observatory wellbeing is wind and rainfall.  This means a weather station effectively but it's more than the usual weather station reads and records/displays.  Most weather stations measure wind speed and direction, outside temperature and humidity, indoor temperature and humidity plus rainfall and atmospheric pressure.  I want more thermometers and humidity sensors and other things.

All these sensors are in or around the observatory and the data needs transmitting to the house where a wall display will show current conditions and a computer with data processing software to accumulate data and send it to a weather website over the internet.  The only other data weather sites show is the atmospheric pressure and trends in this can give some idea of weather to come (very roughly).  This can be measured anywhere and indoors is as good a place as anywhere.

I have decided to transmit water level data using the 1-wire bus which not only has a range of up to 100m but also allows multiple sensor devices on the one bus.  Connection is by CAT5 ethernet cable using just one twisted pair out of the four.  The Arduino has the 1-wire bus master built in using the 1-wire library and appropriate libraries for the various devices.  Hence, it makes sense if I can also use 1-wire for all the other sensors.

The wind instruments will be on a 6m mast to the side of the observatory and I already have a 1-wire design for these.  The outdoor sensors will be in a mini Stevenson Screen attached to the north side of the building.

Here is a list of data measurements I would like :-

  1. Wind speed
  2. Wind direction
  3. Outside temperature
  4. Outside humidity
  5. Scope room temperature
  6. Scope room humidity
  7. Warm room temperature
  8. Warm room humidity
  9. Rainfall
  10. Water level under building
  11. Rain sensor
  12. Sky sensor
  13. Outside light level
  14. Atmospheric pressure but this can be measured indoors and doesn't need transmitting from the observatory.
Link to comment
Share on other sites

  • Replies 77
  • Created
  • Last Reply

Of the list above 1, 2, 9 and 13 use 1-wire devices.  3-8 are 3 DHT22s and 6 data values.  I think the rain and sky sensors may be binary but need to look that up.

I could use the same method as for the water level sensor for each of the data values and use DS2450 quad a/d converter chips (if they're still available - several 1-wire devices have been discontinued :()  Temperature and humidity are slowly changing values if taken individually.

Link to comment
Share on other sites

A bit later...  OMG :(  Yet another 1-wire device that Maxim have discontinued and provided NO replacement :(  This is ridiculous !!!!  Very soon there wil be none left :(

Maxim are still producing a few 1-wire devices it seems but few are available in the UK at sensible prices.  I'm now looking into the DS2408 8 bit PIO chip - seems these can be interfaced to a microprocessor which presumably could be an Arduino.  Datasheet here.

post-13131-0-41396300-1452537792_thumb.j

Link to comment
Share on other sites

Amazing - I've actually found them available from a UK supplier - RS  Components - just over a fiver inc. VAT with free next working day delivery :)  I've ordered two and also a couple of PCBs to convert SOIC16 to DIP.

Link to comment
Share on other sites

I've been thinking how to use the DS2408 for data collection from an Arduino. 

The PIO pins on the DS2408 can be programed as either input for reading data or output as an address to feed to the Arduino.  So we can have any arrangemnet of address and data lines out of the 8.  The RSTZ pin can be programmed as a data strobe to tell the Arduino to send the data corresponding to the address.  Thus for instance one DS2408 could have 4 data and 4 address lines and select one of 16 data values each of 4 bits.  Alternatively the PIO pins could be assigned as 3 address and 5 data pins giving 8 data values of 5 bits ie. 32 levels.  But 32 levels is not enough for our purpose.  However, there is nothing to prevent the use of two (or more) DS2408s on the 1-wire bus providing 16 PIO lines which may be assigned to either input (data) or output (address) so we could read 16 12bit data values for instance. 

Another idea would be to use one PIO line as a synchronisation bit and read the data from the Arduino sequentially.  With one DS2408, this would permit a 7 bit data width with 128 levels.  This is enough for alphanumeric data and binary data values could be translated into BCD strings.  Using serial BCD data transmission the amount of data that can be read is only limited by the speed of the DS2408 and the rate at which data needs to be read.

To implement transmission of BCD serial data, the RSTZ strobe signal would tell the Arduino that the DS2408 is ready, with output on one line and ready to receive data input on the other 7 lines.  The strobe line would probably use an interrupt so that the data is almost immediately available.  If the sync bit is set the Arduino would reset its pointer to the first data value otherwise it would increment the address and send the next value in the list (array).  The data array would always be in the same order so there is no need for an absolute address.  There will be a delay between the DS2408 sending the strobe and the data being available for the DS2408 to read so an adequate delay would need to be programmed into the master Arduino controlling the 1-wire feed to the DS2408.

Link to comment
Share on other sites

Now I'll take the list and add the data precision requirements :-

  1. Wind speed - 1-wire
  2. Wind direction- 1-wire
  3. Outside temperature - dd.d
  4. Outside humidity - dd.d
  5. Scope room temperature - dd.d
  6. Scope room humidity - dd.d
  7. Warm room temperature - dd.d
  8. Warm room humidity - dd.d
  9. Rainfall - 1-wire
  10. Water level under building - ddd
  11. Rain sensor - don't know
  12. Sky sensor - don't know
  13. Outside light level- 1-wire
  14. Atmospheric pressure but this can be measured indoors and doesn't need transmitting from the observatory.

Not counting the sky and rain sensors, there are 6 values of 3 digits each ie. 18 digits of data altogether.  There is no need to send decimal points as the data ranges are always the same.  Or you could say the temperatures are in tenths of a degree Celcius and the humidity in tenths of a percent.  These parameters change pretty slowly and a reading every second or so is plenty fast enough and easily achievable.  The wind speed and direction can change more rapidly but these are covered directly by separate 1-wire sensors running directly off the 1-wire bus and are not part of the data read by the DS2408.

Link to comment
Share on other sites

Now to look at the number of pins required on the Arduino in the observatory.  The sensors take 3 for the DHT22s and 2 for the water level sensor making 5 altogether.  For the DS2408, one for sync and with BCD, 4 bits of data - another 5, making 10 altogether.  With one preassigned to the on-board LED and 12 digital pins altogether on a Uno or Nano that leaves just one spare. This will cover the temperatures, humidities and water level but not the unit that detects raindrops and clouds.  The latter unit will have to be dealt with separately and, in fact, ties in more with the roof automation than the other environmental data. 

The roof automation will use another Arduino for motor control, limit switches etc. and will use the incidence of raindrops or cloud to park the scope and close the roof - but that's covered in another thread.  Communication with indoors can use another DS2408 for that Arduino too.

Link to comment
Share on other sites

Amazingly, the DS2408 chips I ordered from RS Components yesterday evening have just arrived by Parcel Force :)  Now that's what I call fast delivery :D  But the SOIC16 to DIP PCBs I ordered for them are not due to arrive until Thursday or Friday.  Another handful of Arduino Nanos and micro servo motors have also arrived by RM.  I find it strange that the nanos are half the price of the DS2408 chips - guess that's due to numbers sold - the Nano would be much more popular than 1-wire chips.

Link to comment
Share on other sites

A little voice in the back of my head asked me if I hadn't already got some SMD to DIP adapter boards for my CCTV project so I've looked it up :D  Yes, I did indeed - not only that but some DS2408 chips too plus other components and chips to drive 28BYJ-48 stepper motors.  Two stepper motors driven from the 1-wire bus by a DS2408 etc. - now that's a good idea for the displays perhaps :D

Link to comment
Share on other sites

Sorry to interrupt your monologue... :D :D

I have many DHT22 sensors around the house (part of my home automation project). I also have one in the shed and one in the scope room. The latter 2 have failed rather quickly. Temperature still shows fine but humidity measurements are stuck at 99.9% RH. I googled around a bit and it seems these sensors don't like to be exposed to high-ish humidity for too long.

For outdoor-ish conditions I will now change to BME280 sensors that measure humidity, temperature and barometric pressure. I got a few from here:

http://www.ebay.co.uk/itm/171989456038?_trksid=p2060353.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT

As for the rain sensor, I have tried the cheap £1 ones off ebay like this one:

http://www.ebay.co.uk/itm/1PCS-Rain-Weather-Module-Raindrops-Detection-Sensor-Moduel-Humidity-For-Arduino-/191738654361?hash=item2ca483ae99:g:6TYAAOSwcdBWSGMq

After 2-3 months the sensor PCB looked very corroded. Not very useful and reliable if I want to depend on it to close my roof when it starts raining (once I've finally installed the motor)

After some research I decided to spend a bit more and get an RG-11 optical rain sensor instead.

Link to comment
Share on other sites

Been looking in boxes and surprise surprise I've found some of the parts I had collected for the CCTV system.  10x DS2408, 10x SOIC16 to DIP PCBs, 8x TC4469 quad MOSFET drivers, 9x SIL resistor networks with 8 10K resistors (one end common) in each chip.  Also found a packet of 50 flap topped bright yellow LEDs.  I don't think I'll try tonight in artificial light but tomorrow, in daylight, I think I'll solder a DS2408 onto an adapter PCB and set up a test rig with two Arduinos and 1-wire link and see if I can get data transfer working :)

Link to comment
Share on other sites

Sorry to interrupt your monologue... :D :D

I have many DHT22 sensors around the house (part of my home automation project). I also have one in the shed and one in the scope room. The latter 2 have failed rather quickly. Temperature still shows fine but humidity measurements are stuck at 99.9% RH. I googled around a bit and it seems these sensors don't like to be exposed to high-ish humidity for too long.

For outdoor-ish conditions I will now change to BME280 sensors that measure humidity, temperature and barometric pressure. I got a few from here:

http://www.ebay.co.uk/itm/171989456038?_trksid=p2060353.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT

As for the rain sensor, I have tried the cheap £1 ones off ebay like this one:

http://www.ebay.co.uk/itm/1PCS-Rain-Weather-Module-Raindrops-Detection-Sensor-Moduel-Humidity-For-Arduino-/191738654361?hash=item2ca483ae99:g:6TYAAOSwcdBWSGMq

After 2-3 months the sensor PCB looked very corroded. Not very useful and reliable if I want to depend on it to close my roof when it starts raining (once I've finally installed the motor)

After some research I decided to spend a bit more and get an RG-11 optical rain sensor instead.

Hi Chris,  lovely to "hear" from you again :)  How are you :)

I'll see how the DHT22s go but bear your info in mind - thank you :)  I have a capacitance based raindrop sensor and I'll see how that goes.  I'll post more info about it when I get back to that project.

Link to comment
Share on other sites

Hi Chris,  lovely to "hear" from you again :)  How are you :)

I'm fine, thanks! I haven't been around SGL much recently. I'm rather busy with various projects (I'm sure you know the feeling :D ).

The obsy is up and running but does need further alignment / adjustment. With the weather recently there haven't been many occasions to get everything set up properly.

I've done a bit of imaging when the sky was clear for one night but the results are still a bit disappointing. But with one clear night every 3 months I have, so far, rather started up the camera on the scope instead of doing proper alignment.

Link to comment
Share on other sites

Now to the wiring...  The RSTZ pin on the DS2408 will use the one of the Arduino Nano interrupt inputs.  This has to be pin 2 or 3 as these are the only ones available for interrupt.   All other interconnections (except power and Gnd) can use any Arduino pin but pin 13 connects to the onboard LED so best avoided.  Having to use either pin 2 or 3 is a bit of a nuisance as I was hoping to just wire straight across between units.  But I can turn the DS2408 PCB over and then wire directly :D  I missed a DHT22 off the Circuit Diagram above.

Link to comment
Share on other sites

Other connections :- DS2408 pin 5 to pin 29 Gnd Nano also to Gnd pin on NC-SR04.  DS2408 pin 3 to pin 27 +5v Nano and also to Gnd pin on NC-SR04.  Then there the three DHT22 connections of +5v data and Gnd - oh and the DHT22 data lines need 4K7 pullup resistors. And finally the 1-wire bus connects to DS2408 pin 4 and Gnd.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.