Introduction: Solar Powered WiFi Weather Station

Picture of Solar Powered WiFi Weather Station

In this Instructable, I am going to show you how to build a Solar powered WiFi Weather Station with a Wemos board.The Wemos D1 Mini Pro have small form-factor and wide range of plug-and-play shields make it an ideal solution for quickly getting started with programming the ESP8266 SoC. It is an inexpensive way to build Internet Of things ( IoT ) and is Arduino compatible.

The new Weather Station have following features:

1. The Weather Station can measure :Temperature, Humidity , Barometric Pressure , Altitude

2. You can monitor the above weather parameters from your Smartphone or from the web ( ThingSpeak.com )

3. The whole circuit along with power supply is put inside a 3D printed enclosure.

4. The range of the device is enhanced by using an 3dBi external antenna .It is around 100 meter.

Step 1: Parts and Tools Required

Picture of Parts and Tools Required

1. Wemos D1 Mini Pro ( Banggood )

2. TP 4056 Charging Board ( Amazon / Aliexpress )

3. Diode ( Aliexpress )

4. BME 280 sensor ( Aliexpress )

5. Solar Panel ( Banggood )

6. Perforated Board ( Banggood )

7. Screw Terminals ( Banggood )

8. PCB standoffs ( Banggood )

9. Li Ion Battery ( Banggood )

10. AA Battery Holder ( Amazon )

11. 22 AWG wire ( Amazon / Banggood )

12. Super Glue ( Amazon )

13. Duct Tape ( Amazon )

14. 3D printing filament -PLA ( GearBest )


Tools Used :

1.3D Printer ( Anet A8/ Creality CR-10 Mini )

2. Soldering Iron ( Amazon )

3. Glue Gun ( Amazon )

4. Wire Cutter / Stripper ( Amazon )

Step 2: Power Supply

Picture of Power Supply

My plan is to deploy the Weather station at a remote place ( my farm house).To run the Weather Station continuously, there must be a continuous power supply otherwise the system will not work .The best way to provide continuous power to the circuit is by using a battery.But after some days the battery juice will run out, and it is really difficult job to go there and charge it. So a solar charging circuit was proposed to user free energy from the sun to charge the batteries and to power the Wemos board.I have used a 14450 Li Ion battery instead of a 18650 battery because of its smaller size.The size is same as of an AA battery.

The battery is charged from a Solar panel through a TP4056 charging module. The TP4056 module comes with battery protection chip or without the protection chip.I will recommend to buy a module which have battery protection chip included.

About the TP4056 Battery Charger

The TP4056 module is perfect for charging single cell 3.7V 1 Ah or higher LiPo cells. Based around the TP4056 charger IC and DW01 battery protection IC this module will offer 1000 mA charge current then cut off when charging is finished. Furthermore when the battery voltage drops below 2.4V the protection IC will cut off the load to protect the cell from under voltage.It also protects against over voltage and reverse polarity connection.

Step 3: Measuring the Weather Data

Picture of Measuring the Weather Data

In the earlier days weather parameters like ambient temperature,humidity and barometric pressure were measured with separate analog instruments: thermometer, hygrometer and barometer.But today the market is flooded with cheap and efficient digital sensors that can be used to measure a variety of environmental parameters.The best examples are sensors like DHT11, DHT 22, BMP180, BMP280 etc.

In this project we will use a BMP 280 sensor.

BMP 280 :

BMP280 is a sophisticated sensor that very accurately measures barometric pressure and temperature with reasonable accuracy. The BME280 is the next-generation of sensors from Bosch, and is the upgrade to the BMP085/BMP180/BMP183 - with a low altitude noise of 0.25m and the same fast conversion time.

The advantage of this sensor is that it can use either I2C or SPI for communication with microcontroller. For simple easy wiring, I will suggest to by I2C version board.

Step 4: Using an External Antenna ( 3dBi )

Picture of Using an External Antenna ( 3dBi )

The Wemos D1 mini Pro board have a inbuilt ceramic antenna along with provision for connecting an external antenna to improve the range.Before using the external antenna, you have to reroute the antenna signal from the built-in ceramic antenna, to the external socket.This can be done by rotating the small surface mount (0603) Zero Ohm resistor (sometimes called a link).

You can watch this video made by Alex Eamesto rotate the zero ohm resistor.

Then snap the antenna SMA connector in to the Wemos Pro mini antenna slot.

Step 5: Solder the Headers

Picture of Solder the Headers

Wemos modules come with variety of headers but you have to solder it according your requirement.

For this project,

1. Solder the two male headers to the Wemos D1 pro mini board.

2. Solder a 4 pin male header to the BMP 280 module.

After soldering the headers the module will look as shown in the above picture.

Step 6: Adding Headers and Terminals

Picture of Adding Headers and Terminals

Next step is soldering the headers to the perforated board.

1. First place the Wemos board over the perforated board and mark the foot print.Then solder the two row of female headers over the marked position.

2. Then solder a 4 pin female headers as shown in the picture.

3. Solder a screw terminals for battery connection.

Step 7: Mount the Charging Board :

Picture of Mount the Charging Board :

Stick a small piece of double sided tap on the back side of the charging module and then paste it on the perforated board as shown in the picture.During mounting care should be taken to align the board in such a way that the soldering holes will match with the perforated board holes.

Adding terminal for Solar Panel

Solder a screw terminal just near the micro USB port of the charging board.

You can solder this terminal in the earlier step also.

Step 8: Wiring Diagram

Picture of Wiring Diagram

First I cut small pieces of different colors wires and strip out the insulation at the both ends.

Then I solder the wires according to the Schematic diagram as shown in the above picture.

Wemos -> BME 280

3.3 V - -> Vin

GND --> GND

D1 --> SCL

D2 --> SDA

TP4056 Connection

Solar Panel terminal -> + and - near the micro USB port

Battery Terminal -> B+ and B-

5V and GND of Wemos -> Out+ and Out-

Note :In the beginning , I forgot to solder the diode.Later I solder it near to the Solar panel terminal and connect it as per the wiring diagram.I have used a 1N4007 diode but I will recommend to use a low voltage drop schottky diode.

Step 9: Designing the Enclosure

Picture of Designing the Enclosure

This was the most time consuming step for me.I have spent around 4 hours to design the enclosure. I used Autodesk Fusion 360 to design it. The enclosure have two parts : Main Body and Front Cover

The main body is basically designed to fit all the components. It can accommodate the following components

1. 50x70mm circuit board

2. AA battery holder

3. 85.5 x 58.5 x 3 mm Solar Panel

4. 3dBi external antenna

Download the .stl files from Thingiverse

Step 10: 3D Printing

Picture of 3D Printing

After completion of design, it is time to 3D print the enclosure.In Fusion 360 you can click on make and slice the model by using a slicer software.I have used cura to slice the model.

I used an Anet A8 3D printer and 1.75 mm green PLA to print out all the body parts. It took me about 11 hours to print the main body and around 4 hours to print the front cover.

I will highly recommend to use another printer for you that is Creality CR - 10. Now a mini version of the CR-10 is also available.The Creality printers are one of my favorite 3D Printer.

As I am new to 3D designing, my design was not optimistic.But I am sure, this enclosure can made by using lesser material ( less print time ). I will try to improve the design later.

My settings are:

Print Speed : 40 mm/s

Layer Height : 0.2

Fill Density : 15%

Extruder Temperature : 195 degC

Bed Temp : 55 degCr

Step 11: Installing the Solar Panel and Battery

Picture of Installing the Solar Panel and Battery

Solder a 22 AWG red wire to the positive terminal and black wire to the negative terminal of the Solar panel.

Insert the two wires in to the holes in the roof of the main enclosure body.

Use super glue to fix the Solar Panel and press it some time for proper bonding.

Seal the holes from the inside by using hot glue.

Then insert the battery holder in to the slot at the bottom of the enclosure.

Step 12: Installing the Antenna

Picture of Installing the Antenna

Unscrew the nuts and washers in the SMA connector.

Insert the SMA connector in to the holes provided in the enclosure.See the image above.

Then tighten the nut along with the washers.

Now install the antenna by properly aligning with the SMA connector.

Step 13: Installing the Circuit Board

Picture of Installing the Circuit Board

Mount the standoffs at 4 corners of the circuit board.

Apply super glue at the 4 slots in the enclosure. Refer the above picture.

Then align the standoff with the 4 slots and place it.leave some to dry it out.

Step 14: Close the Front Cover

Picture of Close the Front Cover

After printing the front cover, it may be not perfectly fit to the main enclosure body.If it is the case, just sand it at the sides by using a sand paper.

Slide the front cover in to the slots in the main body.

To secure it, use duct tape at the bottom.

Step 15: Programming

Picture of Programming

To use Wemos D1 with the Arduino library, you'll have to use the Arduino IDE with ESP8266 board support. If you haven't already done that yet, you can easily install ESP8266 Board support to your Arduino IDE by following this tutorial by Sparkfun.

Following settings are preferable :

PU Frequency:
80MHz 160MHz

Flash Size: 4M (3M SPIFFS) – 3M File system size 4M (1M SPIFFS) – 1M File system size

Upload Speed: 921600 bps

Arduino Code for Blynk App :

Sleep Mode :

The ESP8266 is a pretty power hungry device. If you want your project to run off a battery for more than a few hours, you have two options:

1. Get a huge battery

2.Cleverly put the Thing to sleep.

The best choice is the second option.Before using the deepsleep feature, Wemos D0 pin must be connected to the Reset pin.

Credit : This was suggested by one of the Instructables user " tim Rowledge ".

More Power Saving Option :

The Wemos D1 Mini has a small LED that lights when the board is powered.It consume lot of power.So just pull that LED off the board with a pair of pliers. It will drastically drop the sleep current down .

Now the device can run for long time with a single Li Ion battery.

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space<br>#include < ESP8266WiFi.h>
#include  <BlynkSimpleEsp8266.h ></p><p>
#include "Seeed_BME280.h"
#include < Wire.h>
BME280 bme280;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "3df5f636c7dc464a457a32e382c4796xx";// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "SSID";
char pass[] = "PASS WORD";
void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  Serial.begin(9600);
  if(!bme280.init()){
  Serial.println("Device error!");
  }
}

void loop()
{
  Blynk.run();
  
  //get and print temperatures
  float temp = bme280.getTemperature();
  Serial.print("Temp: ");
  Serial.print(temp);
  Serial.println("C");//The unit for  Celsius because original arduino don't support speical symbols
  Blynk.virtualWrite(0, temp); // virtual pin 0
  Blynk.virtualWrite(4, temp); // virtual pin 4
  //get and print atmospheric pressure data
  float pressure = bme280.getPressure(); // pressure in Pa
  float p = pressure/100.0 ; // pressure in hPa
  Serial.print("Pressure: ");
  Serial.print(p);
  Serial.println("hPa");
  Blynk.virtualWrite(1, p); // virtual pin 1
  //get and print altitude data
  float altitude = bme280.calcAltitude(pressure);
  Serial.print("Altitude: ");
  Serial.print(altitude);
  Serial.println("m");
  Blynk.virtualWrite(2, altitude); // virtual pin 2  //get and print humidity data
  float humidity = bme280.getHumidity();
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.println("%");
  Blynk.virtualWrite(3, humidity); // virtual pin 3
  ESP.deepSleep(5 * 60 * 1000000); // deepSleep time is defined in microseconds.
}

Step 16: Install Blynk App and Library

Picture of Install Blynk App and Library

Blynk is an app that allows full control over Arduino, Rasberry, Intel Edision and many more hardware.It is compatible for both Android and IPhone.Right now the Blynk app is available with free of cost.

You can download the app from the following link

1. For Android

2. For Iphone

After downloading the app, installed it on your smartphone.

Then you have to import the library on to your Arduino IDE.

Download the Library

When you run the app for the first time, you need to sign in – so enter an email address and password. Click the “+” at the top-right of the display to create a new project.Then name it.

Select the target hardware " ESP8266 "Then click “E-mail” to send that auth token to yourself – you will need it in the code

Step 17: Make the Dash Board

Picture of Make the Dash Board

The Dashboard is consists of different widgets.To add widgets follow the steps below :

Click “Create” to enter the main Dashboard screen.

Next, press “+” again to get the “Widget Box”

Then drag 4 Gauges.

Click on the graphs,it will pop up a settings menu as shown above.

You have to change the name "Temperature",Select the Virtual Pin V1, then change the range from 0 -50.Similarly do for other parameters.

Finally drag a graph and repeat the same procedure as in gauge settings.The final dashboard picture is shown in the above picture.

You can change the color also by clicking the circle icon on the right side of the Name.

Step 18: Uploading Sensor Data to ThingSpeak

Picture of Uploading Sensor Data to ThingSpeak

First create an account on ThingSpeak.

Then create a new Channel on your ThingSpeak account.
Find How to Create a New Channel

Fill Field 1 as Temperature ,Field 2 as Humidity and Field 3 as pressure.

In your ThingSpeak account select “Channel” and then “My Channel”.

Click on your channel name.

Click on “API Keys” tab and copy the “Write API Key”

Open the Solar_Weather_Station_ThingSpeak code .Then write your SSID and Password.

Replace the “WRITE API ”with the copied “Write API Key”.

Required Library : BME280

Credit : This code is not written by me .I got it from the link given in a YouTube video by plukas.

Step 19: Final Test

Picture of Final Test

Place the device on sunlight, the red led on TP 4056 charger module will lit up.

1. Blynk App Monitoring:

Open the blynk project.If everything is Ok,you will notice the gauge will live and the graph stat to plot the temperature data.

2. ThingSpeak Monitoring :

First open your Thingspeak Chanel.

Then go to “Private View” tab or “Public View” tab to see the Data Charts.

Thanks for reading my Instructable.

If you like my project, don't forget to share it.

Comments

brosvv1 (author)2018-01-18

Good afternoon . How are you? Forgive my limited knowledge of English. I have soldered the components on the PCB board, I have installed the codes of the following programs:

Solar_Powered_Weather_Station.ino -> Here I put the Token of the Blynk application.

Solar_Weather_Station_ThingSpeak.ino -> Here I put the api_key that I get from the page thingspeak.com

I have entered the two schedules and I have not had any problems ... But I can not get the weather station to detect me in the Blynk program. And the thingspeak page does not register the data. That is, I have put the programming to the station but I can not read the data anywhere.

Could you help me please?

Thank you very much

Rengatharu (author)2018-01-05

Hello, i know this error was here countless time but i tried all the tips below and didnt work.. so if you have some new tip i would be gratefull..

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

farmerkeith (author)Rengatharu2018-01-06

Hi Rengatharu, Can you post a more complete version of the output, going from the time compilation is finished to the end?

Have you tried uploading your sketch multiple times and it fails every time?

What are the settings you are using in the Tools menu?

I hope we can help you. Keith

Rengatharu (author)farmerkeith2018-01-12

Hello, sorry for late answer, i didnt notice your response. I tried multiple times, i even installed 1.6.5 ide version as someone suggested me on reddit.

Here is more complete version, i hope this is what you ment:

sptool v0.4.12 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 921600
setting port from to COM1
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
SetCommState call failed
setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

I used to use same settings in tools as shown in the project, in 1.6.5 version there are more options but i tried to keep it same.

Rengatharu (author)Rengatharu2018-01-12

Should i try to solder GPIO0 and GPIO15 pins to GND?

farmerkeith (author)Rengatharu2018-01-12

Hi Rengatharu,

I think the first thing you should do is unplug the WeMos from the circuit board and try the upload to it, without anything connected to its pins. If that fails as above, you almost certainly have a faulty WeMos.

Try the same thing with another WeMos - that is, upload not plugged in to anything. If that fails as well, you may need to try different hardware combinations - eg a different USB cable, a different USB port on your computer.

For example, here is what I see in the bottom window of my IDE (v1.8.5) when I open a brand new (blank) sketch and upload it to a WeMos D1 mini pro. The big different occurs on about line 8 of what you sent, including the word "failed".

Good luck!

Keith

Archiving built core (caching) in: /tmp/arduino_cache_624375/core/core_esp8266_esp8266_d1_mini_CpuFrequency_80,UploadSpeed_921600,FlashSize_4M3M_5599fd7b37e9acceacc41dbccdf043b5.a
Sketch uses 221919 bytes (21%) of program storage space. Maximum is 1044464 bytes.
Global variables use 31484 bytes (38%) of dynamic memory, leaving 50436 bytes for local variables. Maximum is 81920 bytes.
/home/guy/.arduino15/packages/esp8266/tools/esptool/0.4.9/esptool -vv -cd nodemcu -cb 921600 -cp /dev/ttyUSB0 -ca 0x00000 -cf /tmp/arduino_build_451683/sketch_jan13a.ino.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 921600
setting port from /dev/ttyUSB0 to /dev/ttyUSB0
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
opening port /dev/ttyUSB0 at 921600
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
Uploading 226064 bytes from /tmp/arduino_build_451683/sketch_jan13a.ino.bin to flash at 0x00000000
erasing flash
size: 037310 address: 000000
first_sector_index: 0
total_sector_count: 56
head_sector_count: 16
adjusted_sector_count: 40
erase_size: 028000
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
setting timeout 15000
setting timeout 100
espcomm_send_command: receiving 2 bytes of data
writing flash
................................................................................ [ 36% ]
................................................................................ [ 72% ]
............................................................. [ 100% ]
starting app without reboot
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
closing bootloader

Rengatharu (author)farmerkeith2018-01-17

So.. I connected only wemos and sadly, error still occurs.. Does that mean i should buy new wemos?

Rengatharu (author)Rengatharu2018-01-17

or should i try to buy different module now? from the esp type

farmerkeith (author)Rengatharu2018-01-17

Hi Rengatharu,

If you do not have another WeMos already, then you need to purchase another one. When it arrives, try to upload a sketch to it before you solder any pins, that way you will be sure you have not damaged it in any way (not that soldering the pins is likely to damage it).

MatejB16 (author)2018-01-14

I am geting this error when compiling.

Arduino: 1.8.4 (Windows 10), Board: "WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"

Archiving built core (caching) in: C:\Users\Matejb\AppData\Local\Temp\arduino_cache_437494\core\core_esp8266_esp8266_d1_mini_CpuFrequency_80,UploadSpeed_921600,FlashSize_4M3M_d7ae30b964054fa2f21af549a81d37e0.a

sketch\weather_station.ino.cpp.o:(.text.setup+0x2c): undefined reference to `BME280::init()'

sketch\weather_station.ino.cpp.o: In function `BlynkProtocol<BlynkArduinoClientGen<Client> >::begin(char const*)':

C:\Program Files (x86)\Arduino\libraries\Blynk\src/Blynk/BlynkProtocol.h:92: undefined reference to `BME280::init()'

sketch\weather_station.ino.cpp.o: In function `setup':

C:\Users\Matejb\Documents\Arduino\libraries\weather_station/weather_station.ino:51: undefined reference to `BME280::getTemperature()'

C:\Users\Matejb\Documents\Arduino\libraries\weather_station/weather_station.ino:51: undefined reference to `BME280::getPressure()'

sketch\weather_station.ino.cpp.o: In function `BlynkWifi::begin(char const*, char const*, char const*, char const*, unsigned short)':

C:\Users\Matejb\Documents\Arduino\sketch_jan10a\libraries\BlynkSimpleEsp8266/BlynkSimpleEsp8266.h:74: undefined reference to `BME280::calcAltitude(float)'

C:\Users\Matejb\Documents\Arduino\sketch_jan10a\libraries\BlynkSimpleEsp8266/BlynkSimpleEsp8266.h:74: undefined reference to `BME280::getHumidity()'

sketch\weather_station.ino.cpp.o:(.text.loop+0x60): undefined reference to `BME280::getTemperature()'

sketch\weather_station.ino.cpp.o:(.text.loop+0xa2): undefined reference to `BME280::getPressure()'

sketch\weather_station.ino.cpp.o: In function `loop':

C:\Users\Matejb\Documents\Arduino\libraries\weather_station/weather_station.ino:62: undefined reference to `BME280::calcAltitude(float)'

C:\Users\Matejb\Documents\Arduino\libraries\weather_station/weather_station.ino:69: undefined reference to `BME280::getHumidity()'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board WeMos D1 R2 & mini.

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

MatejB16 (author)2018-01-14

Errors

Archiving built core (caching) in: C:\Users\Matejb\AppData\Local\Temp\arduino_cache_491191\core\core_esp8266_esp8266_d1_mini_CpuFrequency_80,UploadSpeed_115200,FlashSize_4M3M_d7ae30b964054fa2f21af549a81d37e0.a

sketch\Solar_Powered_Weather_Station.ino.cpp.o:(.text.setup+0x2c): undefined reference to `BME280::init()'

sketch\Solar_Powered_Weather_Station.ino.cpp.o: In function `BlynkProtocol<BlynkArduinoClientGen<Client> >::begin(char const*)':

C:\Program Files (x86)\Arduino\libraries\Blynk\src/Blynk/BlynkProtocol.h:92: undefined reference to `BME280::init()'

sketch\Solar_Powered_Weather_Station.ino.cpp.o: In function `setup':

C:\Users\Matejb\Documents\Arduino\sketch_jan10a\Solar_Powered_Weather_Station/Solar_Powered_Weather_Station.ino:51: undefined reference to `BME280::getTemperature()'

C:\Users\Matejb\Documents\Arduino\sketch_jan10a\Solar_Powered_Weather_Station/Solar_Powered_Weather_Station.ino:51: undefined reference to `BME280::getPressure()'

sketch\Solar_Powered_Weather_Station.ino.cpp.o: In function `BlynkWifi::begin(char const*, char const*, char const*, char const*, unsigned short)':

C:\Program Files (x86)\Arduino\libraries\Blynk\src/BlynkSimpleEsp8266.h:74: undefined reference to `BME280::calcAltitude(float)'

C:\Program Files (x86)\Arduino\libraries\Blynk\src/BlynkSimpleEsp8266.h:74: undefined reference to `BME280::getHumidity()'

sketch\Solar_Powered_Weather_Station.ino.cpp.o:(.text.loop+0x60): undefined reference to `BME280::getTemperature()'

sketch\Solar_Powered_Weather_Station.ino.cpp.o:(.text.loop+0xa2): undefined reference to `BME280::getPressure()'

sketch\Solar_Powered_Weather_Station.ino.cpp.o: In function `loop':

C:\Users\Matejb\Documents\Arduino\sketch_jan10a\Solar_Powered_Weather_Station/Solar_Powered_Weather_Station.ino:62: undefined reference to `BME280::calcAltitude(float)'

C:\Users\Matejb\Documents\Arduino\sketch_jan10a\Solar_Powered_Weather_Station/Solar_Powered_Weather_Station.ino:69: undefined reference to `BME280::getHumidity()'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board WeMos D1 R2 & mini.

TrungT46 (author)2018-01-13

hi sir :) i don't see the wire form the lipo battery go to the Wemos D1??? the lipo should be the power source when the times is at night right? sorry forr my bad english pls rep me soon... thank you

jfmateos (author)2018-01-10

Very nice project, congratulations.

I see you have connected OUT+ to 5V in the wemos.

Do you think it could be got more juice from the battery connecting OUT+ to 3.3V in the wemos?

farmerkeith (author)jfmateos2018-01-12

Hi jfmateos,

If you want to understand more about the power connections, please look at my reply to EdithAndLucas from 7 months ago.

It may be that you will get more energy from your battery by making the connection to 3.3V instead of 5V, although I think the difference is probably quite small. You also run the risk of causing your WeMos to fail due to over voltage, although I think that is also a low risk in this situation.

zingo1010. (author)2017-12-31

I forgot to mention that to use the OTA function on the Arduino IDE as I discussed in my previous comment, you need to have python installed. In particular Python version 2.7, not the later versions that you may see. There are many YouTube offerings about installing Python. Basically, I found it to be set and forget, It just works. That said I am using a Mac computer. I believe you have to make sure you put python "in the path" if using windows. Do this by checking the properties thing...I think...hehe.

IanO44 (author)2017-12-31

After 189 comments this may be old news, but I'd check the internal temperature. That green is very close to "young elm tree green" that was found to be the most efficient colour for absorbing solar radiation. You may be getting inaccurately high readings. Weather stations are normally white.

JoeyyBoyy (author)2017-12-31

Very nice project! How long (hours) did it take to complete and what

was the cost in US dollars? Thanks.

etmilosk (author)2017-12-31

Wonderful work!

zingo1010. (author)2017-12-31

Nice job.

Suggestion for you.

Since this is an ESP8266 device you can locate the thing and send sketches to it remotely so long as it's in range of your WiFi.

To do this, you first load onto the board the sketch in ArduinoOTA

Find this in examples for Wemos Di R1 & Mini

Plug the board into your USB and after editing in your WiFi credentials in the sketch. ->SSID & password, upload to your board.

Next. Unplug your board and self-power it from the battery.

Get your weather station sketch in front of you and edit it by adding these few extra items.

Above the setup function put in this line--

#include <ArduinoOTA.h>

Inside the setup function put in this stuff--

ArduinoOTA.onError([](ota_error_t error) { ESP.restart(); });
ArduinoOTA.begin();

In the loop function put this--

ArduinoOTA.handle();

That's it.

You should now see you have a network port in the Arduino Ide like this.

Select that and upload new sketches (with those additions) at will.

Upload is also faster this way too.

sgbotsford (author)2017-12-31

Thoughts:

The weather bureau in the US, Canada, and over much of the world settled on the Stevenson Screen. http://www.meteocercal.info/forum/Thread-How-to-ma... pdf in first comment.

Some years ago, the US service changed the brand of paint. Still white. Visually you could not see a difference. But the thermometers cared, and they have to correct the readings. One thing you may want to do is get permission to keep it for a year next to the one at the local airport. (Almost all airports are also weather stations.) You can then compare readings.

There are also standards for siting. Size of clearing, coverage of ground (grass) Height of nearby trees. Most of these are an effort to get consistent precipitation guage readings. Speaking of which: Can you put precip and evapaoration, and wind on this one too?

***

For people in a snowy climate: Mount the solar cell vertically on the south side. This way you will get enough sun on it to charge it on short winter days, and snow won't cling to it.

lukee1986 (author)2017-12-31

good project except i now have google home it tells me everything about the weather

grguthrie (author)2017-12-31

Wonderful project, very clearly presented. I would build one if it had a wind meter!

brosvv1 (author)2017-12-26

Good night

I have a problem when i want install Solar_Powered_Weather_Station in WemOs D1 with Arduino IDE, its problem is:

El Sketch usa 249049 bytes (23%) del espacio de almacenamiento de programa. El máximo es 1044464 bytes.

Las variables Globales usan 34448 bytes (42%) de la memoria dinámica, dejando 47472 bytes para las variables locales. El máximo es 81920 bytes.

warning: espcomm_sync failed

error: espcomm_open failed

error: espcomm_upload_mem failed

error: espcomm_upload_mem failed

¿Could help me please?

Thank you

optio50 (author)brosvv12017-12-30

I suspect you have chosen the wrong board in the Arduino IDE

farmerkeith (author)brosvv12017-12-28

brosvv1, I have in the past, and commonly still do, experience failures of this type. It seems to be random, and if you repeat the upload it usually succeeds on the 2nd or 3rd try. Maybe you need to change the hardware or maybe de-power and re-power it, but in my experience usually just a simple retry works.

AndrewH456 (author)brosvv12017-12-27

I have had this sort of problem before. i think its caused by faulty connections. Either try another board or unplug things and reassemble. Eventually it will go away

valentinjoubert made it! (author)2017-12-29

I made it, thx man

jroy6 (author)2017-09-29

im blocking at

C:\DownloadFile\weather_station\weather_station.ino:3:26: fatal error: Seeed_BME280.h: No such file or directory

#include "Seeed_BME280.h"

^

compilation terminated.

exit status 1

Error compiling for board SparkFun ESP8266 Thing.

i not sure about what i have to do .

farmerkeith (author)jroy62017-09-30

jroy6, You need to download and install this library. You can get it at:

https://github.com/Seeed-Studio/Grove_BME280

jroy6 (author)farmerkeith2017-10-01

im now blocked at

Archiving built core (caching) in: C:\Users\Jean\AppData\Local\Temp\arduino_cache_744759\core\core_esp8266_esp8266_thing_CpuFrequency_80,UploadSpeed_115200_27aaf0f20dbb73ccb02fc87bdcb6fef5.a

Sketch uses 248933 bytes (57%) of program storage space. Maximum is 434160 bytes.

Global variables use 34452 bytes (42%) of dynamic memory, leaving 47468 bytes for local variables. Maximum is 81920 bytes.

warning: espcomm_sync failed

error: espcomm_open failed

error: espcomm_upload_mem failed

error: espcomm_upload_mem failed

AndrewH456 (author)jroy62017-12-27

I have had this sort of problem before. i think its caused by faulty connections. Either try another board or unplug things and reassemble. Eventually it will go away

MisoM1 (author)farmerkeith2017-12-10

how do I install it? i have arduino 1.8.5 thanks for help

farmerkeith (author)MisoM12017-12-10

Hi MisoM1, you can get detailed information about installing arduino libraries on the Arduino web site, and also at this Instructable

https://www.instructables.com/id/Arduino-Install-a...

The basic process is

a) locate the folder on your computer where all the other libraries are stored,

b) make a new sub-folder in that folder with the name of your new library;

c) copy the new library into that new sub-folder.

d) re-start your IDE

If you look under the Sketch menu item on the IDE (I use version 1.8.5 too so it should be identical on yours) there is an item "Include library". If you hover your mouse pointer over that it will open a list of visible libraries, and your new library should be visible there. Near the top of that list there are two items "Manage libraries" and "Add ZIP library". Have a look in those it may give you some useful information about your installation.

MisoM1 (author)farmerkeith2017-12-16

Good day, I want
to make this project even with the ESP8266-ESP-07 module, and if it is
possible to connect one more BME280 sensor and how to adjust the
software? well thank you

farmerkeith (author)MisoM12017-12-16

Hi MisoM1, yes you can connect a second BME280 to this project quite easily, so long as you are using the 6-pin version of the module.

The two extra pins are CSB and SDO.

CSB
tells the BMP/BME280 whether it will be using I2C or SPI protocol. To
use I2C, as in this project, CSB has to be connected to VCC (3.3V).

SDO
is an address select pin. For the first BMP/BME280, SDO has to be connected to
GND (which selects the base address of 0x76), which is the value used by
the 4-pin module. For the second BMP/BME280, SDO has to be connected to Vcc (3,3V) which selects the next I2C address of 0x77.

As for software, there is a bit of an issue.

Neither the SEED nor the Adafruit libraries for the BME280 support the 2 different I2C addresses. There is another library which I wrote and which you can find at https://www.instructables.com/id/Library-for-BMP2... (it is not published so far but can be accessed via this link) which supports the 2 I2C addresses, however it is only for the BMP280 so it does not have functions for humidity in it. When I bought the parts for this project I mistakenly bought the BMP280 (without humidity), as it was a lot cheaper. Therefore I did not write my library to support the humidity functionality.

You can find it also on Github at https://github.com/farmerkeith/BMP280-library . It includes several examples of various use cases which also may help you.

I think your options are:

a) use my library (I think it will work with the BME280 although it has not been tested);

b) modify my library to support humidity

c) modify either the Adafruit or Seed library to support 2 I2C addresses (you can use my library as a model)

d) ask me to update my library for BME280 and humidity, and wait (maybe several months) for me to do it (I have to order parts and then do the work).

It has been my intention to update this library anyway, but there is currently no timetable.

If you want to attach more than 2 BME280 or BMP280 devices to your microcontroller, it will be necessary to use another I2C bus, or switch to SPI. These are viable options but it becomes more complicated and the software situation is more tricky as well.

I will be interested in your progress. Please let me know by reply how you go.

Keith

MisoM1 (author)farmerkeith2017-12-12

Good day, thank you very much, I have another problem, ESP 8266 is right as an AP, how do I make a client of it? I have a thing to speak. well thank you

farmerkeith (author)MisoM12017-12-12

Hi MisoM1, I am sorry I do not understand your question. Can you explain what you are wanting to do a bit more? Maybe I can help.

MisoM1 (author)farmerkeith2017-12-14

I have found a mistake, thank you for your help

MisoM1 (author)farmerkeith2017-12-13

sorry, I can not good speak English, I made the guides for thingspeak. I did according to the instructions for thingspeak. I still do not have data on the server thingspeak, I still catch the signal from ESP - I did not connect to my network, I do not know

brosvv1 (author)2017-12-26

And also I have problem when i wan t install Solar_Weather_Station_ThingSpeak , this problem is:

El Sketch usa 236901 bytes (22%) del espacio de almacenamiento de programa. El máximo es 1044464 bytes.

Las variables Globales usan 32424 bytes (39%) de la memoria dinámica, dejando 49496 bytes para las variables locales. El máximo es 81920 bytes.

warning: espcomm_sync failed

error: espcomm_open failed

error: espcomm_upload_mem failed

error: espcomm_upload_mem failed

¿Could help me please?

Thank you

AndrewH456 (author)brosvv12017-12-27

I have had this sort of problem before. i think its caused by faulty connections. Either try another board or unplug things and reassemble. Eventually it will go away

BorisA19 (author)2017-12-26

First of all hi, and thanks for amazing project.

Has anyone connected this to OpenHab?

I would like to add a rain measurement and wind: speed, gust, and direction. Can anyone suggest which ones to use?

John_dad (author)2017-12-03

I can't find "Seeed_BME280.h" in your connection

farmerkeith (author)John_dad2017-12-09

John_dad, Your question is not very clear. You can download the Seeed_BME280.h library from the internet. You can find it at https://github.com/Seeed-Studio/Grove_BME280 then follow the usual installation process for a library in the Arduino IDE. Does that help?

John_dad (author)farmerkeith2017-12-21

Hello farmerkeith,I found it in github, this problem has been solved,thank you!

farmerkeith (author)John_dad2017-12-23

Hi John_dad, good news. Thanks for letting us know.

richo2711 (author)2017-12-17

Hello, nice project....congrats.

I could make Temp and Press gadgets work but Humidity is not working. What could the problem be?

farmerkeith (author)richo27112017-12-23

Hi richo2711, One possibility is that you have a BMP280 rather than a BME280. I suggest you check your purchase transaction.

JanW97 (author)2017-12-07

I have following problem , when i run the sketch for blynk , it upload fine . When i run the seriel monitor it say's " 280bme device error" . When i upload the sketch for thingspeak the 280bme works ok but i get " http 400 bad request" . What goes wrong ?

farmerkeith (author)JanW972017-12-09

JanW97, the Thingspeak and Blynk versions use different libraries for the BME280, which may be why you get a BME280 problem with Blynk and not with Thingspeak. Have you tried removing power and then restarting for the Blynk version? Sometimes the hardware may encounter an error and needs to be reset. Otherwise you could try changing over to the other library.

The message http 400 bad request sounds like an error with Thingspeak, have you checked your registration details carefully?

Good luck.

About This Instructable

113,244views

1,136favorites

License:

Bio: I am an Electrical Engineer.I love to harvest Solar Energy and make things by recycling old stuffs. I believe &quot;&quot;IF YOU TRY YOU MIGHT ... More »
More by deba168:DIY Professional 18650 Battery PackDIY Acrylic RGB LED SignHow to Make a Bench Power Supply
Add instructable to: