The mechanism: mast cells (the immune cells that release histamine among other things) have their own circadian clock. The CLOCK gene controls their IgE receptor expression in a time-of-day manner, and both plasma histamine and tryptase peak during the night. In healthy people this is fine. In MCAS or histamine intolerance, this nightly mediator release is excessive, and it happens right in the window where cortisol (which normally suppresses histamine release) bottoms out around 2-4am. Histamine is itself a wake-promoting neurotransmitter, so you get woken up, often by something minor like a noise, reflux, or a temperature shift that wouldn't otherwise register. Signs it might be worth looking into: 3am waking with a racing heart, sweating, flushing, itching, or reflux/throat tightness. A good in-depth resource: https://health.programmerlife.org/en/
<meta name="generator" content="Ghost 6.19">Say what?
Also the AI-generated hero image looks vile.
The intention was to have something less detailed than the screenshot in the post.
About the other thing: yes this would have worked for a night or so. I wanted to be able to go back and forth between nights and compare. I also had concerns about the SD-card durability and storage capacity. Still, after an hour into letting the coding agent do its thing, I was impressed by the result, so more and more ideas popped into my head
AI is melting your real world understanding: https://www.sleepfoundation.org/how-sleep-works/biphasic-sle...
Also, not sure if you’ve taken the time to read the post but it clearly states that I’m not using AI to analyze the data. The point of posting this was a different one
I’m happy because I can clearly hear what wakes me up at night. I knew I wake up from noise and now I can clearly see it in the data that I wake up right after door slams, noisy motorbikes, car horning, and dishes from the kitchen (own and neighbors)
After taking action I now sleep better and don’t have those random wake-up moments.
So, I find totally inappropriate the snarky comment about OP and AI melting anything.
Prior to that, many people across different continents and cultures followed a biphasic sleep schedule. They went to bed in the evening and slept for a few hours, waking up around midnight. Then, they would stay up for a few hours to eat, tend to their children, or add wood to the fire, before finally falling back asleep for their second sleep phase.
And it goes on to mention this pre-industrial biphasic ‘schedule’ many times throughout the article.
Anybody living in a mid to large city or urban area could have told you that. What a waste of resources.
Many countries have trash collection in the early morning, so ¯\_(ツ)_/¯
Click through to their blog's main page. Click their LinkedIn link, google their current employer ...... "{Company} is a company that provides a platform for real-time search, observability, security, and generative AI"
Aaaaaand there it is. A person whose livelihood is tied to selling AI products writing blog posts hyping up how amazing AI products are. Who could have ever guessed?
https://medium.com/homeday/building-a-noise-level-dashboard-...
https://thepihut.com/products/respeaker-4-mic-array-for-rasp...
Slightly off the main topic, but I can strongly second that recommendation for Coros gear!
No relation other than a very happy Coros user (Pace Pro). They make an excellent series of sport & health monitoring watches and bike gear, best GPS I've ever seen producing the most accurate run/bike tracks I've ever seen (using 5 GNSS systems: GPS, Galileo, QZSS, etc.), very reasonable pricing compared to the competition, continuous useful updates, and just a great overall approach to health and technology.
Sleep is my biggest concern right now.
Also, iOS has background (white noise etc) sounds built-in: https://support.apple.com/en-us/109346 Android has something similar too?
We also installed triple-layered windows for sound insulation, but I believe it degraded the quality of the air, so sometimes have to open the windows for a few minutes before sleep to get fresh air.
I love my Garmin, but it's one of the worst smart watches to track sleep with. It consistently ranks poorly in tests that stack it up against pro sleep equipment, and from my experience it struggles to even detect sleep times properly. That 3:32 event that the watch said has pulled you out of deep sleep may not have been real.
Then there is the two sleep theory that suggests we are not supposed to sleep in single block. In more traditional environments, people got up to stoke the fire at this point. I know some folk that get up to urinate or have a drink. I used to turn the radio on for a bit.
Which makes a lot of sense. Especially non-Tier-1 services.
Note: Having previously worked at Amazon, certain shifts can be really busy. Busy as in 30-40 pages/incidents over the course of the shift. I sometimes wake up to a "ghost" page, although I left my position earlier this year...I spend most of my days in front of CLIs but here I really think a cli wouldn’t be the right tool for the job..
It’s funny how many things can boil down to "rich distributed traces" and events / logs.
https://github.com/introlab/odas
Claude of course has a nasty habit of reinventing every wheel.
Otherwise making sure the windows are properly sealed is first resort. And if you’re living with other people (partner, flatmates, family) it also helps to check the doors
My grandmother can't see very well, and she always loved doing crossword puzzles, but the small print was giving her troublem. At the same time, the available crosswords in her language were too simple and boring for her.
So, I vibed a small scraper from some crossword collection, and with smart composition of the final HTML, I managed to get the crossword and the questions to show up on one side while the other side of the page was for the answers.
I still have no idea how the scraper works, and frankly I don't really need to. My challenge now is finding my way to even more challenging and enjoyable crosswords, or maybe even try to get AI to make the crosswords from scratch.
Also ear plugs.
[1] https://academic.oup.com/sleep/advance-article/doi/10.1093/s...
That's the idea
https://www.nytimes.com/wirecutter/reviews/advice-wearing-ea...
You shouldn't be looking at just various kinds of earplugs as options for this. You can get custom made earplugs for your ears for differing use cases (sleep, concerts) at an ENT.
The only downside is you get used to the quiet and it means when I don't sleep with them I get a worse night sleep than I used to. (But I still get a better night sleep with them than when I didn't use them.)
I’ve been using swimmers plugs for a few years now and they’ve been fine. Do you use an eye mask too?
Once I also had automatic blackout blinds, they would slowly roll up before my my alarm rings. All controlled by home assistant, which can read the phono alarm time. Waking up slowly by light is nice :)
Again, not medical advice, just anectdotal experience..
Edit: this is entirely due to the 'Stop playing when falling asleep' function of iOS 26, which I loathe. But this feature barely make it worthwhile.
1. You have to find the right ear plugs for YOU. Everyone has different ear canal size, shape, sensitivity, etc.
2. They should never be painful unless you are doing it wrong. Yes, they are likely to be uncomfortable at first, but the first time you wake up feeling like a million bucks because you got 8 uninterrupted hours of sleep for the first time in your life, you will happily accept the temporary discomfort.
What they're good for is sleeping due to desperation while travelling. I couldn't imagine having to wear them every day at home. That sounds like hell.
I moved to the US 15 years ago and it was too noisey for me to sleep well (fire trucks, cars, etc), but ear plugs solved the problem and are portable to other places you might need to sleep.
They’re little putty molds that you shape to fit your ear.
I also rip them in half before molding so I get 2 ear plugs from 1 putty.
Also a simple noise machine can work wonders.
To the person who asked, I can sleep with these in on my side without a problem after I made sure to use the right tip size.
Jokes aside: overengineering issue like this to LEARN a new coding language, hardware setup, platform etc. used to be a great opportunity for skills growth. Now honestly it's hard to justify, if you're using AI to do it. With the added insult that the sycophantic AI will also make you feel like a genius for overthinking a stupid idea.
I used to wear them every night and they definitely improved my sleep. But then I also had instances where my ear was blocked with wax for several days.
YMMV
Then I fixed my health.
Frankly, my sleep is so poor that if they mind the noise level they can take what they can carry.
Two observations. 1. Often you wake up after a loud noise but like 5 minutes later with no memory of it. 2. even if you don't wake up from the noise your breathing changes, more likely to talk in sleep and shuffle more. So even if you not waking up your quality of sleep is disrupted.
Our case had some random construction like noise in the early morning, lasted around 10 seconds and disappeared. However, we noted even ordinary sounds we didn't think was loud was effecting our sleep.
Solution for that place was earplugs and a loud fan to generate white noise.
And thanks for sharing that comment, I can second your two observations
For multiple months, I thought I’m waking up at night because I need to go to the bathroom so often (even checked for insulin resistance but markers were perfect). Interestingly enough, most of the times (not always) there are one or multiple louder sounds just before I wake up to go to the bathroom. Zero memory or conscious perception of the noise, still woke up and feeling like I need to go to the bathroom
For some reason, I've never slept better. Every little noise generally wakes me up (like someone walking in the same room) but the demolition noises kind of numbed me to all audio, apparently.
I also somehow sleep better when I leave a window open, and get some morning sun and noise? Though in that case, loud motorcycles revving will probably wake me up, but random people talking/shouting is fine.
> Measure before you fix
In my case, I got a few IKEA CO2 sensors, and after leaving them in the bedrooms for a few days, we found that leaving an outside window slightly open + the bedroom door open, kept the CO2 levels below 600PPM at night.
We're 1000ft/300m away from a motorway, but fortunately the noise pollution isn't bad. So ventilating (even as it's getting cold) turned out to be a simple fix. I hadn't thought of collecting sleep data from our devices, but maybe I'll get an AI to do that, so I can correlate our sleep quality with the environment.
I spend time in two places. San Juan Islands WA and Santa Cruz, CA.
On island, nights are too quiet. During the day, a float plane a mile away sounds like it is next door.
In Santa Cruz, the house is on a major street. Busses, ambulances all sorts of yahoos.
I sleep better quiet. But I sleep even better when settled - mind not going, etc.
I generally don’t sleep well at all. The biggest factor is - has my brain settled. Background and noise don’t matter.
In my case, thinking too much about the causes of bad sleep actually contributed to making sleep worse, so if this guy is anything like me then this whole project could be hurting his sleep rather than helping.
I grew up in the country side and unfortunately, where I live now, double glassing isn’t a thing unless you live in a recently built house.
That doesn’t nullify what you’re saying, obviously putting worries into sleep affects the sleep itself. Still thought it was an interesting project to build as I’m anyways cautious about noise and air pollution topics :)
Mouth taping (stopped snoring immediately), magnesium glycinate before bed, no screens an hour before sleep, keeping the room cold, not eating dinner so late and regular sauna sessions. Individually they helped.
Together they made a real difference, loud cars and city noise don't wake me up anymore.
I know it sounds like biohacker stuff, but it works. This tool makes it possible to actually find the root cause instead of just guessing. Love it!
I'm also on a CPAP these days, but always looking for a better solution so I'm not so tethered to technology.
Last: when I'm trying to lose weight, I have to be careful or I'm also waking up from hunger. Only it doesn't show up as hunger at first, just a kind of mildly-anxious alertness - that's from the cortisol your body releases when your blood sugar is too low during the night. And then later, after about an hour awake, I get ravenously hungry.
So now I'm stuck trying to balance this: given that a lot of my physical activity is in the evening, how do I eat enough, early enough, that I don't sleep badly from too-low blood sugar and also don't sleep badly from eating too much too late?
Bodies are weird
I went to work at a BBB office once. They turned all their computers off at night and every morning they were back on. It was just "normal" for them.
I can't even remember what problem I was troubleshooting. At the time I was working on IVR systems.
Anwayz, I was working late in their office. Everyone had turned off their computers and went home. At exactly Midnight, every computer in the office turned back on.
I walked around the office looking at desks wondering what had happened. On one persons desk was an alarm clock with a very quiet alarm buzzing. I checked the clock and it was set for midnight (probably a default). About two minutes later it turned off automatically.
I turned off computers and re-set the alarm to go off a few minutes later.
When that alarm clock went off it somehow caused either draw or feedback in the wiring that caused all the computers to turn back on. At the time I wondered if it had something to do with wake on lan.
In any case, I suggested that person take their alarm clock home.
Could also have been “AC power restored” functionality being triggered.
-- Attenuate loud noises --
Which is exactly what they ended up doing
> With actual data, I could finally act with some confidence instead of guessing:
> I added proper acoustic panels (the IKEA ones for offices to create meeting areas work surprisingly well)
> I added extra insulation around the bedroom door and the window (silicone, rubber, ...)
That’s not how lightning and thunder work.
Honestly, feels more like a bit. I sometimes say I need to cross my i's and dot my t's to suss out who's still paying attention in a meeting...
“Respect your tools” and all that but remember it’s an “it.”
Then correlate the time you woke up in your sleep log with the camera footage.
I even heard of people going to sleep with airpods pro in their ear.
Now that it's fixed tho my body decided I would need to pee every night about 2 hours after I went to bed... La vieillesse est un naufrage.
I had a scare in the very early days of owning AirPod Pros accidentally falling asleep with them, and waking up with tinnitus that took hours to go away.
Since then with every gen I've occasionally had ANC malfunction when they come in contact with a pillow and make some deafening noises, I wouldn't be surprised if that day they had been making some horrible shrieking noise while I slept.
(in fact, as if to mock me, I left this comment unsent realizing I didn't care enough to finish it, until my AirPod Maxes decided to flashbang me for having the audacity to while lying on my back. people need to know these things are treacherous in bed)
I was at a festival a year back and unfortunately our camp was near a minor side stage which was running a daytime talent show. I wanted to take an afternoon nap. The sleep ear plugs + noise canceling headphones dulled the moderate noise down to almost nothing.
Not exactly great, but does the job.
Using ear plugs in the past caused infections as I have curved ear canals.
> *= I do not like Garmin, I think they're a fraudulent company systematically breaching consumer rights and I'm looking for alternatives. Already converted multiple people to Coros.
- when hit by ransomware, disclosed publicly, bit on the data loss and told them to fsck off
- devices can very much operate without any account, app, or cloud connection (of course you don't get the more advanced "Connect" features)
- plug it in and you have rw access to .FIT files over MTP
- same mechanism to build and sideload apps made with Monkey C
- ANT+ is a fairly open ecosystem (progressively replaced by BLE, often in much less open ways)
I hear that some people are annoyed that devices stop receiving major feature updates after a year or two, and see that as predatory "you must upgrade every year", which is like, ridiculous?
Also in a sense I like that I buy the device and it's mostly "done". Like a mechanical watch it's a utility item I can rely on and it won't ever have a Liquid Ass pulled up on me.
> Hijacking the vicitim’s COROS account and accessing all data
> – Eavesdropping sensitive data, e.g. notifications
> – Manipulating the device configuration
> – Factory resetting the device
> – Crashing the device
> – Interrupting a running activity and forcing the recorded data to be lost [0]
The security firm disclosed the vulnerability to Coros in Mar 2025. They planned to fix it by the end of 2025, and didn’t address it until the security firm publicly released the finding.
[0]:https://www.dcrainmaker.com/2025/06/coros-confirms-substanti...
It resonates well with what some people have been saying about building software for 1 person.
As an avid reader of aircraft accident reports (ok, more reader of blog posts and watcher of YouTube videos based on those reports - yeah, people have strange hobbies), it reminds me more of flight data recorder graphs - the first FDRs actually inscribed the graphs with needles on metal foil (https://aviation.stackexchange.com/questions/59289/was-the-f...), which is of course no longer the case, but the presentation has been kept.
If the goal was to have fun, that's great. If the goal was to solve a problem, I'm reminded of when engineers build over-engineered solutions, when a simple solution is available.
Also, why not?
Literally 5 minutes of online search and a white noise app solved the problem.
I know this is a post on a blog designed to sell us on Martin, but it's sort of like a movie where a single text message would spoil the whole plot. AI didn't really need to help solve this problem. Martin didn't "let" AI build a tool, he just asked (Claude, probably) how to build something that is replicated by existing apps that record sound and are activated over certain decibel levels. Comments seem to confirm many of us have done the same. Just seems a a bit over-engineered for the sake of it. Sorry, Martin.
Most wakeups are from noise (I can see it in the data) but high CO2 levels can also make me a lighter sleeper.
Not sure where you’re based but in Europe the priority is mostly on heat isolation, so air movement suffers. The US is better in that regard. There was a big thread on that topic on X the other week (Peter the indie hacker initiated it and there were some good recommendations in case you’re the owner of the flat)
It's important to measure this somehow - I do this with a $100 Co2 sensor and display I got off amazon, but you seem to already have these sensors available.
“Almost 2%. The reduction in carbon-dioxide concentration when 60 square centimetres of plants were placed in an office, according to one study.”
we rarely get over 1k here
Anecdotally, we have an air monitor gadget and the highest I've ever seen (small home office, fairly well-sealed, winter, me working there all day with no ventilation) was around 1100-1200 PPM. I get that two people in a small sealed bedroom could push it higher, but 3350 PPM?!
“These results are not applicable to typical buildings, where outdoor-to-indoor air exchange already removes volatile organic compounds (VOCs) at a rate that could only be matched by the placement of 10–1000 plants/m2 of a building's floor space.[2]
The results also failed to replicate in future studies”
Big fan of plants though, help me feel calm
Does it really matter in the grand scheme of things tho ? I have a captor at home, even when I leave the door opened and CO2 remains low, I don't notice anything different at wakeup.
I notice a difference if I move between a ventilated room vs congested one. I suppose it depends on what's causing the concentration. If it's human breath, I'll smell freshness. If it's e.g. burning a portable gas heater (common in my part of the world), I'll feel like I'm not inhaling smoke (probably small amounts of CO).
A few years ago, I would sometimes wake up at night and open a window wide, or go open the outside door and stand there for 5-10 minutes.
I'm there too on this. Something I've found helps is listening to certain types of audio. Some audio books can work, but if they're too engaging or interesting it's counter-productive.
My current solution for this is a particular YouTuber; I noticed a long time ago that watching his videos in bed (when I already given up on trying to sleep immediately because my brain was too alert) seemed to help me relax and feel drowsy. Now it's almost a switch - start a video, phone face down, and I rarely need a second one.
I started meditating recently (~10mins per day) and have found it to be surprisingly effective. It’s a combination of body scanning & mindfulness meditation.
It doesn’t always help, but tends to.
An off topic addendum - those are 2 very nice places to be. Maybe someday.
They have a newer model that is slightly slimmer w/ more features like active noise cancellation, but has a smaller battery that is marginal for full-night sleeping, so I didn't bother upgrading.
One thing to note is they have some bad reviews due to issues with batteries dying or depleting quickly - my right bud wouldn't charge past 50% after 9 months of daily usage, which only lasted about 6 hours or so before dying. That said, Anker's tech support promptly sent out a new pair with minimal friction, which I received just days after reaching out. I've had 4 months of usage on those new ones without a hitch. Hopefully those kinks have been worked out.
Even if these new ones die outside of warranty, they're so good that I feel I'll have gotten my money's worth and will immediately buy them again.
But I think you need to get lucky with the ear canal print. Mine had 30 days return policy of they don’t fit well. I did it in a local store
The downside is they're very expensive, relative to other earplugs and mine no longer seal as well as they used to so I'd need to get a new pair. They're still better than nothing. I started using earbuds around the same time, from using cans, and I wonder if I've very slightly widened my ear's opening.
I also use an eye mask if I'm somewhere that doesn't have good curtains or blinds. Really works very well, but I recommend one that wraps around and doesn't have an elastic band to dig into your ears (Matador makes a good one).
Have the same pattern, issue is cortisol/stress, not sounds / etc that happen precisely at night
Built simular things tonwhat Op did (thoug using Oura for sleep tracking, not Garmin)
Result: no statistically significant variations in sounds, CO2 normal etc. Cortisol is what doctors/AI told me first
This is the bit that got me to look it up. Yeah, it's super tiny! I just ordered one. Thanks!
:)
But now I'm the one using them. Haven't done as much work researching earplugs as some posters above, but like the Loops. For comparison, I have earplugs at work, that feel like someone was raping my ear every time I'm putting them on.
So, there's definitely earplugs and earplugs. If you need to use them, might be worth few hours and few bucks spent on testing/research.
Silicone: expensive, effective, fussy.
Wax: cheap, effective, disposable. (Needs warming up, slight drawback.)
Foam by far has the most effective NRR. Silicone and wax are fine but will not provide as effective of NRR. That said, if it’s for sleeping silicone and wax are probably fine. I would argue that foam is not scratchy at all but I usually buy more expensive brands like Mack’s and it’s good to try out different sizes.
Foam: The most effective, by far. I suspect many people wear them incorrectly and do not insert them far enough. You can use lube (they make special ear lube for stuff like hearing aids, although I think anything medical grade will do) if you have difficulty doing so. I have unusually small ear canals; the most comfortable and best I've found by a mile are Mack's Ultra Soft Foam Earplugs. These are much more comfortable than slim fit alternatives and also have very high attenuation.
Silicone: expensive (but they're reusable and last years), but the least fussy once you get them. They are moulded to your goddamn ear---it's a perfect, pressure-free fit every time and they go right in. Drawbacks include lesser attenuation and attenuation that isn't immediately at 100%---it takes a while for it to "seal". I abadoned these once moisture started to accumulate between my ear canal and the plug and I'd hear it as I moved and it became very annoying.
Wax: joke attenuations compared to foam, and bad compared to silicone. The most expensive long-term unless you're serious about reuse. Somewhat fussy and may fall out. Very comfortable (little insertion).
Foam + wax: this is what you really want if you care about maximum attenuation. My ear canals are slightly too short to comfortably insert an entire Mack's earplug, so I snip the ends off mine, lube them up, and insert them completely flush into my ear canal. Then, I take a wax plug and mould it on top. It's perfectly comfortable and it performs better than any other option I'm aware of. I tend to also wear a Bluetooth sleep mask and play rain sounds on 100% volume and it just comes through the double earplug situation to mask any very loud/spurious noise. To remove the flush-inserted earplugs, I use a pair of blunt tweezers.
When I used slim fit foam earplugs I'd routinely get ear infections. Switching to silicone fixed that, but suffered from the aforementioned issues. With the ultra soft earplugs + wax method I never get ear infections. I make sure to always insert a fresh pair (but I reuse the wax ones for a few days) and to always do so with clean hands. I think the infections are due to friction between the plug and the canal during insertion as well as plugs that are too large/exert too much pressure once expanded---the lube and very soft plug addresses those issues.
White noise also helps without the need for ear plugs. Depends how loud the disturbances are.
huh, potentially a game-changer. Thank you!
Stop eating the foods that stimulate it.
I now have visible production on a tissue or cotton swab once a week or fewer.
Also, for anyone getting reading this, cotton swabs in your ears is a bad idea and usually makes the problem worse (pushes wax in and compacts it).
Apparently they immediately decided to break into my neighbours a few doors down while people were sleeping.
They are effective at attenuating noise, ineffective at eliminating it.
You're worth X.
You have 1 cat who owns you, total value X.
Get 10 black market cats for free, now 11 cats own you for a total net worth of 11X.
That's even before considering the compound effect of each cat owning a human worth 11X, which means you can divest from 1 cat for 11X, and still be worth 110*X.
The system basically works like xAI shares. Don't look too close into it.
I have been wearing ear plugs every night for over a decade and cleaning my ears with cotton swabs at least every other day for my whole life and never once had ear wax build up.
Network effects at play, here.
What we consider normal is informed by the people we spend the most time around.
Everybody! Pay attention now! Only 22,999,000 share tokens are left, and due to gchamonlive's massive transaction, the liquidity pool is moving fast, and a share/token is now worth $150,000. Don't miss out, act now!
That’s not what’s being discussed.
They asked what I did.
This is anecdata.
and anecdotally:
I no longer make enough wax to see in a month.
But you also shouldn’t be surprised if someone challenges the implications or merits of your anecdata, for the benefit of others that might take it as good advice.
checks notes
consider switching up environment
or diet/things you’re ingesting,
if you’re generating excess goo known for waste-carrying,
and protection from environmental debris...
Are you serious?
Feel free to struggle until a peer-reviewed study gives you permission not to,
but don’t be surprised if others continue making basic observations and improvements for themselves.
But changing your diet won’t help with ear wax. And cotton swabs are a bad idea.
You seem upset; this is just a discussion on an internet forum. It’s ok for people to have different opinions and share them in a thread :)
Changing mine does - and I can reliably show it - and I’m what was asked about.
Also, cotton-swabs or a tissue aren’t a bad idea (again, anecdotally for me - what was asked about)
unless one has build-up,
and/or the ear opening has become smaller as a protective measure,
ensuring one rifles the gunk in from the walls,
instead of going past it in the center,
and then pulling out and around the walls.
Most have ear-openings too-tight to even know what I’m referring to.
Anyway, not upset, just steadfast that words matter.
and that individuals don’t need the permission of peer-reviewed studies (or you!) to make basic improvements in their lives.
Anyway, I’m not trying to convince you of anything. My comment was aimed at other readers; further discussion between us won’t be necessary. Good day! :)
Some people can do better.