I didn't totally follow the issues with keeping the data in memory, and it sounds like it is solved now - but you could probably use a cardinality estimation algorithm to estimate the number of unique beacon IDs while only using constant space. https://en.wikipedia.org/wiki/Count-distinct_problem
Building an occupancy sensor with a $5 ESP32 and a serverless DB
31–40 of 221 posts
Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#32Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#33Awesome write up, I liked how accessible the writing is, as well as the fun tone. I have a problem where I will need to monitor the soil moisture of 20 trees in San Francisco. My current thought is to strap an ESP32, Lora module, battery, and capacitive soil moisture sensor and to send data once every 6 hours or so. I was wondering if off the cuff you have any suggestions or pointers on how to best approach this. Tha…
If it is only 20 trees, you could use off the shelf sensors. Its much better and cheaper to design from scatch, use an $0.04 ultra-low power Arm microcontroller with ADC or a Padauk, add a single layer pcb with two well proportioned pcb traces in a plastic bag as a capacitive moisture censor (better than resistive sensor) and a $0.12 solar cell or rechargable battery. Single sensor cost around $0.41 excluding labor,…
Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#34It is more designed to figure out which room you are in.
Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#35Earlier quoted context omitted.
I think I am largely MCU agnostic, although preferably something where I can use Arduino since I am familiar with that. Good to know that ESP8266 is more energy efficient. I have seen this video which demonstrates that the ESP8266 can run off 2 AA batteries for 425 days [1]. Another thought I was having was to write a mobile app that as volunteers walk by the sensor would send data to their phone, which would then fo…
Another option would be LoRa - it’s pretty long range. The problem would be that could add a lot to power usage. Though 6h should be plenty of time - wake up, send a small packet, sleep for 6 hours. You would have a central LoRa receiver in a place that can reach all of the sensors. How far apart are the trees? Other than that, I would suggest testing out lots of different hardware. I bought several different boards…
[1] -- https://www.google.com/maps/d/u/0/viewer?mid=1e7K_VdEEYkxuAy... [2] -- https://www.thethingsnetwork.org/community/san-francisco/
Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#36Awesome write up, I liked how accessible the writing is, as well as the fun tone. I have a problem where I will need to monitor the soil moisture of 20 trees in San Francisco. My current thought is to strap an ESP32, Lora module, battery, and capacitive soil moisture sensor and to send data once every 6 hours or so. I was wondering if off the cuff you have any suggestions or pointers on how to best approach this. Tha…
Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#37Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#38Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#39This should not an issue. It is entirely possible to write this without any dynamic allocation (other than stack) at all, or it could be done be done with an arena. Consider with something as powerful as an esp32 a hash table is not even strictly necessary, surely for a single purpose use case like this.
Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB
#40Cool! I didn't totally follow the issues with keeping the data in memory, and it sounds like it is solved now - but you could probably use a cardinality estimation algorithm to estimate the number of unique beacon IDs while only using constant space. https://en.wikipedia.org/wiki/Count-distinct_problem
Side note: Definitely one of my favorite parts of this project, that I get to investigate more in-depth and interesting CS concepts without having to worry about doing the easiest solution. I’m scratching an itch, not developing a solution to deliver ASAP.