NodeMcu Lua v2 沒藍芽, 一個ADC。
ESP8266 九十九元好便宜拿來做基本實驗也好,
比ESP32窄, 放在麵包板上 拉線也方便!
NodeMcu Lua v2、WIFI 物聯網開發板 ESP8266
安裝
Nodemcu V2 芭蕉葉上聽雨聲 ---
安裝 教導 下載 CP2102 驅動程式 使用 Arduino IDE Lua 編輯器
...
「Boards Manager...」。
(出現「Boards Manager」對話窗)
Step6 捲動右側拉桿到下方,點擊「esp8266 by ESP8266 Community」那一欄,再點擊「Install」鈕。
...
Step2 點擊「工具」>「板子」,選擇「NodeMCU 1.0 (ESP-12E Module)」。
購買
露天99元 NodeMCU V2 CP2102 USB chip
實作
12. 待測 96x64 SPI color oled
https://www.arduitronics.com/product/1403/rgb-oled-0-95-96x64-pixels-16-bit-color-oled-spi-interface
11. 待測 觸控螢幕.蓋格計 geiger-counter-esp8266-touchscreen/
10. 待測4 PINs touch-panel-module
9.待測 -wemos-tft-2.4"觸控螢幕
觸控螢幕TFT
8. ESP8266 + WIFI
https://github.com/AutoConnect/AutoConnect.ino 待測
https://github.com/esp8266/Arduino 到LIBRARY目錄看所需libraries
7.ESP8266 + BLUETOOTH
https://circuitdigest.com/microcontroller-projects/using-classic-bluetooth-in-esp32-and-toogle-an-led
csjhmaker bluetooth
https://blog.csdn.net/huibei_wuhan/article/details/83592075
6. IRreceiving yehnan.blogspot.com/2013/05/IR
5. Wi-Fi smartconfig with ROM
wyj-learning.blogspot.com/2018/03/nodemcu-15nodemcu-smartconfig
stonez56.blogspot/2019/01/voice-control-MQTT
4.
Dust sensor
2019 /04/11 OK
實驗成功_laser_dust_sensor_SKU:SEN0177
/*接線 注意 PMS 7003 TX 接 esp8266 RX , PMS7003 RX(可不接) to esp8266 TX*/
//******************************
//*Abstract: Read value of PM1,PM2.5 and PM10 of air quality
//
//*Version:V3.1
//*Author:Zuyang @ HUST
//*Modified by Cain for Arduino Hardware Serial port compatibility
//*Date:March.25.2016
//******************************
/*接線 注意 PMS 7003 TX 接 esp8266 RX , PMS7003 RX(可不接) to esp8266 TX*/
#include <Arduino.h>
#define LENG 31 //0x42 + 31 bytes equal to 32 bytes
unsigned char buf[LENG];
int PM01Value=0; //define PM1.0 value of the air detector module
int PM2_5Value=0; //define PM2.5 value of the air detector module
int PM10Value=0; //define PM10 value of the air detector module
void setup()
{
Serial.begin(9600); //use serial0
Serial.setTimeout(1500); //set the Timeout to 1500ms, longer than the data transmission periodic time of the sensor
}
void loop()
{
PM01Value=0;
PM2_5Value=0;
PM10Value=0;
if(Serial.find(0x42)){ //start to read when detect 0x42
Serial.readBytes(buf,LENG);
if(buf[0] == 0x4d){
if(checkValue(buf,LENG)){
PM01Value=transmitPM01(buf); //count PM1.0 value of the air detector module
PM2_5Value=transmitPM2_5(buf);//count PM2.5 value of the air detector module
PM10Value=transmitPM10(buf); //count PM10 value of the air detector module
}
}
}
static unsigned long OledTimer=millis();
if (millis() - OledTimer >=1000)
{
OledTimer=millis();
Serial.print("PM1.0: ");
Serial.print(PM01Value);
Serial.println(" ug/m3");
Serial.print("PM2.5: ");
Serial.print(PM2_5Value);
Serial.println(" ug/m3");
Serial.print("PM1 0: ");
Serial.print(PM10Value);
Serial.println(" ug/m3");
Serial.println();
}
}
char checkValue(unsigned char *thebuf, char leng)
{
char receiveflag=0;
int receiveSum=0;
for(int i=0; i<(leng-2); i++){
receiveSum=receiveSum+thebuf[i];
}
receiveSum=receiveSum + 0x42;
if(receiveSum == ((thebuf[leng-2]<<8)+thebuf[leng-1])) //check the serial data
{
receiveSum = 0;
receiveflag = 1;
}
return receiveflag;
}
int transmitPM01(unsigned char *thebuf)
{
int PM01Val;
PM01Val=((thebuf[3]<<8) + thebuf[4]); //count PM1.0 value of the air detector module
return PM01Val;
}
//transmit PM Value to PC
int transmitPM2_5(unsigned char *thebuf)
{
int PM2_5Val;
PM2_5Val=((thebuf[5]<<8) + thebuf[6]);//count PM2.5 value of the air detector module
return PM2_5Val;
}
//transmit PM Value to PC
int transmitPM10(unsigned char *thebuf)
{
int PM10Val;
PM10Val=((thebuf[7]<<8) + thebuf[8]); //count PM10 value of the air detector module
return PM10Val;
}
阿玉的網站---我用PMS700320190411實驗成功
/* 2019 04 12 PM2.5 dht22 讀取資料 OLED 顯示成功*/
以前 使用的PM2.5感應器GP2Y1014,不太精準 有時還抓到負值。
於是到eBay 買了兩個PMS7003。
實驗了兩組網路抓的PM2.5讀取程式。
其中一組昨天可讀取及顯示到Oled,但整合溫濕度計,就罷工。
今天早餐後, 使用另一網站的PM2.5讀取程式, 再整合溫濕度程式。
成功了。
下一步 , 還要加入 PM2.5過高時, 要能啟動風扇 過濾空氣的功能。
dust_wifi
esp8266 ---pmsx003
pms-3003--- lcd --- 程式碼
co2 dht pm2.5 -air-sensor-by-yourself/
esp32-pm2-5-pm10-with-honeywell-hpma115
3. output high, Motor runs
2 .
esp866--dht22-但是使用 dht bege e Tokyo library 跟我用在ESP32一樣的library
esp8266--dht22-web-server-tutorial
128*64oled-display-with-dht22-/ESP8266
1.esp8266dht. web-server-with-arduino-ide/
DHT22 讀取資料為 nan 之處理
A 網頁控制nodemcu-led ---
含安裝 但不須用 Lua編輯器
2019.3.10飯後,在另一台PC
安裝 arduino 1.8 , 開發板使用node mcu 1.0 esp12e 。
並Copy這個網頁 的程式 測試 網頁控制LED 亮跟滅 成功 。
但是 原始程式要修改一下 就是 手機連上網頁後,按led Off時候 LED要輸出LOW電位, 反之,按 led on的時候要輸出 HIGH電位。
B I2C OLED 128x32 , SCL---GPIO5, SDA---GPIO4, 3.3V, GND
http://arduino-er.blogspot.com/2016/04/nodemcu-esp8266-to-display-on-128x64.html
1. modify file C:\Users\user\Documents\Ardkuino\libraries\Adafruit_SSD1306\ Adafruit_SSD1306.h
#define _Adafruit_SSD1306_H_
// ONE of the following three lines must be #defined:
#define SSD1306_128_64 ///< DEPRECTAED: old way to specify 128x64 screen
//#define SSD1306_128_32 ///< DEPRECATED: old way to specify 128x32 screen
2. 程式內
#define OLED_RESET
LED_BUILTIN // default 4 Reset pin # (or -1 if sharing Arduino reset pin)
3. 結果 以上兩步驟 OLED都沒顯示,
修改第一步 //#define SSD1306_128_32 為#define SSD1306_128_32
再次證明買家給我的是 128x32
C. I2C OLED 顯示中文
電子老兵
D. ESP8266 dht22
彼得潘的-開發教室/-arduino-uno-esp8266-dht-22
其他
程式下載
silabs Download for Windows 10 Universal (v10.1.4)
arduino IDE 1.8.8 直接下載IDE 1.8.8
參考網頁
https://www.instructables.com/id/ESP8266-WiFi-touch-screen-thermostat/
Use the BME280 sensor instead, has humidity, temperature and pressure, all in one :)
Also, the RTC may not be necessery, someone tested the time keeping of the ESP8266 and it was only 1 sec off per day, so running NTP sync every day(s)/week would be sufficient, also, the DS1302 is not even that precise, if one wants a good one, get the DS3231
nodemcu V2 芭蕉葉上聽雨聲 NodeMCU DEVKIT V1
https://www.youtube.com/網友Th27a介紹
產生 BIN檔案 Arduino>檔案>偏好設定>顯示詳細輸出: 編譯 , 上傳 打勾 , Arduino>草稿碼>匯出以編譯的二進位檔 ------> 2/27/2020 OK. 但 Arduino>上傳, 卻出現"error: espcomm_open failed". <<< 不外接設備 重新上傳成功, 如此不用每次都編譯再加上傳, 速度快很多了!