A very simple weather station

Overview

Teaching: 0 min
Exercises: 0 min
Questions
  • How to add a sensor to measure temperature?

  • How to add a new sensor in our program?

  • How to add a sensor to measure light?

Objectives
  • Become familiar with our new temperature sensor

  • Add our temperature sensor into our circuit

  • Update our program to measure temperature

  • Add a photodiode to our circuit

  • Update our program

Dallas DS18b20 thermistor

DS18b20 information

DS18b20 DS18b20

Connect a DS18b20 to our ESP8266

We will add our DS18b20 to the previous circuit. For now our LED will blink independently from our temperature sensor. Later, we will add a photodiode and switch on the LED at “night”.

In our example, a 2.2 kohm will be used.

ESP8266 and DS18b20

Get data from your program

In order to acquire data from the DS18b20, you need to install a new library on your computer.

Add libraries to Arduino IDE

Search in your Downloads folder where your OneWire.zip file was stored and add it.

Visualize data

It will show values as printed on a serial port in the program

It will plot the values. Please make sure you first close the Serial Monitor before opening the Serial Plotter (both cannot work together).

Add libraries to Arduino IDE

In both cases, make sure you select “9600 baud”.

Photodiode

We will now add a photodiode to the previous circuit and switch on the LED at night only.

Key Points

  • Use a motherboard with several sensors

  • Run our program to print and plot measured values