Assembling a test system - crestlinesoaring/ArduinoWeatherStation GitHub Wiki

Introduction

The weather station software in this repository runs on an Arduino and depends on interacting with a number of hardware devices. To effectively test software changes, you will need to assemble some subset of the system hardware and run code on that assembly. This page describes how to assemble such a system. It assumes you have already followed the instructions in Getting started.

Only 3 hardware units needed to get the software going:

Arduino Mega 2560 (the Brain)
Ethernet shield (to connect via ethernet)
Real Time Clock (EEPROM and time update)

Arduino Mega 2560

Rev3 is needed, can be a good clone
https://www.amazon.com/Ethernet-Shield-Network-Expansion-Arduino/dp/B00AXVX5D0
or this:
https://store.arduino.cc/usa/arduino-mega-2560-rev3

(don't forget a USB A to B Type Male cable to both power and connect your arduino to your dev machine)

Arduino Ethernet shield R3 with micro SD connector

Only V5 clone
https://www.amazon.com/dp/B00HG82V1A
https://www.amazon.com/dp/B01E5JY7UU
https://www.amazon.com/dp/B00HG82V1A

are recommended, since the power-on circuitry of the original Adafruit:
https://www.adafruit.com/product/201
might cause problems in the field (this was changed in Brain1 Rev5, so now clones with a reset chip are ok, too).
For development and desktop usage, any Rev 3 clone (W5100) is fine.

Real Time Clock (RTC), EEPROM storage

We're using the amazing DS3231N (DS3231M can be used for Desktop use also) ZS-042 as a real time clock and as an EEPROM storage.
https://www.amazon.com/SongHe-AT24C32-Arduino-Without-Battery/dp/B082VL4GM6
see
https://forum.arduino.cc/index.php?topic=278270.0
https://thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/

Dupont Jumper Wire Ribbon Cables

To connect RTC and EEPROM unit to Mega
A set with 10-20 each of Female/Female, Male/Female, and Male/Male, 20cm or 30cm long is recommended.

Software

Now turn the
#define ENABLE_HARDWARE_SIMULATION
flag on by removing the "//" and upload the most current version (please contact for the most current version)
This allows for a smooth operation without the peripherals
. .

Assembly

Starting with the Arduino Mega 2560, first add the Ethernet shield by stacking it on top. The 6-pin connector in the center of the Arduino should line up with the Ethernet shield. Plug the Ethernet shield into an ethernet switch or router that has access to the internet.

In the Arduino IDE, click File -> Examples -> DhcpAddressPrinter, upload that sketch, and open the serial monitor (making sure it is set at 9600 bauds). If you get a message saying My IP address: xxx.xxx.xxx.xxx, then the test is a success. If not, you'll need to troubleshoot.

Now open Examples -> WebClient, upload the sketch, and watch the serial monitor. If you see HTTP/1.0 200 OK, plus some additional text, plus a long string of characters, then the test is a success. If not, you'll need to troubleshoot.

Add RTC:
https://www.instructables.com/id/Real-time-clock-using-DS3231-EASY/

Please note that a Baudrate of 115200 is used for the terminal.
.

Additional peripherals needed for actual WX:

Wind direction and speed sensors

Wind direction and speed sensors

Voltage and Current sensors

Two INA219 are used to measure solar panel Volt&Amp, and Battery Volt&Amp.
They are both modded (added shunt resistor) to withstand a higer current with less losses.

4 Channel P-MOSFET Driver (YYD-3)

Turns on/off peripherals like the cameras and Ubiquiti internet link.
https://www.ebay.com/itm/Trigger-Switch-Module-4-way-FET-MOS-DC-Control-for-PWM-Motor-Pump-LED-O6BS/373636010868

4 or 2 Channel 12V Relay Board

Used to briefly disconnect 12V power from most peripherals to allow for a reliable power off/on reboot (Pboot).
And for for emergency (overload) battery shutoff
Can be 2 channel in future.

Environmental Sensors

One external and one internal BME280 (5V!! versions needed!) are used to measure internal (i.e. inside enclosure) heat and humidity, and external temperature.
https://www.ebay.com/itm/New-BME280-Digital-Sensor-Temperature-Board-GY-BME280-I2C-IIC-SPI-Interface-5V/292563069504
https://www.amazon.com/TOOGOO-GY-BME280-Pressure-Temperature-Arduino/dp/B075XH141L
https://www.amazon.com/d/Temperature-Sensors-Probes/TOOGOO-Temperature-Humidity-Barometric-Pressure/B075LGSGJW

Glueboard

Connects/distributes signals from Mega to FET switches, has DC/DC converter and controls power to the Ethernet Shield. Anemometer and speed sensor are also connected to the Glueboard.
Has RTC with Pboot circuit and SD card reader.
From Brain3 on the Glueboard will be sandwiched between Mega 2560 and Ethernet shield.

Wireless Link to the Internet

Ubiquiti NSM5 is used to connect MWX and her cameras to the internet. To use the Ubiquiti radio link, first plug the NSM5 into the PoE adapter that comes with it, plug the PoE adapter into power, and connected your computer directly to the LAN port on the PoE adapter. In Control Panel, go to Network and Sharing Center. Right click on your wired Ethernet adapter and select Properties. Click the "Internet Protocol Version 4 (TCP/IPv4)" option and click Properties. Select "Use the following IP address" and enter 192.168.1.123 in the IP Address box. Use a subnet mask of 255.255.255.0 and click Ok. In a browser, go to http://192.168.1.20 (or whatever the NSM5 documentation specifies). For testing, go to the Wireless tab and turn the Output Power all the way down.

Solar Panel, Charge Controller, and 12V Battery