ESPEASY-BME280-Thingspeak

ESP12E Connect BME280 /BME280 โดยทั่วไปต่อ 

VCC (3.3v) – 3.3V

GND – GND

GPIO5   – SCL

GPIO4  –  SDA

ถ้าต่อแล้วส่งไม่ได้ หรือประสบปัญหาให้ต่อ

GND – SDO

 

ในการตั้งค่า BMx280 ใน Device

ให้ตั้งค่า Interval นานๆ หน่อย 

สำหรับ Thing Speak ใน Controller  ถ้าเลือก 

IP Address ให้ใช้ 184.106.153.149 

Minimum Send Interval 15000 ms  (15 วินาที) 

Check Reply:Check Acknowledgement

Install Domoticz on Ubuntu 18 Google Cloud

sudo curl -L install.domoticz.com | bash

ถ้าไม่สำเร็จ

cd /tmp
wget https://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz
tar -zxvf domoticz_linux_x86_64.tgz
ใช้ mc copy ไปที่ /home/userxxxx/domoticz
cd /home/userxxxx/domoticz/
sudo ./domoticz
ตั้งค่าตามแบบ
Status: PluginSystem: Failed dynamic library load, install the latest libpython3.x library that is available for your platform.
apt install python3
sudo apt-get install libpython3-dev

Domoticz install on ubuntu problem

error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

apt-get install –reinstall openssl

error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

apt-get install libxss1

/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27′ not found

DIY Soil Moisture Sensor

SparkFun Soil Moisture Sensor

2N3904 Transistor same as:BC547,BC598,BC599,2N2222,BC107,2N2907,BC327,BC327,C9013,C1815,C4012,C4012,BC377 (printed C33725),C338

ref:https://www.sparkfun.com/products/13322?_ga=2.88403867.1446786914.1610372384-655404040.1609953707

faludi.com

ref:https://www.faludi.com/2006/11/02/moisture-sensor-circuit/

ESP12 Flash TTL Pin

https://microcontrollerslab.com/wp-content/uploads/2020/01/ESP-12E-Pinout-1280×720.png

Arduino Uno Wind Speed Way 2

#include <math.h>
#include <millisDelay.h>

#define windSensorPin 2
millisDelay timerDelay;

int windCounter = 0;
float windSpeedM = 0;
float windSpeedK = 0;
int windPulse = 0;
int pulses = 0;
int startTest = 1;
int windTest1 = 1;
int windTest2 = 0;
int windTimer = 1;
int result = 1;

int timerStart = 1;

void setup() {
// Set console baud rate
Serial.begin(19200);
pinMode(windSensorPin, OUTPUT);
// pinMode(RainPin, OUTPUT);
// pinMode(windDirectionPin, INPUT);
delay(10);

}

void loop() {
if (digitalRead(windSensorPin) < 1 && startTest == 1 )
{
// windDirValue = analogRead(windDirectionPin);
// windDir = map(windDirValue, 1, 1024, 1, 5000);
windTest1 = 1;
windTest2 = 1;
windTimer = 1;
result = 1;
startTest = 0;
}
WindSpeed();
if (digitalRead(windSensorPin) < 1 && timerStart == 1)
{
timerDelay.start(3000);
result = 1;
timerStart = 0;
}
if (timerDelay.justFinished() && result == 1)
{
windSpeedM = 1.25 * (pulses/3);
windSpeedK = windSpeedM * 1.60934;
Serial.print(“WindSpeed: “);
Serial.print(windSpeedM);
Serial.print(” mph tt”);
Serial.print(windSpeedK);
Serial.println(” kphtt”);

// Blynk.virtualWrite(V2,windSpeed);
pulses = 0;
windSpeedM = 0;
startTest = 1;
result = 0;
timerStart = 1;

}

}
void WindSpeed()
{
if (digitalRead(windSensorPin) < 1)
{
windCounter++;
}
if (windCounter > 0 && digitalRead(windSensorPin) == 1 && windTest1 == 1)
{
windPulse += 1;
windCounter = 0;

}

if (windPulse == 3 && windTest2 == 1)
{
pulses += 2;
//Serial.println(pulses);
windPulse = 0;
}

}

ref:https://community.createlabz.com/knowledgebase/mini-weather-station-rain-gauge-wind-speed-wind-direction-using-blynk-and-sim800c/

Arduino Uno Wind Speed Way 1

#include “TimerOne.h” // Timer Interrupt set to 2 second for read sensors
#include <math.h>
#include <Time.h>

// speed ok near speed-3.ino

#define WindSensorPin (2) // The pin location of the anemometer sensor
char wind[10]; //empty array where to put the numbers going to the master

int LastValue;
//int wind = 0;
volatile bool IsSampleRequired; // this is set true every 2.5s. Get wind speed
volatile unsigned int TimerCount; // used to determine 2.5sec timer count
volatile unsigned long Rotations; // cup rotation counter used in interrupt routine
volatile unsigned long ContactBounceTime; // Timer to avoid contact bounce in interrupt routine
float WindSpeed; // speed miles per hour
byte x = 0;

void setup() {
Serial.begin(19200);
pinMode(WindSensorPin, INPUT);
attachInterrupt(digitalPinToInterrupt(WindSensorPin), isr_rotation, FALLING);
Serial.println(“Davis Anemometer Test”);
Serial.println(“Speed (MPH)tKnotstDirectiontStrength”);
Timer1.initialize(500000);
Timer1.attachInterrupt(isr_timer);

}

void loop() {
if(IsSampleRequired)
{
// convert to mp/h using the formula V=P(2.25/T)
// V = P(2.25/2.5) = P * 0.9
WindSpeed = Rotations * 0.48;

Rotations = 0; // Reset count for next sample
// wind = WindSpeed;

IsSampleRequired = false;

Serial.print(WindSpeed); Serial.println(“tt”);
// Serial.print(getKnots(WindSpeed)); Serial.print(“t”);
// Serial.print(CalDirection);
// getHeading(CalDirection); Serial.print(“tt”);
// getWindStrength(WindSpeed);

}
}
void isr_timer() {

TimerCount++;

if(TimerCount == 5)
{
IsSampleRequired = true;
TimerCount = 0;
}
}
void isr_rotation () {

if ((millis() – ContactBounceTime) > 15 ) { // debounce the switch contact.
Rotations++;
ContactBounceTime = millis();
}

ref:http://cmfc-weatherstation.blogspot.com/2016/