8/26/2023 0 Comments Esp32 enter deepsleepI'm using a very minimalistic carrier board ( schematic) together with a WROOM32 ESP32-module, which has only 2 pull-up resistors for the 2 needed switches (RESET / GPIO0). However, the best I can achieve is about ~77 ♚ of current consumption. If (EEPROM.I tried to reduce the current consumption of a ESP32 in deep sleep with the ULP enabled. Sjekker om vekten er kalibrert via minneplass 0x00, dersom ulik 1 må den kalibreres ReadMem() // function Les lagrede verdier inn i variablene Serial.printf("Verdi fra minne 0x01 calibration_factor: %0.2f", EEPROM.get(0xAA, calibration_factor)) //Serial print lagret verdi Serial.printf("Verdi fra minne 0x01 currentOffset : %0.2f", EEPROM.get(0x01, currentOffset )) //Serial print lagret verdi? Serial.print("Minne 0x00 Om = 1 så er den kalibrert : ") Serial.println("Kalibrering eller ikke?") Scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN) Int indeks = 0 // indeks of the current value Int switchAlarm = 3 // select the input pin for the switchįloat window // array to hold the sorted values in the window Int switchTareValue = 0 // A0 variable to store the value coming from the sensor Unsigned long debounceTime = 50 // debounce time in milliseconds Unsigned long tareStartTime = 0 // variable to store the start timeĬonst int tareThreshold = 512 // analogue value thresholdĬonst int switchTare = A0 // ALARM SWITCH select the input pin for the switch Variables to store temperature, humidity, weight and tare switch status, hive nameįloat alarmValue = 0 // Nullstilles kun ved å boot senderenĬonst int buttonPressTime = 5000 // wait time in milliseconds Int packetID = 0 //packet counter, reset after boot 433E6 for Asia, 866E6 for Europe,915E6 for North America // 868 ref define the pins used by the LoRa transceiver module Void sort() // med sort i median så kan nok denne slettes float medianFilter(float input) // bør denne også med i calls? Define timeout time in milliseconds (example: 2000ms = 2s) Measuring runtime for when if mills kick in, this to delay sending of packets #define number_of_digits 3 // Desimaler for vektavlesing #define DEFAULT_CALIFACTOR -9000 // tilfeldig valgt, min vekt single load ca -15000, liten 4celle ca -9000 #define CALWEIGHT 25.3 // kjent vekt i kg #define LB2KG 0.45352 // omregningsfaktor #define DHTPIN D2 // Digital pin connected to the DHT sensor Pin 15 can work but DHT must be disconnected during program upload. OneWire oneWire(ONE_WIRE_BUS) //Create a new instance of the oneWire class to communicate with any OneWire device:ĭallasTemperature sensors(&oneWire) // Pass the oneWire reference to DallasTemperature library: I2C eller serial, hva er riktig pin? DS18B20 Define to which pin of the Arduino the 1-Wire bus is connected: #define ONE_WIRE_BUS D9 // pin D2 er fra eksempel DS18B20. #include // DHT11 aidafruit latil denne selv #include "HX711.h" // This library can be obtained here #include // for å lese I2C, muligens for LoRa Int LoRaIntervall = 10 // Tid mellom hver LoRa pakke i sekund In bottom of code is where I imagine the sleep/deep sleep starts // system reads a scale, 2 temperatures, and 1 humidity Maine code 8266 added, functions not included. In a week or 4 I will have a ESP32 WROOM U32 protype running. I don't have a code for ESP per today, the prototype (today) is built on an ESP8266.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |