My suspicion from regular use of ear plugs is that the wax sticks to the plug every night. I use a new set every night. Pretty wasteful, but man, I need my sleep.
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.
I have custom molded ones. They help a lot, however high pitched sudden noises still get through and wake me up. I never managed to sleep without earplugs since moving to this city. Not considering moving due to the quality of life (apart from the noise)
They are pretty comfortable, though they take getting used to because the seal is perfect and you'll slightly pressurize your ear canal which is a strange feeling. They'll also fit slightly inside your ear, so lying sideways is fine.
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).
Yeah, this seems like a way overengineered solution.
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.
I have fallen into the (questionable) habit of sleeping with Airpods. I used to wake up with my mind racing and not be able to fall back asleep. The Airpods helped distract and sedate my midnight thoughts such that I would fall back asleep much quicker than without. I've progressively shifted towards falling asleep listening to the droll of engaging non-fiction, but keep them in my ears in noise canceling mode with no media for the remainder of my night.
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.
A would be intruder did bang on my door at 3am (I guess to test if anyone was in) and I looked pretty pissed off and menacing when I opened the door (ex prop forward rugby player) and they ran off. Maybe not the smartest move on my part.
Apparently they immediately decided to break into my neighbours a few doors down while people were sleeping.
I wear ear plugs every night. The disposable foam ones are good enough to prevent me from being woken up by my partner getting ready before me, but I would most certainly hear a fire alarm. I'm laying in bed right now with them in and I can still hear the fan pointed at me. They significantly reduce low-mid range frequencies, but they're not 100% soundproof
This is really cool. We did a similar thing around 2 years ago but didn't use AI in that case. Just used a phone to record a few nights sleeping. Then a python script. I manually listened for some time in order to find the threshold amplitude (where all sounds would be ignored below and tracked above). Generated a graph that should the spikes of interest. Clicked on the spikes which went to the timestamp in the audio and listened. Not super scientific I know.
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
I started meditating recently (~10mins per day) and have found it to be surprisingly effective. It’s a combination of body scanning & mindfulness meditation.
I used to do yoga and meditation. I let that slip while life transitions. I have some meds from my doctor (seroquel) which is knock me out, but getting back to being active and disconnecting is a better approach than pills.
I recently had (and then lost/left on a plane!) a Lumenate Nova[1] and found it was very helpful at quickly getting me away from the mind going state. I work very late to overlap with distant timezones and would often find it difficult to get to sleep once I went to bed given I've been staring at screens and on calls only minutes before hitting the pillow. This was great.
I find if I work out consistently I am always getting great sleep and getting really tired in the evening, but if I don't I might not ever feel tired then I look up and it's 3am. I never made the connection between heavy exercise and sleep before, but it seems obvious in hindsight. Got to do what we are built to do not what modern life insists we do.
I think being active, especially evenings, is helpful. When in Santa Cruz, my wife ensures via threat (joking) that I attend her evening pilates classes. It does help with sleep.
I find my mind goes straight to settled if my phone and all configurable electronics are in a completely separate room. Its like I give up seeking more stimulation.
An off topic addendum - those are 2 very nice places to be. Maybe someday.
That CO2 concentration looks unhealthy, I wonder to what extent it's affecting your sleep quality (as opposed to waking you up).
> 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.
“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”
You’d need a forest in your room to see a proper change. There was a whole discussion in the Indie hacking scene on X on that topic around 1-2 weeks ago
I also agree co2 levels are super important, but I’m wondering: in your situation isn’t air pollution from the motorway a concern? Not sure how to balance that one
The levels I have at night indeed are unhealthy, I’m still trying to find the best way to tackle this challenge..
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)
Is your bedroom approaching 4 or 5k PPM? The chart screen shotted was at 3300+ and it looks like it kept going up after. Hopefully it's a bad sensor reading, but that is very high. I sleep in a small room with a few people and it's maybe 1500 and noticeable when that happens. Getting to 5k is potentially dangerous for extended periods of time.
I don't need this to know what wakes me up during the night: my wife pushes the door and THEN turns the doorknob. A simple conversation was no good. My MIL said on her experience deep conversations would not help either. At least it didn't help for 15 years.
lol, my husband does the same thing… I told him I can’t see the door at night and sometimes walk into it, so we leave it open at night, solves the problem.
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.
I'm surprised that AI didn't tell him that the most likely cause of regularly waking up around 3 am is a cortisol spike. Try some breathing exercises or some other type of stress relief throughout the day, and you might sleep better.
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’m actually the author of the post and doing regular breathing exercises and some additional things. Pretty sure my cortisol levels at night are (currently) not an issue. Morning walks looking up into the sky also help me a lot. Falling asleep isn’t my issue
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 :)
If you're regularly waking around 3 (as opposed to random times throughout the night) you might want to reconsider cortisol as a possibility, at least as setting a baseline wakefulness that allows you to be easily woken up from a noise. There is a natural cortisol spike at that time, and that combined with elevated levels from background stress causes the same problem for many people who fall asleep without issues, myself included.
The 3am part was just a random picked time. But interesting to know, thanks for sharing! I had some stress related sleeping issues about a year ago, that’s why I started with proactively provoking morning cortisol spikes and preventing them in the evenings which definitely helped. At that time I went through some personal challenges, so it made sense
You're joking, but the other night I had high fever and had nightmares of AI giving me wrong answers to questions I already knew the answer, but for some reason I kept insisting on writing the same prompts I didn't even needed over and over again.
Hey OP, would love to know more about your thoughts on Garmin you reference at the bottom? Why would they be any better/worse than Coros?
> *= 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.
OP, I would encourage you to take a sleep test. While it seems to be correlated with sound, it sounds (pun not intended) way too similar to my OSA symptoms
Related project I did in 2014 tried to do this. I was a web developer so used the web audio APIs to trigger a recording when the decibel level exceeded a certain value. I was living in a big tent in my friends back yard in Sydney at the time and was convinced it was airplanes coming into SYD that were waking me up at 4am but never really captured conclusive evidence because my laptop battery couldn't make it through the night :)
My mom would love this one :) .. she told me recently about a long-running chat gpt session that she's had for over a week, where she was going back and forth trying to figure out the source of some strange sound in the building.
> I get the sleep data from my Garmin* watch. Every watch and ring calculates sleep slightly differently, and to be honest, I don't fully trust any of them on the exact sleep stage I was in at any given second.
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.
Totally agree with you, that’s why I wanted to check. I btw turned off the morning report long time ago, so it’s more about me checking the sleep stages after realizing that I feel without energy. Also my sleep outside the city is much better. In the end it turns out that most times it is real and an external noise woke me up. Not always, there are false positives and sometimes you just wake up (nightmare, stress, sickness, ..)
I like the temperate graph halfway down the page. It looks like two decaying exponentials alternating every ~40 minutes, with the downward one steeper than the upward one. It's a neat visualization of hysteresis, where the thermostat presumably has a different temperature threshold for turning off or turning on (or perhaps there's a minimum time between state switches). Without the scale it's hard to know for sure.
Yes it’s the AC keeping the temperature. I have different targets set depending on season and time of night (cooler to fall asleep, warmer in the morning). Added this data because I already have it in Home Assistant and you never know what other crazy conclusions you can get from looking at the data :D
They’re called “MITTZON”, made for offices. Also great room separators. I’ve tested them for a few nights and they work surprisingly well.
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
The thing this guy should have done with AI is asking it: "how can I record sounds at night and check them back later?" And the AI would have told him to just download any recording app (for a kind of specific one I suggest snoreclock). End of the story.
We may be entering the age of "disposable software" (some people politely call it "on-demand software"). Until recently, coding was a highly specialised skill and was relatively expensive. So writing custom code for personal whimsy was a luxury only software developers could afford. Not anymore.
This seems quite over engineered. They could’ve just left their phone recording overnight and done much simpler analysis on the big file. Maybe leverage LLM to write a 20-line python script, at most
what a waste of technology. you could have had a pen and graph paper hooked up to an microphone 100 years ago and looked for the spikes in the time set.
it could also be common sense.. you live in a noisy city and you are wondering what the noise is.... maybe it could be the city itself? how about sleep in a different smaller town and then ask yourself the same question, you'll probably get a different answer.
I'm not sure if things are really that simple, at least from my personal experience. I think the quality of noise and noise floor can make a difference
>>*= 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.
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.
I sleep terriibly.
It got 'better', when i worked out i have a 'day', of around 32-36 hours.
So, to people kon a regular 24 hour day, I'm tired at the wrong times and wide awake over aboit two of their sleep cycles.
Damned annoying, as I've gone out when i should have stayed in - but everyone is out and awake, and viceversa.
I've learned to say 'no' to invites I know I won't make. 8 hour working days, suck.
For long creative bursts, it's great, though.
This is another dumb AI project idea which i would have done at some point too if I didn't know better. It's one of those things where doctors will just go ahead with the fix even if they haven't evaluated the exact diagnosis, since the fix will probably be the same regardless. The human mind wants certainty though so I get it, but the fix doesn't need to be preceded by a pinpointing of the exact cause.
This is cool, but a simple circular buffer audio recorder connected to stdin would have been sufficient. The recorder records continuously on a circular buffer that stores the last 5 minutes, and whenever OP wakes up, he can press any key on the keyboard to dump the current 5 minutes on storage, with the timestamp as file name. False positives are much less possible, and the whole system can just be a small CLI program.
Not sure I understand how this would work. The whole point is that you often don’t realize that you even woke up. And not sure jumping to go to the computer to hit a key is the smoothest way to fall back asleep
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..
This person wasted an entire weekend, spent a shit ton time with LLM and contributed to CO2 emissions, water table depletion just to come to the conclusion that he needs to wear fucking ear plugs or use a white noise maker?
Anybody living in a mid to large city or urban area could have told you that. What a waste of resources.
Good article! Not agreeing with the statement before the link
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.
I often wake up at 2-4 AM long enough to look at a clock - then fall back asleep. I’ve never even considered that it could be something in my environment waking me up!
This is cool don't get me wrong, but surely overcomplicated? Why not just record audio to disk the whole night then eyeball the waveform for loudness spikes? If you just don't connect it to any network at all, there's no data breach risk (or am I misunderstanding the justification for the noise-detection toggle thing?).
Thx for the feedback about the hero image. I just removed it. (you weren’t the only one pointing it out)
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
Hey, OP, consider sleeping with ear plugs. They're scientifically proven to reduce night time awakenings due to audio disturbances. [1]
[1] https://academic.oup.com/sleep/advance-article/doi/10.1093/s...
I would think earwax build up would increase with that
My suspicion from regular use of ear plugs is that the wax sticks to the plug every night. I use a new set every night. Pretty wasteful, but man, I need my sleep.
I use Loop silicone earplugs, they’re reusable and washable. Used to use the disposables but got tired of the waste.
I used to have lots of earwax buildup that kept me from using earplugs.
Then I fixed my health.
What did you do to fix your earwax buildup?
Leave the environments that stimulated it.
Stop eating the foods that stimulate it.
I now have visible production on a tissue or cotton swab once a week or fewer.
There’s no real evidence linking specific foods with ear wax production.
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).
Yeah, they can block drainage
Definitely does.
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
I can confirm. I also use in-ear headphones daily which I think exacerbates it further. It can be fixed by an occasional ear wash though.
I have custom molded ones. They help a lot, however high pitched sudden noises still get through and wake me up. I never managed to sleep without earplugs since moving to this city. Not considering moving due to the quality of life (apart from the noise)
Are custom molded ones better?
I’ve been using swimmers plugs for a few years now and they’ve been fine. Do you use an eye mask too?
They don’t block much more noise but they’re much more comfortable
Yes. Wearing regular earplugs will change the shape of your ear, and many people can't tolerate it every night.
They are pretty comfortable, though they take getting used to because the seal is perfect and you'll slightly pressurize your ear canal which is a strange feeling. They'll also fit slightly inside your ear, so lying sideways is fine.
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).
Yeah, this seems like a way overengineered solution.
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.
I recommend these: Mack's Pillow Soft Silicone Earplugs. Can be found on Amazon. Block out A LOT of noise.
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.
Wax-style earplugs like you describe are the only kind that a friend of mine uses. The foam ones never fit them.
i find earplugs so uncomfortable that it ruins my night
Get custom fitted ones at an audiologist.
They are very comfortable, at least in the upward facing ear, for me. Foamies are only tolerable a couple of nights for me.
Do they suppress as much noise?
I was dealing with chronic infections the last time my ears were that sensitive.
Don't listen to him– he is a cat burglar, and you being deaf at night helps him steal your cats.
Is there such a flourishing black market for subtracted cats that would prompt burglars to steal these pets?
Yeah they just finished their series A funding yesterday. Sorry to hear you missed out
I have fallen into the (questionable) habit of sleeping with Airpods. I used to wake up with my mind racing and not be able to fall back asleep. The Airpods helped distract and sedate my midnight thoughts such that I would fall back asleep much quicker than without. I've progressively shifted towards falling asleep listening to the droll of engaging non-fiction, but keep them in my ears in noise canceling mode with no media for the remainder of my night.
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.
Maybe I've seen too many horror movies, but aren't you concerned about not hearing an intruder and being able to respond? Maybe I'm paranoid. :)
Is the risk of intruders a real or a perceived problem? How does it weigh with sleep quality?
Frankly, my sleep is so poor that if they mind the noise level they can take what they can carry.
As I sit in bed at midnight, winding down from my day, this comment gave me a great belly laugh. Thanks!
A would be intruder did bang on my door at 3am (I guess to test if anyone was in) and I looked pretty pissed off and menacing when I opened the door (ex prop forward rugby player) and they ran off. Maybe not the smartest move on my part.
Apparently they immediately decided to break into my neighbours a few doors down while people were sleeping.
Smoke detectors are another reason
I wear ear plugs every night. The disposable foam ones are good enough to prevent me from being woken up by my partner getting ready before me, but I would most certainly hear a fire alarm. I'm laying in bed right now with them in and I can still hear the fan pointed at me. They significantly reduce low-mid range frequencies, but they're not 100% soundproof
AFAIK there is some inflammation potential if earplugs are used all night everyday.
https://www.nytimes.com/wirecutter/reviews/advice-wearing-ea...
Trash night (early morning) is once a week in my area. You can use the ear plugs strategically.
How can anyone sleep with these things? My ears get extremely sweaty and sore after half an hour.
This is really cool. We did a similar thing around 2 years ago but didn't use AI in that case. Just used a phone to record a few nights sleeping. Then a python script. I manually listened for some time in order to find the threshold amplitude (where all sounds would be ignored below and tracked above). Generated a graph that should the spikes of interest. Clicked on the spikes which went to the timestamp in the audio and listened. Not super scientific I know.
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.
You definitely went for a simpler solution!
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
Interesting. I may need to add some sensors.
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.
“Has my brain settled” I feel this.
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.
I used to do yoga and meditation. I let that slip while life transitions. I have some meds from my doctor (seroquel) which is knock me out, but getting back to being active and disconnecting is a better approach than pills.
I recently had (and then lost/left on a plane!) a Lumenate Nova[1] and found it was very helpful at quickly getting me away from the mind going state. I work very late to overlap with distant timezones and would often find it difficult to get to sleep once I went to bed given I've been staring at screens and on calls only minutes before hitting the pillow. This was great.
[1] https://lumenate.co/lumenate-nova/
I find if I work out consistently I am always getting great sleep and getting really tired in the evening, but if I don't I might not ever feel tired then I look up and it's 3am. I never made the connection between heavy exercise and sleep before, but it seems obvious in hindsight. Got to do what we are built to do not what modern life insists we do.
I think being active, especially evenings, is helpful. When in Santa Cruz, my wife ensures via threat (joking) that I attend her evening pilates classes. It does help with sleep.
I find my mind goes straight to settled if my phone and all configurable electronics are in a completely separate room. Its like I give up seeking more stimulation.
An off topic addendum - those are 2 very nice places to be. Maybe someday.
That CO2 concentration looks unhealthy, I wonder to what extent it's affecting your sleep quality (as opposed to waking you up).
> 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.
plants plants plants. Most of these are dummy easy to care for, too. https://en.wikipedia.org/wiki/NASA_Clean_Air_Study#List_of_p...
Plants are nice…but, from your link:
“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”
You’d need a forest in your room to see a proper change. There was a whole discussion in the Indie hacking scene on X on that topic around 1-2 weeks ago
Big fan of plants though, help me feel calm
I also agree co2 levels are super important, but I’m wondering: in your situation isn’t air pollution from the motorway a concern? Not sure how to balance that one
3k+ is well into the headache / feel really bad range
we rarely get over 1k here
The levels I have at night indeed are unhealthy, I’m still trying to find the best way to tackle this challenge..
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)
https://archive.ph/dd5Kl
“Almost 2%. The reduction in carbon-dioxide concentration when 60 square centimetres of plants were placed in an office, according to one study.”
Is your bedroom approaching 4 or 5k PPM? The chart screen shotted was at 3300+ and it looks like it kept going up after. Hopefully it's a bad sensor reading, but that is very high. I sleep in a small room with a few people and it's maybe 1500 and noticeable when that happens. Getting to 5k is potentially dangerous for extended periods of time.
https://en.wikipedia.org/wiki/Carbon_dioxide#Below_1%
yeah... the problem is that his vibecoded dashboard or sensor readings are buggy
Sounds like "observability, for sleep".
It’s funny how many things can boil down to "rich distributed traces" and events / logs.
I don't need this to know what wakes me up during the night: my wife pushes the door and THEN turns the doorknob. A simple conversation was no good. My MIL said on her experience deep conversations would not help either. At least it didn't help for 15 years.
lol, my husband does the same thing… I told him I can’t see the door at night and sometimes walk into it, so we leave it open at night, solves the problem.
You let it? It really wanted to, but you kept denying it until you finally gave in and let it?
AI bros are insufferable. I am daily being reminded of 2020 crypto bros.
Anti-AI weirdos are ten times more insufferable
can't we all agree they're BOTH terrible?
Both are fuel for the other. The romance is amusing.
Can't we all agree LLM users are only "AI" curious, and not to kink shame those that lose $200k to their hubris. =3
https://www.youtube.com/watch?v=UQ4pSVS_mN0
This reminds me of a weird story...
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.
you could’ve been a great start of a horror movie.
I'm surprised that AI didn't tell him that the most likely cause of regularly waking up around 3 am is a cortisol spike. Try some breathing exercises or some other type of stress relief throughout the day, and you might sleep better.
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’m actually the author of the post and doing regular breathing exercises and some additional things. Pretty sure my cortisol levels at night are (currently) not an issue. Morning walks looking up into the sky also help me a lot. Falling asleep isn’t my issue
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 :)
If you're regularly waking around 3 (as opposed to random times throughout the night) you might want to reconsider cortisol as a possibility, at least as setting a baseline wakefulness that allows you to be easily woken up from a noise. There is a natural cortisol spike at that time, and that combined with elevated levels from background stress causes the same problem for many people who fall asleep without issues, myself included.
Second this
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
The 3am part was just a random picked time. But interesting to know, thanks for sharing! I had some stress related sleeping issues about a year ago, that’s why I started with proactively provoking morning cortisol spikes and preventing them in the evenings which definitely helped. At that time I went through some personal challenges, so it made sense
You ever try just masking the noises with some white noise?
Embracing biphasic sleep is also an option if your life permits it
Plot twist: the existential dread of an AI-ified world where "AI" is the answer to everything was what was waking him.
You're joking, but the other night I had high fever and had nightmares of AI giving me wrong answers to questions I already knew the answer, but for some reason I kept insisting on writing the same prompts I didn't even needed over and over again.
Hey OP, would love to know more about your thoughts on Garmin you reference at the bottom? Why would they be any better/worse than Coros?
> *= 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.
I'm curious about this too. This is the first time I've heard of Garmin being a bad company.
> a flash of lightning following the boom
That’s not how lightning and thunder work.
I was under the impression that the pattern "I have a problem -> let's ask AI" is frowned upon here.
I’m also a little surprised about it. The reason I wrote this post was to send the message: I wouldn’t have done this if it wasn’t for the AI tooling
It seems fine if you express what you did without focusing on the code.
It resonates well with what some people have been saying about building software for 1 person.
OP, I would encourage you to take a sleep test. While it seems to be correlated with sound, it sounds (pun not intended) way too similar to my OSA symptoms
Related project I did in 2014 tried to do this. I was a web developer so used the web audio APIs to trigger a recording when the decibel level exceeded a certain value. I was living in a big tent in my friends back yard in Sydney at the time and was convinced it was airplanes coming into SYD that were waking me up at 4am but never really captured conclusive evidence because my laptop battery couldn't make it through the night :)
All he had to do is buy a sound machine for $60and problem would be solved. So simple but he made overly complicated.
My mom would love this one :) .. she told me recently about a long-running chat gpt session that she's had for over a week, where she was going back and forth trying to figure out the source of some strange sound in the building.
Maybe take your mother to brunch or something. I am pretty sure it will be better than any chatgpt session she has running for a week
You want to just start by addressing the >3000 CO2 ppm
> I get the sleep data from my Garmin* watch. Every watch and ring calculates sleep slightly differently, and to be honest, I don't fully trust any of them on the exact sleep stage I was in at any given second.
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.
Totally agree with you, that’s why I wanted to check. I btw turned off the morning report long time ago, so it’s more about me checking the sleep stages after realizing that I feel without energy. Also my sleep outside the city is much better. In the end it turns out that most times it is real and an external noise woke me up. Not always, there are false positives and sometimes you just wake up (nightmare, stress, sickness, ..)
I like the temperate graph halfway down the page. It looks like two decaying exponentials alternating every ~40 minutes, with the downward one steeper than the upward one. It's a neat visualization of hysteresis, where the thermostat presumably has a different temperature threshold for turning off or turning on (or perhaps there's a minimum time between state switches). Without the scale it's hard to know for sure.
Yes it’s the AC keeping the temperature. I have different targets set depending on season and time of night (cooler to fall asleep, warmer in the morning). Added this data because I already have it in Home Assistant and you never know what other crazy conclusions you can get from looking at the data :D
I'm much more interested in the app and what they learned than anything to do with AI. Leave that part out, imo.
This could easily be sleep apnea
My sleep was not good so I installed panelling and now I sleep better. There you go. Saved you 8 hours and using AI
Can you tell me more about this panelling?
They’re called “MITTZON”, made for offices. Also great room separators. I’ve tested them for a few nights and they work surprisingly well.
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
The thing this guy should have done with AI is asking it: "how can I record sounds at night and check them back later?" And the AI would have told him to just download any recording app (for a kind of specific one I suggest snoreclock). End of the story.
We may be entering the age of "disposable software" (some people politely call it "on-demand software"). Until recently, coding was a highly specialised skill and was relatively expensive. So writing custom code for personal whimsy was a luxury only software developers could afford. Not anymore.
Why use a generated image in that weird dirty yellow style when you have a real screenshot to show?
This seems quite over engineered. They could’ve just left their phone recording overnight and done much simpler analysis on the big file. Maybe leverage LLM to write a 20-line python script, at most
what a waste of technology. you could have had a pen and graph paper hooked up to an microphone 100 years ago and looked for the spikes in the time set.
it could also be common sense.. you live in a noisy city and you are wondering what the noise is.... maybe it could be the city itself? how about sleep in a different smaller town and then ask yourself the same question, you'll probably get a different answer.
I'm not sure if things are really that simple, at least from my personal experience. I think the quality of noise and noise floor can make a difference
Yeah idk why home assistant needed to get involved. I guess to turn the system on and off according to his heuristic.?
What is the front end built with? It looks nice.
Not OP - but it's Ghost:
>>*= 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.
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.
long time back i had this sense orb that did something similar and it was night sounds made me wake up !
https://sense.io/
I sleep terriibly. It got 'better', when i worked out i have a 'day', of around 32-36 hours. So, to people kon a regular 24 hour day, I'm tired at the wrong times and wide awake over aboit two of their sleep cycles. Damned annoying, as I've gone out when i should have stayed in - but everyone is out and awake, and viceversa. I've learned to say 'no' to invites I know I won't make. 8 hour working days, suck. For long creative bursts, it's great, though.
Earplugs also solve this problem with many fewer tokens.
Have you tried sleeping without a watch?
Did you really need to build an ai app to figure out that doors, dishes, and motorcycles wake you up?
This is another dumb AI project idea which i would have done at some point too if I didn't know better. It's one of those things where doctors will just go ahead with the fix even if they haven't evaluated the exact diagnosis, since the fix will probably be the same regardless. The human mind wants certainty though so I get it, but the fix doesn't need to be preceded by a pinpointing of the exact cause.
This is cool, but a simple circular buffer audio recorder connected to stdin would have been sufficient. The recorder records continuously on a circular buffer that stores the last 5 minutes, and whenever OP wakes up, he can press any key on the keyboard to dump the current 5 minutes on storage, with the timestamp as file name. False positives are much less possible, and the whole system can just be a small CLI program.
Not sure I understand how this would work. The whole point is that you often don’t realize that you even woke up. And not sure jumping to go to the computer to hit a key is the smoothest way to fall back asleep
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..
Dude used ai to determine that slamming a door, moving dishes, or driving a motorcycle near this bedroom woke him up. Revolutionary stuff.
This person wasted an entire weekend, spent a shit ton time with LLM and contributed to CO2 emissions, water table depletion just to come to the conclusion that he needs to wear fucking ear plugs or use a white noise maker?
Anybody living in a mid to large city or urban area could have told you that. What a waste of resources.
hint: your watch is probably lying to you and you're following a normal bifurcated sleep pattern.
AI is melting your real world understanding: https://www.sleepfoundation.org/how-sleep-works/biphasic-sle...
Good article! Not agreeing with the statement before the link
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.
I often wake up at 2-4 AM long enough to look at a clock - then fall back asleep. I’ve never even considered that it could be something in my environment waking me up!
This is cool don't get me wrong, but surely overcomplicated? Why not just record audio to disk the whole night then eyeball the waveform for loudness spikes? If you just don't connect it to any network at all, there's no data breach risk (or am I misunderstanding the justification for the noise-detection toggle thing?).
Also the AI-generated hero image looks vile.
Thx for the feedback about the hero image. I just removed it. (you weren’t the only one pointing it out)
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
Makes sense. Hope you get better sleep!