Weather-Station

by quinten_d_clercq in Circuits > Raspberry Pi

1380 Views, 3 Favorites, 0 Comments

Weather-Station

62466022_411536363025746_6065618789850939392_n.jpg
64262325_376084783016633_109905601764524032_n.jpg
62478829_446360766197248_476404373837053952_n.jpg

In this project we will make a weather station that will measure the temperature, humidity and UV index by using Raspberry Pi, Python (coding), MySQL (database) and Flask (web server).

Supplies

The required components for this project

are:

- Cover cap

- DHT11 humidity sensor

- DS18B20 temperature sensor

- GUVA-S12SD UV sensor

- LCD Display

- Servo motor

- MCP3008

- Raspberry Pi 3

- Trimmer

- Total cost is around € 110.

The tool I used:

- Conical drill

- Double-sided adhesive tape

Circuit

eind_electric.png
eind_breadbord.png
62221471_682439188851938_8260858144855425024_n.jpg

Circuit:

LCD:

- VSS to Raspberry Pi’s ground

- VDD to Raspberry Pi’s 5V

- V0 to middle pin trimmer

- RS to GPIO pin

- R / W to Raspberry Pi’s ground

- E to GPIO pin

- D4 to GPIO pin

- D5 to GPIO pin

- D6 to GPIO pin

- D7 to GPIO pin

- A to Raspberry Pi’s 5V

- K to Raspberry Pi’s ground Trimmer

- To Raspberry Pi’s 5V

- To LCD pin V0

- To Raspberry Pi’s ground

DHT11:

- VCC to Raspberry Pi’s 3V3

- GND to Raspberry Pi’s ground

- DAT to Raspberry Pi’s GPIO pin 4

- 470 ohms between VCC and DAT

DS18B20:

- VCC to Raspberry Pi’s 3V3

- GND to Raspberry Pi’s ground

- DAT to Raspberry Pi’s GPIO pin 4

-470 ohms between VCC and DAT

Servo motor:

- VCC to Raspberry Pi’s 5V

- GND to Raspberry Pi’s ground

- DAT to Raspberry Pi’s GPIO pin

MCP3008:

- VDD to Raspberry Pi’s 3V3

- VREF to Raspberry Pi’s 3V3

- AGND to Raspberry Pi’s ground

- CLK to GPIO pin 11 SCLK

- DOUT to GPIO pin 9 MISO

- DIN to GPIO pin 10 MOSI

- CS to GPIO pin 8 CE0

- DGND to Raspberry Pi’s ground

- CH0 to GUVA-S12SD (UV sensor)

DHT11

FAEHJVGIDFSLYVK.LARGE.jpg

DHT11 is a digital

temperature and humidity sensor. Output to a digital pin.

DHT11 specifications:

- Operates on: 3.3 - 6V.

- Temperature range: -40 - +80 ºC.

- Temperature accuracy: ± 0.5 ºC.

- Humidity range: 0-100% RH.

- Humidity accuracy: ± 2.0% RH.

- Response time: <3 sec.

DS18B20

DS18B20-500x500-800x800.jpg
DS18B20.jpg

DS18B20 Sensor Specifications

- Programmable Digital Temperature Sensor.

- Communicates using 1-Wire method.

- Operating voltage: 3V to 5V.

- Temperature Range: -55°C to +125°C.

- Accuracy: ±0.5°C.

- Unique 64-bit address enables multiplexing.

LCD

a6cc6d40-bd43-4fb6-961d-8a94c904dad6.jpg

LCD controller with 16 × 2 characters display module with blue

backlight and white characters. 2 lines, 16 characters per line. High contrast and large viewing angle. Contrast adjustable by means of an adjustable resistor (potentiometer / trimmer).

LCD 16 × 2 blue specifications:

- Operates on: 5V

- Adjustable contrast.

- Dimensions: 80mm x 35mm x 11mm.

- Visible display: 64.5mm x 16mm.

MCP3008

100460_1024x1024.jpg
rc_cmd_main_interfacing.png
rc_cmd_interfacing_spi.png
rc_cmd_spi_1.png
rc_cmd_spi_2.png
rc_cmd_reboot.png

An analog-to-digital converter or AD-converter (ADC) converts an analogue
signal, for example a speech signal, into a digital signal. The MCP3008 has 8 analog inputs and can be read with an SPI interface on an Arduino, Raspberry Pi, ESP8266 The MCP converts an analog voltage to a number between 0 and 1023 (10 bit).

When using the MCP3008 you need to enable SPI, you can do this by (images added with the steps) :

  1. Typ in the console: sudo raspi-config
  2. This will launch the raspi-config utility. Select “Interfacing Options”
  3. Highlight the “SPI” option and activate .
  4. Select and activate.
  5. Highlight and activate .
  6. When prompted to reboot highlight and activate.
  7. The Raspberry Pi will reboot and the interface will be enabled.

Servo Motor

41Y5VWjAeQL._SX342_QL70_.jpg

Size: 32 × 11.5 × 24mm (Tabs included) 23.5 × 11.5 × 24mm (Tabs not include)

Weight: 8.5g (Cable and a connector not include) 9.3g ( Cable and a connector included)

Speed: 0.12sec/60degrees (4.8V) 0.10sec/60degrees (6.0V)

Torque: 1.5kgf-cm (4.8V) 2.0kgf-cm (6.0V)

Voltage: 4.8V-6.0V

Connector type: JR type (Yellow: Signal, Red: VCC, Brown:GND)

UV-SENSOR GUVA-S12SD

vma328.jpg

GUVA-S12SD Sensor Specifications

- Operating voltage: 3.3 V to 5 V

- Output voltage: 0 V to 1 V (0-10 UV index)

- Response time: 0.5 s

- Accuracy: ± 1 UV index

- Wavelength: 200-370 nm

- Consumption: 5 mA

- Dimensions: 24 x 15 mm

Case

64381088_2516040765113566_745194705804853248_n.jpg

I used a cover cap for the hull where I drilled 2 holes for the temperature and the uv sensor, the humidity sensor, servo motor and lcd were mounted in 1 of the holes at the top. The cover cap was mounted on a board for a better look

Database

database.PNG

Code