Live data from Hacker News

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

matthew.science

71–80 of 221 posts

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

#71
post #64

Always surprised to see people running around with their Bluetooth needlessly enabled. Maybe I worry to much about battery usage, but I just got used to always enable WiFi, Bluetooth, or NFC, only at the moment of usage, and disabled afterwards.

I feel like you’re an extreme outlier. It’s not at all surprising, given the convenience in a range of modern day activities like driving a car, listening to music, being in a workplace, or simply being at home.

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

#72

While I don’t discourage learning a new language the immediate toss aside of rust on esp32 was perplexing. It sounds like a lot of the memory issues would have been mitigated by sticking with a language better understood. Rust’s esp32c3 support is pretty good IMO, that’s all I use. Writing in C++ makes me feel dirty in ways that even COBOL doesn’t. I also think I would have implemented presence by TTL, updating the T…

The hash map was definitely not robust enough, that’s why I ultimately switched back to the default behavior and increased the memory available on the board!

Also, I am a Rust fanatic. I do nearly everything in it! I gave a talk on it at our last hackathon! I even wear a Rust t-shirt regularly! So rest assured I will be exploring my options with Rust. I would love to get rid of my dependence on Arduino. But C++ was easiest to get off the ground with, believe it or not, just because I have experience flashing Arduino boards.

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

#73
post #43

How do people "productize" their ESP32 projects? (Edit: not talking about mass-producing something, I just want a self-contained unit rather than a board with a bunch of wires sticking out) I see a lot of pages where they show some bare-looking board, but in the real world you want to package that up. If you're a software guy like me, you would likely prefer to pay a bit extra to just have that tidied up for you rath…

You get a "product designer" (?) who designs a case. If your product is "standard enough", you might skip this step.

Then, you reach out to local manufacturers and ones from bigger markets. You get some samples, you check if things work like they should. If you like it, order a smaller batch. Design a quality assurance workflow, or find a specialist who can help you with that so that the manufacturer doesn't ship you 20% faulty products.

Get your products onto the shelves of a brick and mortar store, and/or create a website, sell on Amazon and other portals.

Talk to your customers, listen to their feedback, improve every step a little.

It sounds overwhelming.

I worked for a small smart home startup, and I learned that, for example, in Shenzhen, there is a whole industry ready to help entrepreneurs realize their dream products, and at every step of the way, you can contract someone to help you. In our experience, the Chinese service was both much better, cheaper, faster than European offers.

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

#74
My alarm clock consists of an ESP32 and has a somewhat big LED-array connected to it (powered by a transistor), a buzzer and a PIR sensor. It doesn't show the time, but buzzes (and flashes) and takes care of slowly brightening the room, or at night slowly dimming it into darkness some time after all the lights have been turned off.

One added benefit I discovered afterwards is that even though the AP is not between me and the ESP, I seem to reflect enough RF so that logging the RSSI provides information not only about when I'm in the bed, but also when I change position at night.

https://imgur.com/a/VixOlu5 (edit: no erotic content despite the warning)

The green one in the middle is the RSSI, the yellow at the bottom the PIR sensor, the top one a mix of the data from my Mi Band 3 plus an annotation of when I was in bed (yes I did spend a lot of time reading news before falling asleep and before getting up)

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

#75
post #66
post #60

Earlier quoted context omitted.

You shouldn't productise anything with ESP32, its just an overprized bloated hobby pcb. See my comment below on how to productize this: use a 4 cent off the shelf microcontroller on a 10 cent pcb or much better: make a custom chip with all the sensors on board but with $25K minimum Capex but tiny Opex

As others point out: you could hire someone to do it. Based on my custom 1 cent ASIC (custom chip) I would design, test and build your (moisture or other) sensor for €3000 excluding tax and price of all the needed tools. Usually more like $6000 because they want to outsource all the problems (like mass production and sales) to me morphle@ziggo.nl if you want me to design it

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.

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

#76
post #43

How do people "productize" their ESP32 projects? (Edit: not talking about mass-producing something, I just want a self-contained unit rather than a board with a bunch of wires sticking out) I see a lot of pages where they show some bare-looking board, but in the real world you want to package that up. If you're a software guy like me, you would likely prefer to pay a bit extra to just have that tidied up for you rath…

Smaller dev boards and shrink wrap.

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

#77
post #19

This would be an interesting way to measure crowds in general-- in concerts, attending political rallies, attending protests, etc. A handful of journalists attending an event could spread out and share their max value.

This makes me wonder if phone companies would have the ability to provide figures for mass gatherings. Would they only be able to count devices on their own network, or do they "see" all phones in range and then filter out the other-network ones?

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

#78
post #47

Earlier quoted context omitted.

That sounds like one of those "I have a problem... now I have two problems" jokes. I wanted something simple and cheap and now I need to go deal with this whole other thing I don't know much about and either rent or buy into it?

As somebody else mentioned, you can hire it out. There's a lot of files running around with existing models for common projects, so you probably don't need to design your own enclosures a lot of the time unless you want to. And printers have gotten cheap, like $99 gets you a jumping off point into the hobby.

$99 is just enough to jump into the hobby of fixing your printer all the time - and that's what hobbyists are actually looking for

solving something would be like $700 calibrated out of the box, like the old prusa 3 something or the bambu p1something.

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

#79
post #47

Earlier quoted context omitted.

3d printed enclosure?

That sounds like one of those "I have a problem... now I have two problems" jokes. I wanted something simple and cheap and now I need to go deal with this whole other thing I don't know much about and either rent or buy into it?

There are plenty of enclosures available on AliExpress and Amazon. But a cheap reprap 3d printer is a general tool like a screw driver or hammer, albeit more complex for sure. But the learning curve isn’t absurd, it’s basically buying something plugging it in and loading filament then printing a downloaded STL. It gets harder when it needs calibration and maintaining, but it’s not an unknown dark art - there are a billion helpful discord groups.

But once you have it and know how to maintain it, anything where you’re like “man wouldn’t it be nice if I had a physical object like X” becomes a relatively solvable problem. There are lot of materials with many different properties. When you skip into a zone of material or print you can’t afford the equipment for, there are a bazillion print shops.

The harder skill frankly is the 3d modeling. But I find openscad is sufficient for almost everything and then for the rest I use Build123. They’re both parametric code driven design tools so fit well inside a software project (better than GUI tools, and more easy to be precise with). Openscad is absurdly easy, build123 is more advanced and requires Python skills as well as effort to learn the conceptual model.

I sort of felt the way you seem to once upon a time until I said screw it and figured it out one day. Now I feel like I lived most my life hobbled for want of this tool.

So, yeah, overkill for printing an esp32 enclosure. But doing so unlocks a lifetime of possibilities.

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

#80
post #43

How do people "productize" their ESP32 projects? (Edit: not talking about mass-producing something, I just want a self-contained unit rather than a board with a bunch of wires sticking out) I see a lot of pages where they show some bare-looking board, but in the real world you want to package that up. If you're a software guy like me, you would likely prefer to pay a bit extra to just have that tidied up for you rath…

I like wood. It is pretty much everything you want for something like this - super durable, very easy to work with, and depending on what you pick, cheap and pretty, too.

Plus, woodworking is very satisfying by itself. And also easy to get started with - for small box-like things like this you only need a few cheap hand tools.

Post reply on HN