Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Weather Station - Finally
Page 1 of 3 | |||||
Author | Message | ||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Before you start reading this Sorry it's so “long winded” I spent many many months and hundreds of £’s in components and circuit boards before getting to the stage I am at today. If I knew when I started how much it would cost or how much grief and stress I’d have given up and bought a commercial weather station. It would have been cheaper and worked straight away! However I am now at the stage where I am not 100 % happy to show it off, but I’m happy enough to show it and hope that some others might want to help finish the coding for the display As most of you probably know by now, I had brain surgery 9yrs ago and my brain was so swollen the docs said I’d never recover, but I don’t give up easily and although I have memory problems I’m happy where I am at now I decided to make 2 boards 1: an outdoor board to connect with an anemometer, direction gauge, rain gauge (tipping bucket type) BME280 Temperature, pressure and Humidity sensor and a HC-12 to communicate with the indoor unit It also has a GPS interface, mainly to set the clock on the indoor unit and not have to worry about the time being wrong when BST/GMT/DST time changes happen, as it does it all and only sends the correct local time once every day at 02:01 and when it is first powered up. The anemometer can be any cheap or expensive one, mine has 3 switches for each 360° rotation The code tells you how to work out how to use any anemometer. The direction control is a simple wind gauge connected to a 360° variable resistor (pot) This one has no end stop, and the direction is worked out simply by measuring the resistance. The rain gauge is a tipping bucket one – I used a Maplin one because I saw it on Ebay cheap, but any can be made and you can find instructions for making them online – details of changes to use other ones are in the code. I’m quite happy with the outdoor code, I’ve had it working for a few months just going to a console output so I can monitor it. It sends the following to the Indoor unit every 3 minutes at the moment, although I may change this to every 3 minutes during daylight hours and 15 minutes at night (OR anyone can change any of the code if they can do it better or see changed that will be useful) The indoor unit is much harder I started off with a board I made myself to fit on the back of a 7” ssd1963 display but after about 6 or 7 boards I gave up I kept making silly little mistakes on the circuit layout and a lot of these where getting the txd and rxd from the communication modules wrong – a result of my brain not being able to get it right! In the end I started again with a new design that connects to the 40 pin header on the E100 board. This leaves the 2 mikro board spaces free for other use. The board has the following on it. 40 pin connector to connect to the E100 5 pin socket for a HC-12 TX/RX unit to communicate with the outdoor unit 2 X 11 pin sockets where an Adafruit 2133 Audi FX board plugs in 1 X 10 pin socket where an Adafruit 1522 2.1W Audio amplifier board 1 pushbutton (used for flashing the ESP8266) 1 4k7 resistor 1 8 pin socket (esp8266) 1 ESP8266 wifi (with EspBasic installed) 1 DHT22 Temp/Humidity module The audio board is so when the display is finished, the Big Ben clock used on the display will actually chime the ¼ ½ ¾ and hour chimes and it has the hour “gong” on it as well All the files are in the zip file as well as all the pictures The ESP 8266 collects todays weather and the weather for the next 3 days I got it to collect todays as well in case Anyone wanted to just use the Indoor board WITHOUT having their own weather station sensors outside The HC-12 communicates with the outdoor unit and receives the following ready to display Day/date, time, temperature, pressure, humidity, wind heading in degrees, windspeed in MPH (easily changed to Kph if wanted) Wind gust, highest wind gust, mm rain, mm rain yesterday, highest temperature since 06:00 Highest temp yesterday, lowest temp since 06:00, lowest temp yesterday, UV index and battery voltage AT THE MOMENT the code for the indoor unit only shows the clock, indoor temp and humidity It has “gauges” (pictures) to show the Wind speed, Pressure, Average Speed, Humidity and Wind direction. THIS DOES NOT WORK AT THE MOMENT AS I CAN’T FIGURE OUT HOW TO GET THE GAUGES WORKING – I’M NOT good enough with coding!!! Ideally I’d love the gauges to be written with software and not use the “bad” pictures I’m using at the moment It also shows the correct weather icon for "today" and the indoor and outdoor "top right of the display" very dirty code but just to show it working. It’s set up so that if the screen is pressed it will go to “Page 2” (this did work fine with my board, but for some reason the touch doesn't work now - to be investigated later) Page 2 is set up to show the screen split into 3 sections Tomorrow, the day after and the day after that too and it gets the information from the ESP8266 on COM 2 The information received from the internet is the following: "Today," Weather description, the weather icon for today (TO DISPLAY ON SCREEN 1)temperature, pressure, Wind speed, Wind direction and humidity. Tomorrow, description, min_temp, max_temp, pressure, humidity, wind speed and direction Day 2, description, min_temp, max_temp, pressure, humidity, wind speed and direction Day 3, description, min_temp, max_temp, pressure, humidity, wind speed and direction This would all show on the 2nd page of the display when it is touched and after a set period of time go back to “Page 1) or when the screen it touched again. I have 7 “Outdoor Boards” and 10 “E100 (indoor) boards left If ANYONE wants one for FREE I’ll be happy to post it to you, all I need is a name and address, message me with it . I’ve done the hard bit and got it all working, it just needs “refining”. I am under no illusion, I do not know enough about coding to finish that to a stage that people would be proud of, but I’m HOPING there are a couple of you who might be willing to help finish it. Pictures, circuits and code below Outdoor unit 2016-12-03_215625_Outdoor_circuit.pdf Indoor unit (E100 unit) 2016-12-03_215714_Indoor_E100_circuit.pdf 2016-12-03_222356_Code_and_Files.zip Any question please ask - although you all know a lot more than I do about Micromite and programming EDIT: Forgot to say I'm powering the outdoor board with 4 X 18650 protected batteries in series so it provides 3.7V and they are charged with a 12V solar panel with a 5V regulator on the output lead from the solar panel EDIT 2: Many thanks to WhiteWizzard who spent many hours and hundreds of what must have been annoying emails from me, he soldered the boards for me because my hands and eyes wont let me solder smd components |
||||
disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 844 |
Now there would be not much fun in that and you would not learn too much. It's been great to watch this develop and see someone put all the bits and pieces to use. Congratulations. Regards Gerry Latest F4 Latest H7 |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5923 |
Well done. But you do realise that it's like building your own house - you never really finish. Jim VK7JH MMedit  MMBasic Help |
||||
RonnS Senior Member Joined: 16/07/2015 Location: GermanyPosts: 120 |
hi lew, A challenging work, well done,thank you for sharing your experiences with us Ron |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
You should be proud of what you've achieved Lew. This was not a small project by any means and I read your posts and enjoyed the 'journey' too as Gerry did. Phil (WhiteWizzard) should be congratulated too (as you have already done)for the extended help he gave you. I think we all knew there was a strong element of therapy in you doing this so the idea of going out and buying a finished product was never going to achieve that; you were testing yourself and that's commendable. I think Jim's point about 'never really finishing the house' is right on - keep enjoying and improving the project. There's plenty of work in it yet for you and every gain should be satisfying. Greg |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
I have 4 Outdoor boards and 7 E100 boards that I will send free of charge to anyone anywhere in the world As I said above, the only stipulation is you help "tidy up" the code and get the indoor display working properly so it looks a lot better than it does (and get the touch for the forecast working properly too) Edit: If you want a board, please say which one you want - the Outdoor pcb, the Indoor one, or both Thanks |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
I have 3 Outdoor boards and 6 E100 boards available |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
For anyone wanting to make the outdoor board and have your own weather station You can buy ready made anemometer/rain and wind direction gauges Like THIS one Or do like I did and buy a 2nd hand one off Ebay or elsewhere OR make your own, there are loads of sites online showing you how to make them Here are just a few Instructions on how to make an anemometer with reed switch How to make a "tipping bucket" rain guage DIY Wind Vane instructions Have a go - it's fun :) |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Just to clarify - the boards I am sending out to people free of charge are JUST the pcb boards, The outdoor unit uses Surface mount components, and the indoor Explore 100 board uses just one "normal" resistor and the rest of the components are just header sockets The parts list for the outdoor unit is: Micromite 28 pin 3.3V regulator I used MIC2940A-3.3BU but any with the same pinout and around 1A will do (the circuit uses a lot less than 1A but I prefer to have a vreg that won't get hot in use which is why I use this one) BME 280 sensor SI1145 sensor GPS unit (9600 baud) 2 x sms led's 1 X 47uf Elec cap 1206 1 X 47uF tant cap 1205 1 X 0.47uf cap 1206 2 X 100nF cap 1206 1 X HDT22 OR DS18B20 (I used a DHT22 although you don't need this as the BME280 already measures these) 2 X 2n3906 transistors 5 X 10K res 1206 1 X 10K res 1210 3 X 4K7 res 1206 2 X 680 ohm res 1206 Reset switch B3F-100 (or similar) 1 X 28 pin dil socket for the micromite 1 X 5 pin socket 2.54mm pin spacing 1 X 7 pin socket 2.54mm pin spacing 2 X 4 pin socket 2.54mm pin spacing 1 x 3 pin pin socket 2.54mm pin spacing 1 X 5 PIN header pins 2.54mm pin spacing (icsp pins) 3 X 2 pin screw terminals 3.50mm in spacing 1 X 1 pin screw terminal 3.50mm in spacing |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Updated software for the outdoor unit I changed the code so you don't need the DHT22 as the BME280 measures that data already I also changed it so it sends the weather data indoors once every 3 minutes from 07:00 to 21:00 and every 15 minutes from 9pm to 7am This will reduce the power used from the battery during the night when the battery isn't being charged Also modified so it now sends the correct LOCAL time and date to the indoor unit upon getting a successful GPS connect - so the indoor clock can be updated with the local time accurate to milliseconds 2016-12-05_112157_Ourdoor_1.02.zip |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
The .ppm files to use with the clock are below If anyone wants the sound files for the big ben chime send me a message with your email and I'll send them to you - they are too big to upload here 2016-12-06_081513_ppm.zip 2016-12-06_081530_ppm1.zip 2016-12-06_081548_ppm2.zip Here's where someone can "hopefully" help When the outdoor unit decodes the correct local time from the gps unit it sends this string to the indoor unit Print #2,"Time""," and then the time When it sends normal data updates it starts the string of data with this Print #2,"START"," and then the data What I need help with is how to tell the indoor unit that when it receives "Time" as the first string received from Com 2 to go to a subroutine where I can set the MM clock and When it receives "START" as the first string to go to a different subroutine where it sorts and prints the data What I have at the moment is this code Open "COM1:19200" As #1 'Open port for HC-12 TX/RX OPEN "COM2:9600" AS #2 'Open port for ESP8266 IF LOC(#1) > 0 THEN SERIAL1 'If data in COM1 then GOSUB Serial1 END IF IF LOC(#2) > 0 THEN SERIAL2 'If data in Com1 then GOSUB Serial1 END IF Anyone able to help? Also while the "Time" coming from the outdoor unit is in the correct format I can simply use Time$ = LINE2$ and this sets the clock to the right time What I need to do is set the RTC to the correct time and date The format the outdoor unit sends is this Line2$ is the time i the format 09:04:04 Any idea how to get line2 to update the RTC? Updated 1.03 code for the outdoor unit - corrected the GPS code, it wasn't doing the GMT/BST/DST conversion properly 2016-12-06_091553_1.03.zip |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
The Explore 100 board just has one 4K7 resistor (normal sized NOT surface mount) and 1 ESP8266 module programmed with ESPBasic to make it work as a weather station It doesn't "need" the outdoor board to have a weather station with this, it pulls the weather off the internet every few minutes to update the display You can have it updating every 15 seconds if you want The rest of the components are just header sockets. |
||||
panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1099 |
Lew, Couple of questions re the serial in issue above, Does the Print #2 etc etc string end in a CR LF? Are the quotes you show actually there? One way to determine if the string contains Time or Start would be to determine what position in the input string the word Time occurs (above it appears to be positions 11 through 14 or 15) then use the MID$ function eg. IF MID$(input-from-8266$,11,4) = "Time" THEN Time-Sub ELSEIF MID$(input-from-8266$,11,5) = "Start" THEN Start-Sub ENDIF Regarding the RTC question, RTC SETTIME is the command to set the RTC to whatever time you decide. The only issue is that it requires the full date/time info so you would have to create some dummy variables that have the date info unless that is also available from the 8266. If the 8266 can transfer all the date/time info, you could scan the input string and read that into variables rtc-yy, rtc-mm, rtc-dd,rtc-hh,rtc-mi,rtc-ss then use those as arguments for the RTC SETTIME command. Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
This is the exact string the outdoor unit sends once it has the correct local time Print #2,"Time" , "," , Time$ , "," , Line1 ; I'm actually getting the time from the GPS on the outdoor unit rather than the ESP as it will be more accurate The problem with the RTC is the data coming from the outdoor unit has the Date LINE1 in this format [code]Wed 7-Dec-2016[/code] I need to find some way to convert that back to numerical data that the RTC will accept and "merge" it with the time string |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Updated software for the OUTDOOR UNIT Couple of changes, it now sends the correct date and "LOCAL" time to the indoor unit when it first gets a GPS lock and also at 02:03 AM The indoor unit can use this to set it's clock to the correct local date and time 2016-12-08_222151_1.06.zip |
||||
panky Guru Joined: 02/10/2012 Location: AustraliaPosts: 1099 |
Lew, This is a monumental effort - very well done. Doug. ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Updated basic file for the Outdoor unit Lots of corrections including sending the correct "local" time to the indoor unit (it had some bugs including not changing when DST/GMT changes happened) It's not stable and good enough for me to look at getting some kind of box to actually mount it outdoors at last I've started working on the indoor unit again now, and I've got it to the stage where the clock is being updated correctly once a day from the gps unit outdoors. I also have the ESP8266 weather data for the coming 3 days working as a 2nd screen. I still have to get todays wweather showing properly on the display - not worked on that yet If anyone else wants a free pcb for either the Indoor unit, or outdoor unit or both let me know, I'll send the free of charge as long as your willing to test and help with the software for the indoor unit 2017-01-02_114159_1.10.zip |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Forgot to add The latest version of the outdoor unit now also has OPTION EXPLICIT and OPTION DEFAULT NONE I know some of you are adamant they should be in there all the time, but I found it a lot easier to write the code without them and then do troubleshooting afterwards to get them put in |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Slight update - this version turns the GPS on at 02:00:05 every morning - this lets the clock keep the correct local time 2017-01-03_101641_1.11.zip |
||||
lew247 Guru Joined: 23/12/2015 Location: United KingdomPosts: 1676 |
Update on the progress YouTube Link As you can see it looks pretty "s*it" at the moment, when it's finished I want to get rid of the pictures for speed, pressure humidity and wind direction and replace them with a proper code written circle with a proper dial that moves Unfortunately I am not skilled enough to do this - any volunteers? It only updates the weather every 30 seconds so the dial won't need to move other than twice a minute. I still haven't done anything about displaying the temp as graphs, or the rainfall I'm open to other suggestions as to how the display should look, ideally I'd like to keep the clock if possible though Page 2 as you can see if the weather forecast for tomorrow, the day after tomorrow and day 3 Again it looks pretty rubbish but I am new to all this so it's the best I can get it at the moment It gets the forecast from the internet by communicating with an ESP8266-01 loaded with ESP Basic, dead simple to program |
||||
Page 1 of 3 |
Print this page |