Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Arduino Based Weather Station


Gina

Recommended Posts

Here is a copy of the current Gray code wheel and the optical sensor array.  The code wheel will want changing to have a small center hole.  I will have to redesign it anyway as the original design is on a deceased computer.  No problem.  See page 9 of this thread for more info on these parts.

Encoder 03.pngPosition of optical sensors 01.png

Link to comment
Share on other sites

The slotted optical sensors I'm using are ITR9606-F.  Off current is 100nA, on voltage with 2mA collector current is 0.4v.  Emitter diode current 20mA and volt drop 1.2v to 1.5v.  I will probably connect all 4 in series and run directly from the 13.8v supply with a series resistor (about 470 ohms).  The photo-transistor works well with 2mA which at 5v indicates a minimum resistance of 2.5K.  An Arduino analogue input has an internal 22k pull-up resistor available so these would work well with direct connection to the Arduino.

Alternatively, it may be possible to connect directly to an RPi.  There aren't enough spare GPIO pins on the ASC RPi so it would need another.  INDI can use more than one RPi I've read.  So the weather station could be combined with the ASC and all the data read by KStars/Ekos though I don't know yet how I would log the data.  May be simpler to stick to the Arduino or perhaps to connect the Arduino to RPi via USB.

Edited by Gina
Link to comment
Share on other sites

It's looking like I may use two Arduinos in the weather station - the current one that has the logging feature with temperature, humidity and pressure sensors and a separate one (or RPi) for wind and light measurements.  The light measurement requires an ADC so either 1-wire or analogue input and that means an Arduino although I gather the RPi will do 1-wire.  This matter still needs plenty of thinking about :D 

External temperature and humidity will use my Stevenson Screen attached to the north wall of the observatory.  Not sure yet where I shall put the rain gauge.  Met Office recommend about 2ft off the ground in an open area though commercial weather stations often have them on the mast high up.  I can't see that the height would make much difference though I can see that a clear area free from wind turbulence probably would.  I'm thinking maybe mounted on the mast just above the observatory roof.  It used to be where the observatory is now.  Or it could be a feature of my new garden :D  Probably want a rain gauge before I do my garden though!

Edited by Gina
Link to comment
Share on other sites

I used one of these in my RPi based weather station.  I also used the owfs file system to provide the connectivity to the 1-wire sensors. It just presents all the sensors as a virtual file system mounted on your RPi's file system. You can then access them directly via a script/program on the RPi itself or connect remotely to the RPi from another system running owfs (RPi, PC etc).

I have an RPi in my external weather station box which also has a WiFi dongle attached. This connects to my house WiFi system. I also have another RPi  indoors pulling values back every 15s over the network. This RPi also runs a small database and web site for viewing the data.

 

  • Thanks 1
Link to comment
Share on other sites

Aha!  So you have an RPi based weather station :)  Do you have details please, by any chance?  No point in reinventing the wheel just for the sake of it :D  I've used the OWFS file system in the past and had a fully fledged web based weather station display using Python.  That was quite some time ago.  I've bought stuff from Sheepwalk Electronics in the past.

Edited by Gina
Link to comment
Share on other sites

I dont have a complete set of documentation but I have files that describes how to set up the weather server (outdoors) and weather station (indoors) so they connect to via Wifi. It assumes you will be using the Sheepwalk RPI2 module and a Wifi Dongle. See attached txt files

wserver1 is the outdoor RPi

wstation is the indoor RPi

In theory you can have wserver2, wserver3 etc etc all connected to a single wstation. The sensors on each all get merged into a single file system on wstation. All you need to know is the 1-wire ID of all your sensors in order to query them.

wserver1 RPi build.txt

wstation RPi build.txt

  • Thanks 1
Link to comment
Share on other sites

Thank you for those files :)  I'll study them carefully :D

I have RPi 3s with built-in Wi-Fi.  I have a 13.8v supply in my observatory always available (unless I disconnect it) with battery backup.  I run a cable up inside the mast to my ASC and use a buck converter to provide 5.1v for the RPi.  I'm now planning to mount ASC and some of the WS on the same mast.

What height/placing do you have the wind vane, anemometer, temp/humidity sensor and rain gauge?

Link to comment
Share on other sites

Pics of my weather station.

RPi on left, buck converter at top. 12V is supplied from PSU in shed about 5m away.

IMG_20160829_185824.jpg

IMG_20160829_185943.jpg

AAG device is air pressure, PCB above is rain gauge, and wing speed/direction.

IMG_20160829_190107.jpg

IMG_20160829_190307.jpg

Home made Stephenson screen from plastic party dishes :D

IMG_20160829_190434.jpg

IMG_20160829_191102.jpg

Inside is a device measuring air temperature & humidity

IMG_20160829_191407.jpg

IMG_20160829_191620.jpg

IMG_20160829_191743.jpg

IMG_20160829_191942.jpg

Rainwise rain gauge. Measures 0.01" per tip. Had to import this from USA so wasn't cheap.

IMG_20160829_192304.jpg

Close up of RPi showing Sheepwalk 1-wire interface and WiFi dongle.

IMG_20160829_192457.jpg

IMG_20160829_192603.jpg

IMG_20160829_192717.jpg

IMG_20160829_192830.jpg

Edited by tekkydave
Added comments
  • Thanks 1
Link to comment
Share on other sites

For my mast I have a 5m long 44mm OD and 37mm ID aluminium pipe and to go inside that a 2.5m long 35mm OD aluminium pipe.  Probably have 1.5m inside the outer pipe and 2m above giving a total mast height of 7m though I might have a foot or so in the ground to discharge static electricity in a thunder storm.  Might rethink the top and provide a discharge spike.

Link to comment
Share on other sites

My mast started out as a 20ft telescopic mast which I had on the side of the house and projecting just above the roof line. It proved a pain for maintenance though so when I re-vamped the weather station I just used the top few sections and mounted it on the corner of the pergola (also self-designed & built :) ).

  • Like 1
Link to comment
Share on other sites

Ah yes, maintenance - good point!!  Mast will just have to stand on the ground or else have a piece of pipe with a pivot on the top so that I can lower the mast for maintenance.  Hmm...  Lots to think about!  I might rethink having the mast 7m high.  5m of 44mm pipe plus 2.5m of 35mm pipe might take a lot of putting up and taking down and then there's the gear as well.  As I remember with the 6.5m WS mast I used to "plant" it on the ground against the fence post, go to the top end and "walk" it up.  Finally securing it to the post with a huge Jubilee clip.  Guess I shall do something similar with the new mast with some sort of "boot" to take the bottom.

Link to comment
Share on other sites

I've found the box with nearly all the weather station bits in, including the complete anemometer and the 1-wire circuit board.  Oh and the Arduino Uno with data logger shield - that's with RTC and logger SD card slot, with temp/humidity sensor and pressure sensors attached.  It has a two pin connector for 1-wire.  I also has the saucepan lid and wind vane which I won't be using now.  Now I wonder where I saw that 6" diameter aluminium disc when I was clearing up :D

  • Like 1
Link to comment
Share on other sites

Found it :)  It was with my other aluminium sheet and plate :D  Fancy that - signs of organisation :D  Bit bigger than I thought - nearer 7" actually 180mm diameter and 3mm thick which is thicker than the saucepan lid and the magnet works better with it than the lid with a spacing of 1-2mm.  Progress :)

Link to comment
Share on other sites

Been through my component drawers and can't find the slotted optical sensors :(  Came across a digital encoder switch as used for setting menu options in electronic devices.  16 per revolution but they need some torque to operate.  Maybe insignificant with a decent size wind vane or might just stop rotation in a very light breeze.  I also don't know now reliable they would be.  They are not designed for continuous waggling like you'd get with a wind vane.  But it does give me an idea for an alternative encoder for the wind vane.  These switches work the same way as computer mice and many other optical encoders - split phase - two optical sensors spaced apart. 

This is a "relative" motion encoder as opposed to the Gray code wheel I have been using and I'm wondering if I can rely on getting no errors.  It sounds rather unlikely.  The code wheel would have 8 slots with optical sensors spaced 1/16 revolution apart.  The encoder only switches one sensor at a time like the Gray system.  The problem with this is that any errors could accumulate and lead to a wrong direction reading.

Edited by Gina
Link to comment
Share on other sites

Couldn't find the slotted optical sensors in any of my component drawers so I've ordered some more.  Not the same but Amazon Prime and due Tuesday.  3.2mm (1/8") gap.  10 Pcs 4 Pins 1/8" Gap Slotted Optical Switch HY870-L w Bracket   £5.31 for 10 units.  I bought the last packet at that price/delivery.

Edited by Gina
Link to comment
Share on other sites

I think I might know why some of my magnets work well for magnetic damping and some don't.  The ones that work well have both poles towards the aluminium disc with more magnetic flux going through the disc.  The others have poles on opposite faces and having one pole towards the disc and one away means a lower flux through the disc, other things being equal.  Another way of damping the wind vane would be to attach an aluminium disc to the axle and have a fixed magnet with N pole one side and S pole on the other.

The diagrams below show the bar magnet and disc, the magnetic lines of force passing through the disc and finally an alternative arrangement of having the disc connected to the wind vane and the magnet fixed.  With this arrangement a good strong magnetic flux passes through the disc and provides excellent damping.

5a2449a2b63db_MagneticDamping02.thumb.png.4069a03d39d9b7468b9ea3b7aefae397.png5a2449904a955_MagneticDamping03.png.816c30fb59c68ce98f1906adb431625d.png5a2449fc99312_MagneticDamping01.png.ecf65cbc1b1e29a0e2d0dc736246b3df.png

  • Like 1
Link to comment
Share on other sites

I would like a smaller aluminium disc.  I've ordered a 103mm one (or rather a pair) but don't know how thick.  Can't find a horseshoe magnet with a small gap.  Could perhaps make one up with a couple of Neodymium magnets and some iron.  OTOH I could use the big cylindrical magnet I used before but fixed, with revolving disc.  As least with a revolving disc the magnet doesn't cause balancing problems.  Of course, if the device is absolutely horizontal there wouldn't be a balance problem but...   Without a magnet on the wind vane arm I can make the arm and vane as a single 3D printed part with just a small counterweight.

I thought I had some smaller aluminium discs and there is still a possibility of them surfacing as I do more clearing up and sorting out.  Something like 120mm diameter and 3mm thick would be good.

Edited by Gina
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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.