Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fan control and custom channels for relay #31

Open
blshkv opened this issue Jul 25, 2024 · 1 comment
Open

Fan control and custom channels for relay #31

blshkv opened this issue Jul 25, 2024 · 1 comment
Assignees

Comments

@blshkv
Copy link

blshkv commented Jul 25, 2024

Hi, thanks for the great project!

I set it up for my hardware and facing an issue: I need to control a fan.
The logic is the same as for the heater (apparently) because I connect it to a reversed (NC, normally closed) pin.
Switch ON the "Heater" (i.e. reversed: Fan is OFF physically) if it gets below MIN_TEMP
Switch OFF the "Heater" (i.e. reversed: Fan is ON physically) if it gets above MAX_TEMP

I also use a different relay board, Waveshare compatible but with 4 relays. Its channels are the following

Relay_Ch1 = 19
Relay_Ch2 = 26
Relay_Ch3 = 20
Relay_Ch4 = 21

So there are few things can be improved in the software:

  • Settings -> Outlet -> add <cannel> input box, add <reverse> tick. The reverse should invert the logic and swap ON and OFF during display / graphs
  • Widgets -> settings. Add Fan control type. Leave only "On Temperature", and add the following logic: if PROB_TEMP < FAN_TEMP then and PROB_TEMP > FAN_TEMP then. It must be a gap so that a fan would not go on and off around FAN_TEMP.
  • Widgets display. It should just display FAN_TEMP and above, not a heating range

Do let me know if you need any additional details.
Thank you again

@ReefSpy
Copy link
Owner

ReefSpy commented Aug 26, 2024

Hi thanks for taking time to check out my project! Sorry for late reply, I was pulled off this project recently, but should have time to start working on it again soon. I apologize for the state of the relays right now, they are not in a good state and you might notice things are not behaving as they should.

First issue: I was using RPi.gpio library to control the relays and MCP3008 controller. This library is depreciated and will not work with Raspberry Pi 5, so I am replacing this code with using the gpiozero library. The change is complete for the MCP3008 code, but not on the relay code. This means there are currently 2 libraries fighting to control gpios and this is not good and is breaking things.

Second issue: I starting fixing the relay code, then I realized, I wanted to completely change the relay boards I use. I want to move to I2C capable relay boards which means I won't be using so many GPIO pins to control each individual relay. With the change I have in mind, I will be able to daisy chan many relay boards together, so I won't just be limited to 8 channels, I plan to support 16 or 24 individually addressed relays and this would only take 4 pins of GPIO.

I will take your comments into consideration when I get a chance to start on this code. Thanks for helping out and please let me know if you have any more ideas or issues!

@ReefSpy ReefSpy self-assigned this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants