Skip to content

Fan start on boot #3

Description

@gchecchin92

I'm using a

2N3905 transistor that should be the equivalent of 2N2222.

The installation works fine, but after the boot the fan is running and the temp is 33.6'C.

With python I try to understand the state of the fan object importing just the code needed.

from gpiozero import OutputDevice

GPIO_PIN = 17  # Which GPIO pin you're using to control the fan.
fan = OutputDevice(GPIO_PIN)

after that the fan is active, and fan.active() return 0 that should mean OFF.

After that I read the OutputDevice docs and find that you can set the initial state of the object OutputDevice. So I edit the line
from
fan = OutputDevice(GPIO_PIN, [active_high=True, initial_value=False])
to
fan = OutputDevice(GPIO_PIN, active_high=False, initial_value=False)

Hope this can help someone else

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions