2025年2月15日 星期六

[AMEBA]Datalogger Iot - Sensirion 的三個環境感測器,SHT40、SCD41、SGP41

SHT40、SCD41、SGP41

這次 Datalogger Iot 收編三個 Sensirion 感測器,所以一次一併在這裡分享

 qwiic,datalogger iot


由上圖所示, QWIIC (I2C) 連接器的好處是在增加感測試使用也不會多佔腳位。功能卻增加了

SHT40 模組

SHT40


SHT40 模組是一款由 Sensirion 公司製造的高精度低功耗溫濕度感測器,主要用於環境監測和控制應用。以下是該模組的主要特點與應用:

  • 主要特點
    • 高精度測量 : SHT40 提供高達 ±1.5% RH 的濕度精度和 ±0.3°C 的溫度精度,適合需要精確環境數據的應用
    • 低功耗設計 : 該模組設計為超低功耗,適合電池供電的設備,並且支持 I2C 通訊協議,便於與各種微控制器和開發板連接
    • 快速響應時間 : 採樣時間為 3 秒
  • 應用領域
    • 智慧家居
    • 工業自動化
    • 農業物聯網
  • 基本規格
    • 溫度測量範圍 : -40°C 至 +125°C
    • 溫度測量精度 : ±0.2°C
    • 濕度測量範圍 : 0% 至 100% 相對濕度
    • 濕度測量精度 : ±1.8% RH(在 25% 至 75% RH 範圍內)
  • 通訊與電源
    • 通訊接口 : I2C
    • 工作電壓 : 3.3V 至 5V
    • 工作電流 : 約 0.45 mA
  • 安裝程式庫
    • Adafruit_SHT4X
  • 程式範例

SGP41 模組

SGP41




SGP41 模組是一款由 Sensirion 公司開發的室內空氣品質感測器,專門用於測量揮發性有機化合物(VOCs)的濃度。以下是其主要特點和技術規格:

  • 主要特點
    • 高靈敏度 : SGP41 能夠檢測的 VOC 濃度範圍為 0 到 1000 ppm,並且具有快速的響應時間(小於 10 秒)
    • 數位輸出 : 該模組提供兩個數位的 16 位原始信號輸出,並能生成 0 到 500 的 VOC 指數,便於用戶進行空氣品質評估
    • 濕度補償 : SGP40 配備片上濕度補償功能,以提高測量準確性,特別是在變化的環境條件下
    • 低功耗設計 : 其工作電壓範圍為 1.7 到 3.6 V,平均供電電流為 2600 µA,最大供電電流為 3000 µA,適合長時間運行的應用
  • 安裝程式庫
    • Sensirion I2C SGP41
  • 程式範例
    • https://github.com/cold63/Datalogger_Iot/tree/main/src/main_board/sht40_sgp41


SGP41:除了具備 SGP40 的 VOC 檢測功能外,還能同時檢測氮氧化物(NOx),這使得 SGP41 能夠提供更全面的空氣品質監測,特別是在包含污染物的環境中。



SCD41 模組

scd41


SCD41模組是一款高精度的二氧化碳(CO2)感測器,基於光聲非分散紅外(NDIR)技術,專為環境監測而設計。以下是有關SCD41模組的詳細介紹:

  • 技術原理
    • 光聲NDIR技術 : SCD41利用光聲效應來檢測CO2濃度。當紅外線脈衝照射到CO2分子時,這些分子會吸收特定波長的光,導致其振動增加,進而產生壓力波。這些壓力波的強度與CO2濃度成正比,感測器透過內部麥克風來測量這些波動,以計算出CO2濃度
  • 主要特點
    • 測量範圍 : SCD41能夠測量400至5000 ppm的CO2濃度,適合於室內空氣質量監控。
    • 內建溫濕度感測 : 除了CO2濃度外,SCD41還能提供環境的溫度和濕度數據,並透過這些數據進行訊號補償,以提高測量準確性
    • 小型化設計 : 該模組具有極小的外形尺寸,便於集成到各種設備中,特別適合於需要空間限制的應用
  • 室內空氣品質監測:可廣泛應用於家庭、辦公室、學校等環境,以監控和改善空氣品質。
  • 安裝程式庫
    • Sensirion SCD4x sensors
  • 程式範例
    • https://github.com/cold63/Datalogger_Iot/tree/main/src/main_board/sht40_scd41

購買連結 :

2024年3月15日 星期五

[AMEBA] Datalogger Iot (RTL8720DF) Arduino/RS485應用板

Datalogger IOT(RTL8720DF) Arduino/RS485應用板 有以下特點

  1. 針對工業應用需求設計的 UNO 開發板
  2. 內建 qwiic 介面,支援多種 I2C 傳感器模組快速擴充
  3. 集成 RS485 通訊介面,內置 PTS 和 TVS 保護電路
  4. 內置專用 PMS5003 顆粒物傳感器連接器,方便接線
  5. 支援 12V~24V 直流電源輸入,適用於工業電源供應
  6. PCB 板上設有電源管理、過載和短路保護功能
  7. 擴展接腳包括 GPIO、ADC、PWM 等,滿足多樣化需求
  8. 附帶 Arduino IDE 開發環境和豐富的範例程式碼
  9. 體積小巧,適合嵌入式工業設備和現場監控應用
  10. 可廣泛應用於工業自動化、環境監測、智慧城市等領域

Datalogger 應用板本體

  • DC IN : 6V ~ 24V
  • DC OUT: 5V /1A
  • Arduino uno 定位孔
  • 連接器: qwiic ( I2C)、UART(JST2.0)、RS485
  • UART 擴展
  • RS485 具有 TVS + PTS 保護

開發板針對工業應用的特點:

  1. 支持工業標準的 RS485 通訊介面及其相關保護電路
  2. 可接入常用的 PMS5003 顆粒物傳感器進行環境監測
  3. 適用於工業電源環境的 12V~24V 直流輸入設計
  4. 具備完整的電源管理和保護機制,提高系統穩定性
  5. 擴展接腳涵蓋工業控制所需的各類輸入輸出

核心

RTL8720DF
32-bit KM4 (Arm Cortex-M33 compatible)
32-bit KM0 (Arm Cortex-M23 compatible)
512KB SRAM + 4MB Flash

KEY FEATURES

Integrated WiFi 4 (802.11b/g/n 1x1) SoC
Dual-band, 2.4Ghz or 5GHzBluetooth LE 5.0
Bluetooth high-power mode up 10dB
Low Power Mode
Auto Download Mode
3 UART interface
1 I2C interface
2 SPI interface
12 PWM interface
1 IR interface
Max 18 GPIO


實務應用

  • 建築自動化
    • 收集大樓內的溫度、濕度、照度等環境資訊
    • 控制照明系統、電梯系統等
    • 工業自動化
      • 從PLC等設備收集生產線的各項參數
      • 監控設備運作狀況,進行故障預測和預防性維護
    • 能源管理系統
      • 監測發電廠、變電站的運行狀況
      • 收集用電量資訊,實現能源的集中管理和最佳化配置
    • 農業物聯網
      • 收集農場的溫濕度、土壤PH值等數據
      • 協助農民分析數據,優化種植和灌溉管理

    專用 USB 程式碼上傳工具

     

    基本擴展板

    擴展板由以下功能組成

    • OLED 0.96" 顯示器
    • 24C02 EEPROM x 1
    • SD CARD (Micro SD)
    • 2 個按鍵 ( Reset重置 及 USER Key)
    • 2.54mm 及 2.00mm 洞洞板自行功能擴展焊接區塊

    資源

    開發板介紹



    安裝及使用


    立即購買




    2024年3月11日 星期一

    [AMEBA] Datalogger Iot (RTL8720DF) Arduino/RS485應用板

    Datalogger IOT(RTL8720DF) Arduino/RS485應用板 有以下特點

    1. 針對工業應用需求設計的 UNO 開發板
    2. 內建 qwiic 介面,支援多種 I2C 傳感器模組快速擴充
    3. 集成 RS485 通訊介面,內置 PTS 和 TVS 保護電路
    4. 內置專用 PMS5003 顆粒物傳感器連接器,方便接線
    5. 支援 12V~24V 直流電源輸入,適用於工業電源供應
    6. PCB 板上設有電源管理、過載和短路保護功能
    7. 擴展接腳包括 GPIO、ADC、PWM 等,滿足多樣化需求
    8. 附帶 Arduino IDE 開發環境和豐富的範例程式碼
    9. 體積小巧,適合嵌入式工業設備和現場監控應用
    10. 可廣泛應用於工業自動化、環境監測、智慧城市等領域

    Datalogger 應用板本體

    • DC IN : 6V ~ 24V
    • DC OUT: 5V /1A
    • Arduino uno 定位孔
    • 連接器: qwiic ( I2C)、UART(JST2.0)、RS485
    • UART 擴展
    • RS485 具有 TVS + PTS 保護

    開發板針對工業應用的特點:

    1. 支持工業標準的 RS485 通訊介面及其相關保護電路
    2. 可接入常用的 PMS5003 顆粒物傳感器進行環境監測
    3. 適用於工業電源環境的 12V~24V 直流輸入設計
    4. 具備完整的電源管理和保護機制,提高系統穩定性
    5. 擴展接腳涵蓋工業控制所需的各類輸入輸出

    核心

    RTL8720DF
    32-bit KM4 (Arm Cortex-M33 compatible)
    32-bit KM0 (Arm Cortex-M23 compatible)
    512KB SRAM + 4MB Flash

    KEY FEATURES

    Integrated WiFi 4 (802.11b/g/n 1x1) SoC
    Dual-band, 2.4Ghz or 5GHzBluetooth LE 5.0
    Bluetooth high-power mode up 10dB
    Low Power Mode
    Auto Download Mode
    3 UART interface
    1 I2C interface
    2 SPI interface
    12 PWM interface
    1 IR interface
    Max 18 GPIO


    實務應用

    • 建築自動化
      • 收集大樓內的溫度、濕度、照度等環境資訊
      • 控制照明系統、電梯系統等
      • 工業自動化
        • 從PLC等設備收集生產線的各項參數
        • 監控設備運作狀況,進行故障預測和預防性維護
      • 能源管理系統
        • 監測發電廠、變電站的運行狀況
        • 收集用電量資訊,實現能源的集中管理和最佳化配置
      • 農業物聯網
        • 收集農場的溫濕度、土壤PH值等數據
        • 協助農民分析數據,優化種植和灌溉管理

      專用 USB 程式碼上傳工具

       

      基本擴展板

      擴展板由以下功能組成

      • OLED 0.96" 顯示器
      • 24C02 EEPROM x 1
      • SD CARD (Micro SD)
      • 2 個按鍵 ( Reset重置 及 USER Key)
      • 2.54mm 及 2.00mm 洞洞板自行功能擴展焊接區塊

      資源

      開發板介紹



      安裝及使用


      立即購買




      2024年3月5日 星期二

      Datalogger Iot 開發板的 UART 功能切換方法

      Datalogger Iot 獨特的 UART 使用方法說明

      Arduino , Dataloggeriot

      由上圖所示,Datalogger Iot 有 3 個 UART 功能I/O。因為 Datalogger Iot 的核心只有 2 個 UART 可以使用,所以透過共用切換的方法。透過 Serial2 一分為 4 ,所以最後再加上 1 個 UART 輸出給未來擴充使用。

      我們使用以下的表格的方式呈列


      舉例來說,如果要使 RS-485 。就要在使用之前透過 digitalWrite 的方法將 S0 設定為 1,S1 設定為 0。

      當我們要在Arduino 程式裡切換 UART 時,其他程式撰寫部分不變。

      完整的程式範例 :

      Datalogger_PM25_GPS.ino

      這個範例,有 PM5003 及 GPS 模組所組成。同樣都是 UART 所組成的通訊,當中是透過切換UART的方式。


      2023年4月17日 星期一

      [Ameba] A1 PICO / RTL8720DN (BW16) and Arduino IDE (EN)

      RTL8720DN

      Realtek RTL8720DN is a wireless chip that supports both Wifi and Bluetooth, with Wifi supporting dual modes (802.11 a/b/g/n 1x1, 2.4GHz & 5GHz) and low-power BLE 5. The processor core is designed with dual processors, integrating ARM V8M Cortex-M33 (instruction set compatible with Cortex-M4F) and ARM V8M Cortex-M23 (compatible with Cortex-M0+). Wifi and BT share the same set of antennas, making hardware design simpler. The BW16 is a SOC module designed based on the RTL8720DN, which connects commonly used pins and uses a PCB antenna to make development easier.

      Summary:
      The core consists of KM4 Arm Cortex-M4 core @ 200 MHz and KM0 Arm Cortex-M0 core @ 20 MHz. WiFi supports 2.4G and 5G protocols, with a bandwidth range of 2.412-2.484GHz & 5.180-5.825GHz.

      • It supports HT20/HT40 modes
      • low-power mode
      • Bluetooth 5.0 LE
      • with a bandwidth range of 2.402GHz – 2.480GHz.
      • Operating modes include AP, Station, AP/Client. 
      • WiFi and BT share the same antenna.
      • 1 ADC
      • 2 UART interfaces
      • 1 I2C
      • 1 SPI
      • 4 PWM
      • and all pins can be used as GPIO.

       

      To make it more convenient to use the RTL8720DN (BW16), I designed the A1 PICO development board.

      Development highlights:

      • Built-in USB 5V self-recovery fuse.
      • Battery connection interface JST 2.00mm.It is not convenient to connect a fixed power source in many applications, so it will be more convenient in applications. If USB 5V is connected at the same time, it will automatically switch to USB as the main power source.
      • Because battery applications are required, I specially selected an LDO with good efficiency to maximize the battery's performance. The default voltage range is 3.6V ~ 4.2V.
      • Pre-installed I2C pull-up resistors.When used in I2C applications, pull-up resistors are always needed, and sometimes they cannot be found temporarily. Now, you only need to connect the short circuit pin.
      • Supporting Auto Flash function is also a major modification this time.


      Connection diagram

      RTL8720DN,BW16,ESP32

      UART Driver

      CH9102F
      https://www.wch.cn/products/CH9102.html

      Circuit diagram

      RTL8720DN,BW16,ESP32


      Arduino IDE

      To get started, you need to install the Ameba board support package (BSP) for the Arduino IDE. Follow these steps:

      1. Open the Arduino IDE and click on File -> Preferences.
      2. In the Additional Boards Manager URLs field, enter the following URL:https://github.com/ambiot/ambd_arduino/raw/master/Arduino_package/package_realtek.com_amebad_index.json
      3. Click OK to save the changes.
      4. Next, open the Boards Manager by clicking on Tools -> Board -> Boards Manager.
      5. Search for "ameba" and select the "Realtek AmebaD Boards" package.
      6. Click on Install to install the BSP.
      7. After installation, select the "Ameba RTL8720DN / BW16" board from the Tools -> Board menu.

      You are now ready to program the Ameba board using the Arduino IDE.
      Please enable the Auto Upload mode as this development board has the Auto flash feature for automatic uploading.


      Demo video

      Resources


      2023年4月16日 星期日

      [PI PICO RP2040] Starting First Program @ C/C++

      When we receive a new board, we usually start by blinking the LED and printing a message. Then, we proceed to test various examples. This is also where we begin with Raspberry Pi Pico RP2040 & C/C++.

      The print display on the Raspberry Pi Pico RP2040 board uses UART (Default) output, which is UART 0, represented by the dark purple UART0_TX (1) and UART0_RX pins. The default baud rate is 115200 bps.


      
       // Enable UART
       stdio_init_all();
       
      

      To initialize UART and USB, we can use the standard input/output functions such as printf(), scanf(), etc.

      Blink and printf Implementation

      
      int main() {
          // Enable UART
          stdio_init_all();
      
      
          gpio_init(25);
          gpio_set_dir(25, GPIO_OUT);    
          
          while (true) {
              gpio_put(25, 1);
              sleep_ms(1500);
              gpio_put(25, 0);
              printf("blink test\n");
              sleep_ms(1500);
          }
      
      
          return 0;
      }
      

      UART0_TX (1) and UART0_RX are connected to a USB to UART converter to begin receiving strings.

      If you want to use USB CDC functionality, you can simply modify the cmake (CMakeLists.txt) file.

      
      pico_enable_stdio_usb(newblink1 1)
      pico_enable_stdio_uart(newblink1 0)
      

      That is, enabling USB and disabling UART.

      Device Manager

      Serial Settings in PuTTY

      Output

      Source Code Link

      https://github.com/cold63/Pico_C_Project/tree/main/newblink1

      2023年3月31日 星期五

      [Ameba] A1 PICO / RTL8720DN (BW16) and Arduino IDE (EN)

      RTL8720DN

      Realtek RTL8720DN is a wireless chip that supports both Wifi and Bluetooth, with Wifi supporting dual modes (802.11 a/b/g/n 1x1, 2.4GHz & 5GHz) and low-power BLE 5. The processor core is designed with dual processors, integrating ARM V8M Cortex-M33 (instruction set compatible with Cortex-M4F) and ARM V8M Cortex-M23 (compatible with Cortex-M0+). Wifi and BT share the same set of antennas, making hardware design simpler. The BW16 is a SOC module designed based on the RTL8720DN, which connects commonly used pins and uses a PCB antenna to make development easier.

      Summary:
      The core consists of KM4 Arm Cortex-M4 core @ 200 MHz and KM0 Arm Cortex-M0 core @ 20 MHz. WiFi supports 2.4G and 5G protocols, with a bandwidth range of 2.412-2.484GHz & 5.180-5.825GHz.

      • It supports HT20/HT40 modes
      • low-power mode
      • Bluetooth 5.0 LE
      • with a bandwidth range of 2.402GHz – 2.480GHz.
      • Operating modes include AP, Station, AP/Client. 
      • WiFi and BT share the same antenna.
      • 1 ADC
      • 2 UART interfaces
      • 1 I2C
      • 1 SPI
      • 4 PWM
      • and all pins can be used as GPIO.

       

      To make it more convenient to use the RTL8720DN (BW16), I designed the A1 PICO development board.

      Development highlights:

      • Built-in USB 5V self-recovery fuse.
      • Battery connection interface JST 2.00mm.It is not convenient to connect a fixed power source in many applications, so it will be more convenient in applications. If USB 5V is connected at the same time, it will automatically switch to USB as the main power source.
      • Because battery applications are required, I specially selected an LDO with good efficiency to maximize the battery's performance. The default voltage range is 3.6V ~ 4.2V.
      • Pre-installed I2C pull-up resistors.When used in I2C applications, pull-up resistors are always needed, and sometimes they cannot be found temporarily. Now, you only need to connect the short circuit pin.
      • Supporting Auto Flash function is also a major modification this time.


      Connection diagram

      RTL8720DN,BW16,ESP32


      UART Driver

      CH9102F
      https://www.wch.cn/products/CH9102.html

      Circuit diagram

      RTL8720DN,BW16,ESP32


      Arduino IDE

      To get started, you need to install the Ameba board support package (BSP) for the Arduino IDE. Follow these steps:

      1. Open the Arduino IDE and click on File -> Preferences.
      2. In the Additional Boards Manager URLs field, enter the following URL:https://github.com/ambiot/ambd_arduino/raw/master/Arduino_package/package_realtek.com_amebad_index.json
      3. Click OK to save the changes.
      4. Next, open the Boards Manager by clicking on Tools -> Board -> Boards Manager.
      5. Search for "ameba" and select the "Realtek AmebaD Boards" package.
      6. Click on Install to install the BSP.
      7. After installation, select the "Ameba RTL8720DN / BW16" board from the Tools -> Board menu.

      You are now ready to program the Ameba board using the Arduino IDE.
      Please enable the Auto Upload mode as this development board has the Auto flash feature for automatic uploading.


      Demo video

      Resources