Shop OBEX P1 Docs P2 Docs Learn Events
Bathroom humidity controller — Parallax Forums

Bathroom humidity controller

blockly.parallax.com/blockly/projectlink?id=60669&key=b3c7c1df-7866-4d00-b3fb-f7be386dd98f

Ongoing project. This works in Blocky, but I'm unable to load this in to Solo. I figure they will get there, not worried, and I think it is unable to load due to using user code block to calculate dew point.

When dew point is within threshold, fan turns on. Added with this version, adding time to light timer if dew point is within the threshold. The idea is to ensure the light is not turned off when in the shower. That happened to my spouse.... oops. This uses the temperature/humidity, PIR, and light sensors. Light sensor is for future use.

Comments

  • Good work and cool project!
  • Great Project! With some hardware shots, this could go in the Customer Projects thread
  • Thank you. I keep tweeking the code. Before we got a dehumidifier I had to adjust the threshold value summer vs winter. Summer naturally gets dehumidified by the air conditioning. Winter ran closer to the dew point so the fan would run most of the time if using summer setting. I tried using a sudden ramp in humidity to start the fan but I disabled it due to running a lot. I would like to make it learn what is the best setting, but I haven’t figured that out. Other directions are replacing sensor with air quality to add VOC to also turn on fan and see if I can run two bathrooms off one prop.
  • CapdiamontCapdiamont Posts: 218
    edited 2019-12-15 22:33
    Wrong post
  • Great progress!
  • This is Sort of funny, and it illustrates a point: engineers think totally differently from everyone else.

    I saw @Capdiamont post and went “hey! Neat! I should build one!”. To which my wife replied “you see that yellow flippie-thingie on the wall? We call that a ‘switch’ and it controls the light and the fan just fine!!!”

    Spoil-sport... :)
  • @JRoark true the normal switches work very well as long as the person works them well. Our family tends to leave the fans off, leave them on for too long or to prevent them from being on too long, turn them off too soon. This solves that. Humidity is a bad thing in the house.
  • @Capdiamont I totally agree about needing some humidity control. We are in Deep South Texas here. 100F at 95% RH is a pretty typical summer day for us. Brutal! Which is why I was very intrigued by your idea. But SWMBO (She Who Must Be Obeyed) ... was not so much. :)
  • JRoark wrote: »
    This is Sort of funny, and it illustrates a point: engineers think totally differently from everyone else.

    I saw @Capdiamont post and went “hey! Neat! I should build one!”. To which my wife replied “you see that yellow flippie-thingie on the wall? We call that a ‘switch’ and it controls the light and the fan just fine!!!”

    Spoil-sport... :)

    That kind of thinking is soooo 20th century, jeez!
  • CapdiamontCapdiamont Posts: 218
    edited 2020-01-17 01:49
    The program can now be uploaded to blockly solo.
  • Decided to add buttons and use the built in WX LEDS. Got tired of turning it off to prevent the fan from running till I reprogrammed it. Fan can now be turned off by the same button. There is two threshold settings, Summer and Winter. Winter has more humidity so a narrower threshold is used, 0.5F between the dew point and current temperature. 2.0 is used for summer. If fan was auto activated, and button was pushed to turn fan will turn off and threshold is set to narrower setting. Now have button and LED for mode for auto on and manual for fan. This allows for times neither threshold is correct such as window open. Other new button and corresponding LED is to change between threshold settings. Now to see how the changes affect things.
  • Jim EwaldJim Ewald Posts: 733
    edited 2020-05-18 15:41
    Thanks for reporting the error in Solo. Your hunch is correct. The custom code block is not loading correctly and that throws off the rest of the project. I will open an issue to get this resolved.

  • Jim Ewald wrote: »
    Thanks for reporting the error in Solo. Your hunch is correct. The custom code block is not loading correctly and that throws off the rest of the project. I will open an issue to get this resolved.

    I downloaded the latest Blocky Solo, to run on Big Sur and I adjusted thresholds to make it work. Works great under Big Sur. Did they adjust the custom block?
  • CapdiamontCapdiamont Posts: 218
    edited 2021-04-19 15:09

    Three changes, made light time, a constant for long long to run the light. Next change was instead of stopping the light timer countdown, it increases the light timer to the light time constant. I'm hoping this makes it no longer turning off while in the shower. Last change is turn on the light if the fan is on, light level is low and motion is detected. This is so the person taking a shower doesn't need to be rescued or grope around for the switch. I resisted doing the last part because I didn't want the light to come on automatically at night, as I hardly need the light at night.

    Update: Light comes on when motion detected and light is low, regardless if fan is on. More troubleshooting needed.

  • Not sure how I messed things up so badly. I had to use a file before this latest stint of programming to get things right. I have things so if motion is detected and fan is on, the light timer is lengthened by the starting amount, which is 1200. After making sure this works right, I'll try to add back the auto turn on if fan is on, light is low, and motion detected.

  • ercoerco Posts: 20,257
    edited 2021-08-31 20:32

    Quite a project! I also think occasionally about adding an automatic fan controller to my bathroom. But I'm a simpleton and I like simple solutions. My hardware-only approach would be to attach a thermistor to the copper hot water supply pipe feeding the shower. That and a fixed series resistor in a voltage divider arrangement gives an analog voltage corresponding to the pipe temperature. Feed that into an LM339 or LM393 (whatever's at hand) comparator and compare to an adjustable reference pot. Comparator output to relay to fan turns on immediately when hot water starts flowing, stays on for a while until the supply pipe cools down after the hot water is turned off. A bit of pot twiddling (ahem, empirical determination of performance coefficients) adjusts the delay. And of course I would add a 1M hysteresis feedback resistor to avoid oscillation at the setpoint.

    Or, I could go the IoT route and alert Alexa that I'm heading for the shower...

  • ... or just buy one. This is what I have in my bathroom to control the ceiling fan:

    https://www.amazon.com/Honeywell-Wall-Mounted-Humidistat-H46C1166/dp/B06X9GMSBP

    It works flawlessly.

    -Phil

  • ercoerco Posts: 20,257

    Jeepers, that humidistat is $120, PhiPi! Wow, you're smart AND rich! I'm proud to call you my friend! :)

  • Jeepers, that humidistat is $120, PhiPi!

    It was way cheaper when I bought it 30 years ago! :)

    -Phil

  • kwinnkwinn Posts: 8,697

    I just used a SPDT switch so the fan comes on with the light in one position and in the other position it was always on.

    Under $5.00 at the hardware store or electrical supplier.

  • CapdiamontCapdiamont Posts: 218
    edited 2022-06-02 01:44

    Been awhile. Though I also control the lights. One benefit is remade stuff doesn't suffer with my errors.

    Been rethinking things, as I introduced errors. Realized my buttons for switching the thresholds, and manual/auto mode were all out of my Wife's reach. Opps. Just loaded this in my prop tonight, so will need to test. Buttons are more responsive and seem to do what I want. I no longer have set thresholds for summer/winter. Instead, upon power up, it waits a bit, and uses the calculated threshold and subtracts a bit, so fan doesn't go on. Further, if fan runs under automatic mode over two hours, it tightens the threshold. I changed the buttons to use loops to not flash as my timer method wasn't a good method, and I can make the lower buttons set the mode and recalculate the threshold depending on how long the buttons are pressed.

    Going to add a window switch to have it not turn the fan automatically on.

    Controls:
    Fan manually on and off.
    Light manually on and off.
    Fan manually on, automatic off.
    Light manually on and automatically off.
    Fan automatically on and off.

Sign In or Register to comment.