Difference between revisions of "Node WND"

From NebarnixWiki
Jump to navigationJump to search
 
Line 27: Line 27:
 
==Pinout==
 
==Pinout==
  
  Pin 1 DHT GND
+
  Pin 1 DHT|SHT GND
  Pin 2 DHT Vcc (3.3V)
+
  Pin 2 DHT|SHT Vcc (3.3V)
 
   
 
   
  Pin 3 DHT1 Data
+
  Pin 3 DHT1 Data | SHT31_SDA
  Pin 4 DHT2 Data
+
  Pin 4 DHT2 Data | SHT31_SCL
 
   
 
   
 
  Pin 5 WND Data (must be filtered for bounce)
 
  Pin 5 WND Data (must be filtered for bounce)

Latest revision as of 10:49, 8 September 2022

Problem Statement

I want to test a temperature / humidity sensor on my porch that will tie into the Raspi datalogger and visualization system. I want to use the EZ430-CC2500 because they are cheap and I have template code written already in MSPGCC. I want to use the DHT22 because I have a couple, and it seems like an affordable solution. It should be powered from a solar panel or other harvested source.

Update August 2021: I want to measure the wind speed, and this sensor is already in an ideal location for a 3D printed anemometer. In any case it will make a great testbed.

Update August 2022: I want to measure the rain, and this sensor *might* be in an ideal location for a 3D printed tipping bucket gauge. In any case it will make a great testbed.

Update September 2022: DHT22 sucks - temp is good but humidity has drifted *WAY* off over the past two years of installation. Replace it with an SHT31?

System Overview

EZ430-CC2500 runs an MSP430F2274 and a CC430 chip for a 1mW 2.5Ghz radio, which I am running at 250kbps for short burst speeds and hopefully less packet collisions between various nodes reporting at random intervals.

Wind will be counted with a magnet on the rotor and a reed switch on the stator of a 3D printed anemometer. Sustained wind will be reported as total number of pulses recorded within a 2 minute nonoverlapping interval. Gust will be reported as maximum 3 second period (nonoverlapped 3 second chunks) within the 2 minute window. Data, especially gusts, may be misreported if spread across the non overlapping intervals, maybe my algorithm could use some improvement. Scaling and calibration will be done server side.

Rain will be counted using a magnet on a tipped bucket gauge with a reed switch on the gauge. Total rainfall will be reported as the total number of pulses recorded since power on. Cleared data, and data calibration (volume per dump and collection aperture) will be performed server side.

Data for the reed switches is counted using interrupt GPIOs, and needs filtered to prevent switch bounce from registering as high rate data. A low pass filter was designed with a debounce time of ~35mS and a reset time of ~3mS. Care must be taken not to dump any filter capacitor elements directly into the reed switch as this will cause an overcurrent pulse and damage the contacts.

DHT22 Library

Adafruit Arduino DH22 library converted to MSP430 C from Arduino C++.

SHT31 Library

Software I2C library ported badly from Andy4495's Arduino C++ library to MSP430 C.

Pinout

Pin 1 DHT|SHT GND
Pin 2 DHT|SHT Vcc (3.3V)

Pin 3 DHT1 Data | SHT31_SDA
Pin 4 DHT2 Data | SHT31_SCL

Pin 5 WND Data (must be filtered for bounce)
Pin 6 RAIN Data (must be filtered for bounce)

Pin 9 Solar Panel Voltage (3.3Vmax! divide by 2!)
Pin 10 Lipo Voltage (3.3Vmax! divide by 2!)

Port Definitions

#define VSOLAR BIT4 //on port 4
#define VBATT BIT5 //on port 4

#define DHT1 BIT0  //on port 2
//for future dual probes?
#define DHT2 BIT1  //on port 2

#define WIND BIT2 //on port 2
#define RAIN BIT3  //on port 2

//board resources
#define BUTTON BIT2  //on port 1
#define LED_RED BIT0 //on port 1
#define LED_GRN BIT1 //on port 1