I am planning on having an array of embedded devices in my garden, and each of these is going to have its own analog moisture sensor. Each moisture sensor needs to be individually calibrated.
In an ideal world, I would have the same software on each embedded device, with a configuration file holding the calibration for the attached analog moisture sensor, so that I can minimize the development and CI/CD work.
Is this possible with Arduino, or would I be better off with an embedded device with addressable flash, like an ESP32?
-
4You may try to use the embedded EEPROM.Edgar Bonet– Edgar Bonet2022年03月06日 19:09:31 +00:00Commented Mar 6, 2022 at 19:09
-
1If the embedded EEPROM is too small, there are many serial EEPROMs for the SPI and I²C bus, giving you lots of non-volatile memory.the busybee– the busybee2022年03月07日 07:23:17 +00:00Commented Mar 7, 2022 at 7:23
-
there are some misconception in your question. esp32 can be used with Arduino too. there are many different Arduinos with different not-volatile memory capabilities. you have to be more specific,Juraj– Juraj ♦2022年03月07日 09:45:14 +00:00Commented Mar 7, 2022 at 9:45
-
1i would put a pot on-device since the calibration changes as the sensors oxidize and wear out (which happens in several months, even when not actively powered). They are not very accurate anyway, swinging 10% on back to back readings is considered good for all but brand new sensors.dandavis– dandavis2022年03月07日 19:04:33 +00:00Commented Mar 7, 2022 at 19:04
1 Answer 1
As Edgar Bonet already mentioned, the embedded EEPROM is good to try. I give some options below though:
- In case the configuration file (data) is max. 1 KB, you can use the embedded/internal EEPROM of the Arduino UNO.
- In case the configuration file is larger you have multiple options:
- On the ESP32 you can use 4 KB EEPROM.
- If it is higher, on the ESP32 you also can use the SPIFFS file system stored in EEPROM.
- For other MCUs (ESP32 included), you can use external EEPROM with various sizes, based on SPI or I2C.
- If you want to use a very large configuration file, you could use an SD card, which is much slower of course, which is normally SPI based and can be used on both Arduino and ESP32.
So for a comparison between Arduino Uno / ESP32
MCU Solution Speed Size External Wearout
Hardware
----------- ------------------ ----- ------ -------- --------------
Arduino Internal EEPROM High 1 KB No EEPROM Wearout
ESP32 EEPROM Simulation High 4 KB No Flash Wearout
ESP32 SPIFFS File System High <Flash No Flash Wearout
Size
Both External EEPROM High <1MB * Yes EEPROM Wearout
Both SD Card Slow <256GB Yes -
*Typically 4 KB to 1 MB, using SPI or I2C