Weather is a fascinating and important aspect of our lives, and with the rise of smart home technology, it has become easier than ever to track and monitor weather conditions in your own backyard. In this presentation, I will explore the process of building a home weather station.
I will discuss the hardware components needed to build a weather station, including sensors for temperature, humidity, pressure, and precipitation, as well as the embedded board itself. I will also cover the programming aspect of the project, including how to read data from the sensors and transmit it wirelessly to the cloud.
By the end of this presentation, you will have a solid understanding of how to build and program a home weather station using Arduino, and how to customize and expand the project to fit your specific needs.
8. Objective
Objective
Build a weather station to capture local conditions and
upload the data to the “cloud”.
Assumptions
• You are already an expert with Java and might know
C++/Python
• You are NOT an electrical engineer.
• You want to interact with the physical environment.
9. Setup
• Wind Speed
• Wind Direction
• Precipitation
• Temperature
• UV
• Lightning
• Pressure
• Humidity
Weather Station
https://www.wunderground.com/pws/installation-guide
15. Why the Weather Carrier Board?
Instructions and
deceptively simple
starter code!
16. MicroMod Processors
32-bit ARM Cortex-M4F MCU
120 Mhz
1 MB Flash Memory
256K SRAM
ARM Cortex-M4 CPU
2.4 GHz Bluetooth
I2C buses, 2 SPI buses,
11 GPIO
Dedicated digital,
Analog pins PWM & PDM
UARTS
Dual-core Tensilica LX6
240MHz clock frequency
520kB internal SRAM
128mbit/16MB flash storage
802.11 BGN WiFi transceiver
ARM Cortex-M4 with BLE 5.0
96 MHz
Runs TensorFlow Lite
Bluetooth
I2C buses, 2 SPI buses,
8 GPIO
Dedicated digital,
Analog pins PWM
17. MicroMod Processor
General Features
• Dual-core Tensilica LX6
microprocessor
• Up to 240MHz clock frequency
• 520kB internal SRAM
• 128mbit/16MB flash storage
• Integrated 802.11 BGN WiFi
transceiver
• 2.7 to 3.6V operating range
• 500µA sleep current under hibernation
• 10-electrode capacitive touch support
• Hardware accelerated encryption
(AES, SHA2, ECC, RSA-4096)
Available Peripherals
• 1x USB dedicated for
programming and debug
• 1x UART
• 2x I2C
• 1x SPI
• 7x GPIO
• 2x Digital Pins
• 2x Analog Pins
• 2x PWM
• Status LED
• VIN Level ADC
ESP32 Processor
(71.15 zł)
https://tinyurl.com/2wufrfes
18. Measuring Rainfall
• Rain gauge is a self-emptying tipping bucket
• 0.2794mm rain causes one momentary
contact closure
• Events sent via interrupts
• Possible noise…
19. Measuring Wind
• Wind speed measured using
cup-type anemometer
• Speed measured by closing a
contact as a magnet moves past
a switch
• A wind seed of 2.4km/h causes
the switch to close once per
second
• Wind vane has eight switches,
each connected to a different
resistor.
• Vane’s magnet may close two
switches at once, allowing 16
different positions.
20. MicroMod Weather Carrier Board
M.2 MicroMod Connector – micomod
processor
USB-C Connector – used for powering and
loading code from comuter
3.3V Regulator (3.3V sources up to 1A)
Qwiic Connector
Boot/Reset Buttons
RTC Backup Battery & Charge Circuit
microSD Slot – FAT32 micoSD card
Hold down “Boot” to load code.
23. UV Sensor
• VEML6075 UV Sensor
• UVA (320-400 nm, peak @365 +/- 10nm)
• UVB (228-320 nm, peak @330 +/- 10nm
• Irradiance for UV Index
• Connected on I2C bus address: 0x10
• #include
<SparkFun_VEML6075_Arduino_Library.h>
24. Lightning Detector
• AS39335 Lighting Detector
• Detects lightning up to 40km away
• Connected to SPI bus
• #include "SparkFun_AS3935.h“ –
library to simplify working with the
sensor
29. Water Proof Cable Glands
• Prevents water from
getting into junction
boxes
• 51 zł
30. Coding ESP32
https://www.arduino.cc/
Coding
• ESP32 coded in C++
• Depends upon multiple
libraries
• Sparkfun provides a library
for MicroMod
Challenges
• Never got it to work on the
Mac!
Two Hooks:
setup – initialization code
loop – repeatedly invoked
31. Selecting Development Board
Arduino IDE | Settings
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-
pages/package_esp32_index.json
47. Arduino JSON Library
• ArdionoJson – C++ library for working
with JSON
• https://arduinojson.org/
• Handles reading/writing/streaming
• ArduinoJson Assistant – website for
calculating data sizing
• https://arduinojson.org/v6/assistant
• Added via Arduino Library Manager
56. ZigBee – Alternative to WiFi
• Wireless standard 802.15.4, Low-rate Wireless Personal Area
Network (LR-WPAN).
• 250 kps on a CSMA/CA network.
• Supports mesh networking
• Supply voltage: 2.8-3.4V
• Distance: 100m indoor, 300m outdoor
• Current: 45 mA RX 50 mA TX
• Frequency: 2-4 GHz, 16 channels
• Implements error checking and retries.
• Two communication modes:
• AT - transparent mode - serial communication.
• API - programmatic packaging of the data.
59. XBee First Atttempt
• XBee3 Thing Plus
• Combines Xbee + Qwiic
• Programmed using
MicroPython
• Supports battery
monitoring
BUT… EP32 wants to be I2C Master,
XBee3 Thing Plus wants to be I2C
Master. Two masters on the I2C bus..
Not workable… $120 wasted…
70. What is MQTT
• MQTT (Message Queuing Telemetry Transport) is a
lightweight messaging protocol designed for efficient
communication between IoT devices.
• Bandwidth Efficiency: The protocol uses a compact
binary format, minimizing the data transferred over the
network.
• It follows a publish-subscribe pattern, where devices can
publish messages to topics, and other devices can
subscribe to those topics to receive the messages.