Live data from Hacker News

Building an occupancy sensor with a $5 ESP32 and a serverless DB

matthew.science

161–170 of 221 posts

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#161
post #84
post #75

Earlier quoted context omitted.

Mine would be 0.3 cent per chip and would need $50k investment. Jokes aside, if you know how to design a custom chip for 3k USD, I would like to know about it.

it is not a joke, you can do as low as 1.10870 cent per custom chip or 2 cent per off the shelf chip. 0.03 cent is impossible, the minimum size of a chip is .625 mm2 and that sets the minimum price. Designing one for $3K is possible because I already have a tested chip design that I just have to modify for you. A master student project is usually a free design with a free tapeout at Google MPW, Mosys of Europractice.…

You seem like a very smart and capable person, and for an industrial buyer your proposal makes a lot of sense. For a hacker (who is often a hobbyist or amateur looking to build something simple quickly) a versatile SoC at $5/unit also makes a lot of sense.

I have to say you are hurting yourself with your communication style, because it comes off as very dismissive and arrogant. I bookmarked your presentation in case I need it in the future, but a 4 hour video is not a great way to hook people who are not sure if they are interested or not.

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#162
post #155

Earlier quoted context omitted.

if a toll tag required me to power it and allow it to record video of the interior of my car at all times, then FUCK THAT NONSENSE!!!! even if they had it setup so that the camera was only turned on briefly by a signal as you approached and then turned off again as you passed the gates, that's still a hard no from me.

Uh you're over thinking it. They just have cameras in the toll booths that snap a photo when the car crosses the sensor.

uh, what about the kids sitting in the back rows that can't be seen?

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#163
post #119

Outstanding write-up! We actually built a business based on this technology (occuspace.io) and have had to address almost all the questions that you brought up. To answer some of them here: Q: How accurate is BLE beacon count, as a proxy for occupancy? A: It's very highly correlated but different dining locations, classrooms and library floors have very different correlation factors. Consider using other, perhaps mor…

Does this type of occupancy tracking work accurately outdoors? I'm assuming it would be difficult because signals would travel further. (My startup needs occupancy tracking for tennis courts.) Maybe I could mount a BT device at a corner of the outdoor space and use its signal strength as the threshold value.

It does but we don't have a battery powered option (yet) so power availability is the bigger issue. Our sensors can only be outlet powered. Each sensor can cover cover roughly 5,000 sq.ft. or about two tennis courts.

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#164

I've heard talks of the toll tag companies wanting to be able to detect occupants in a car so they can properly charge the correct amount of fees when the occupancy changes the amount. I never looked into how that might happen, but I'm guessing Bluetooth would not be a solve here as it's too easy to circumvent if passengers disable bluetooth

That’s much worse of an automobile usage case than the ones I read about (measuring vehicle travel speeds to improve travel time estimates)! Occupancy based pricing for vehicles seems too hard to enforce anyway, change the pricing scheme to something more practical IMO

Right now occupancy based pricing involves moving a switch on your toll device to indicate if your car qualifies for the high-occupancy discount (e.g. https://www.e-zpassiag.com/about-e-zpass/e-zpass-flex)

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#165
post #154

Earlier quoted context omitted.

Does this type of occupancy tracking work accurately outdoors? I'm assuming it would be difficult because signals would travel further. (My startup needs occupancy tracking for tennis courts.) Maybe I could mount a BT device at a corner of the outdoor space and use its signal strength as the threshold value.

If you want to get really spicy, you can use two antennas and an SDR to compute angle of arrival using nothing but a BLE advertisement's data . This is different from BLE AoA as it doesn't require a cooperative transmitter.

If you want to get really, really spicy, use three devices/antennas and you can roughly track in three-dimensional space.

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#166

This is an excellent write up! > Seeed Studio XIAO ESP32S3/C3, WaveShare ESP32S3 Zero, Unbranded ESP32-WROOM with OLED, Orange Pi Zero W (untouched), Raspberry Pi Zero W (L->R, T->D) After testing all of these, the only one reliable to work for long periods of time (one month currently) was the XIAO ESP32C3/S3. I suspect they may be having power issues? For the ESP32's specifically I highly recommend adding a beefy c…

I have a bunch of ESP32s performing critical-infrastructure tasks in my Home Automation; they've been running flawlessly for about a year now; I update them occasionally (ESPHome) but haven't had any issues.

Some of them perform multiple tasks, e.g. one of them is Bluetooth proxy in my home office, but it also runs the light strip along my Skadis wall boards.

I'm using some random brand ones from a company called "AZDelivery" on Amazon.

I haven't done anything special to them; they sit in 3D printed cases, and are plugged in with relatively short cables (usually <30cm where outlets allow) into at least 5V/1A adapters.

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#167

Earlier quoted context omitted.

I chased a reliability problem with an RPi3 for a while before figuring out it was a poor quality USB cable that I was using for power. Not saying that’s your issue obviously, but I spent a couple more hours than I really should have swapping USB power bricks but not the cable (because it was threaded through the printer enclosure and laziness prevailed).

I didn’t consider that as highly as the outlet adapter since that’s what pushes the amperage and wattage, but thanks, I’ll definitely be investigating that next!

I've found cable quality to be quite important for Raspberry Pi, particularly if you're not using an official adapter, the head room can be low and the resistance of the cable can tip it over.

I haven't had major issues with ESP devices but I try to keep them on <30cm cables of decent quality and ensure they're shielded. Though I haven't tested experimentally, I'd expect low quality, poorly shielded cables to have some effect on the signal quality.

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#168
I'm wondering how accurate this might prove measuring automobile traffic on a relatively busy street?

I've been pondering some way to track the number of vehicles that pass my house each day, and would like (but not ideal) to get their average speed too. Was thinking about computer vision, and even audio doppler approaches, but this seems simpler - if only the bluetooth sensing might work on a device moving at 50mph+ at a distance of maybe 20 to 100 yards.

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#169

This is an excellent write up! > Seeed Studio XIAO ESP32S3/C3, WaveShare ESP32S3 Zero, Unbranded ESP32-WROOM with OLED, Orange Pi Zero W (untouched), Raspberry Pi Zero W (L->R, T->D) After testing all of these, the only one reliable to work for long periods of time (one month currently) was the XIAO ESP32C3/S3. I suspect they may be having power issues? For the ESP32's specifically I highly recommend adding a beefy c…

I'm a huge fan of using Alpine with the RPi due to reducing writes to the SDCard. it will only save data to disk with a lbu commit -d and by default boots into a kind of tempfs.

I have been using Alpine for a while but didn't know this!

At the moment, I'm looking for a way to make my storage more resilient on a Pi I'm using to host Hashicorp Vault, for secrets in Filesystem mode.

First I looked at high-resilience SD cards, but I don't really want them stored on the OS card anyway, also considered just getting a high-quality USB stick and mounting the secrets storage to that; It sounds like a combination of one of these (or perhaps another, similar option) alongside Alpine to reduce writes to the OS SD could be the ticket.

I have a couple of Pis on my network edge running things like WireGuard, with the root mounted read-only to try and help with the issue of SD card resilience; I've killed dozens upon dozens of SD cards in Pis over the years.

Re: Building an occupancy sensor with a $5 ESP32 and a serverless DB

#170
post #90

Since this was done by a student at a university, and at some level this involves tracking people, that's an opportunity to ask a professor about what human subjects protocols you'd need if this was research. (A professor might be easier to ask than the university human subjects board -- who might refuse to talk with you because this isn't under their jurisdiction, or might get alarmed because you didn't talk with th…

I wonder what the "rules" are for things like tracking beacons. They're being broadcast, and they're almost certainly collected without consent everywhere we go.

I happen to live at a junction where my home is regularly surrounded by large numbers of Bluetooth devices; I had considered setting up a BLE tracker purely for "fun" to see what I could collect and discern from the data.

For example, one thing I'm certain of, is a correlation between poor air quality in my home and the arrival of these Bluetooth devices in the area.

Post reply on HN