C++ 表2:产生约0.2V压降的肖特基二极管应能正常工作,即使电池电量充足,也能保持在3.6V以下

C++ 表2:产生约0.2V压降的肖特基二极管应能正常工作,即使电池电量充足,也能保持在3.6V以下,c++,arduino,microcontroller,esp32,lora,C++,Arduino,Microcontroller,Esp32,Lora,总的来说,我对LilyGo产品和低电流产品的经验不好。我测试了其中几个(不是LoRa的),通常它们的最小电流为1mA。我认为真正省电的传感器可以像Atmel LoRa node一样制造。嗨,大卫,谢谢你的回答。我没有尝试.end()和.sleep()。深度睡眠模式应该可以节省更多的电量(我在一些讨论中读到了一些uA),因为“芯片上唯一可以通电的部分是:RTC控制器、RTC外围设备和RTC内存”。我还没有在深度睡眠期间测试功耗(我没有2针电池连接器-目前我正在通过USB给主板通电;因此我会尽快检查

总的来说,我对LilyGo产品和低电流产品的经验不好。我测试了其中几个(不是LoRa的),通常它们的最小电流为1mA。我认为真正省电的传感器可以像Atmel LoRa node一样制造。

嗨,大卫,谢谢你的回答。我没有尝试.end()和.sleep()。深度睡眠模式应该可以节省更多的电量(我在一些讨论中读到了一些uA),因为“芯片上唯一可以通电的部分是:RTC控制器、RTC外围设备和RTC内存”。我还没有在深度睡眠期间测试功耗(我没有2针电池连接器-目前我正在通过USB给主板通电;因此我会尽快检查)。使用2针电池连接器,如果使用低压差3.3v调节器,我的功耗非常低,大约为40mA,你可以直接用3.3v引脚为电路板供电,这会使我的电压降到10安培。谢谢你,我会用调节器试试。回答得很好-谢谢分享!找到这篇文章,因为我目前在基于TTGO v1板的LoRa传感器模块上遇到了相同的问题。有新的结果吗?@Schmitzi抱歉,不幸的是,没有新的结果。很高兴我的帖子很有帮助!
/*
 * LoRa (low-power) sender for IoT projects
 *  
 * Tested on a TTGO LoRa32 OLED Board V1.0 
 * 
 * Based on the LoRa examples and the board 
 * documentation
 * 
 * More on the deep sleep with timer wake up: 
 *  
 *    Examples > ESP32 > Deep Sleep > TimerWakeUp sketch
 *    
 *    
 * ERC Recommendation
 * h1.4 frequency band requires <= 1% duty cycle and 25mW (14 db) maximum power
 * => 36 seconds every hour (so: 1 sec transmitting, 99 secs idle) 
 * 
 * 
 * Created 11 June 2019
 * by DP 
 *    
 */
 
#include <SPI.h>   // allows communication with SPI devices 
#include <LoRa.h>
#include <SSD1306.h>   // provides API to work with OLED displays

// defines the pins used by the transceiver module
#define SS 18   // GPIO18 - SX1278's CS   - LoRa radio chip select
#define RST 14   // GPIO14 - SX1278's RESET   - LoRa radio reset
#define DI0 26   // GPIO26 - SX1278's IRQ   - IRQ pin

#define BAND 868E6   // EU   - Italy

// deep sleep 
#define uS_TO_S_FACTOR 1000000  // conversion factor for micro seconds to seconds 
#define TIME_TO_SLEEP  5        // time ESP32 will go to sleep (in seconds)   - 99 for (about) 1% duty cycle  


// an object of class SSD1306 
// first parameter: the I2C address of the display
// second parameter: the number of the SDA
// third parameter: the SCL pin
SSD1306 display(0x3c, 4, 15);

// stores the data on the RTC memory so that it will not be deleted during the deep sleep
RTC_DATA_ATTR int bootCount = 0; 
RTC_DATA_ATTR int pckCounter = 0;   // sending packet number...

 
void setup() {   
  Serial.begin(115200);   // initializes serial data transmission  
  while(!Serial);   // waits for serial port to connect 

  Serial.println("LoRa low-power Sender");
  
  pinMode(16, OUTPUT);
  digitalWrite(16, LOW);   // sets GPIO16 low to reset the OLED
  delay(50);
  digitalWrite(16, HIGH);   // while the OLED is running, GPIO16 must go to high  
  pinMode(2, OUTPUT);
  digitalWrite(2, LOW);   // sets the onboard LED low 
  
  // LoRa transceiver module setup 
  LoRa.setPins(SS, RST, DI0);   // overrides the default CS, reset, and IRQ pins used by the library

  // initializes the transceiver module with a specified frequency
  while (!LoRa.begin(BAND)) {   // LoRa.begin returns 1 on success, 0 on failure
    Serial.println(".");
  }

  // changes the spreading factor to 12 -> slower speed but better noise immunity
  LoRa.setSpreadingFactor(12);   // ranges from 6-12, default is 7 

  // changes the sync word (0xF3) to match the receiver
  // the sync word assures you don't get LoRa messages from other LoRa transceivers  
  LoRa.setSyncWord(0xF3);   // ranges from 0-0xFF     
 
  // LoRa.setTxPower(txPower);   // defaults to 17

  // initializes the display by calling the init method of the display object 
  display.init();   // receives no arguments and returns void

  // display.flipScreenVertically();   // LCD is broken!
  display.setFont(ArialMT_Plain_16);   // sets the current font
  display.drawString(0, 0, "Initialization");   // x, y, message to show
  display.drawString(0, 16, "completed");
  display.display();
  delay(1500);   // small delay so that the user can read it  

  Serial.println("LoRa init completed");    

  //Increments boot number and prints it every reboot
  bootCount++;
  Serial.println("Boot number: " + String(bootCount));

  sendData();   // sends the data...

  // deep sleep
  esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
  Serial.println("Setup ESP32 to sleep for every " + String(TIME_TO_SLEEP) + " Seconds");
  Serial.println("Going to sleep now");
  Serial.flush();   // waits for the transmission of outgoing serial data to complete 
  esp_deep_sleep_start();   // enters deep sleep with the configured wakeup options
}

void loop(){
  // this is not going to be called
}

// sends the data to the receiver
void sendData() {
  
  Serial.print("Sending packet: ");
  Serial.println(pckCounter);

  display.clear();   // clears the display
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.drawString(0, 0, "Sending ");
  display.drawString(0, 16, "packet: " + String(pckCounter, DEC));
  display.display();
  
  digitalWrite(2, HIGH);   // LED is ON during transmission

  // sends the LoRa packet to the receiver
  LoRa.beginPacket();
  LoRa.print("hello ");
  LoRa.print(pckCounter);
  LoRa.endPacket();
  
  digitalWrite(2, LOW);   // turns the LED off after transmission

  pckCounter++;
}