pulseactuator

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 2 Imported by: 0

README

Pulse Actuator

Description

The driver can be used for pulse actuators, e.g. valves for garden such as "Gardena 1251" or "Hunter PGV-101-MM-JT-9VDC" with small amplification hardware. It should also be suitable for bi-stable relays.

For Hunter DC latching solenoid "p/n458200 23-372 A 5/15" with valve "PGV-101-MM-B-DC" this part values for the amplification hardware were tested successfully:

  • works with 10-12V
  • open/load: 4.7KOhm, 100uF
  • close/unload: 4.7KOhm, 470uF
  • usage of an IRF530 for the switch S2 (open), add 10kOhm resistor from gate to source
  • usage of an IRF9530 for the switch S1 (close), add 10kOhm resistor from gate to source
  • decouple the amplifier supply voltage (10-12V) from outputs (3.3V, 5V) by opto couplers (e.g. PCF817) for the gates

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PulseActuator

type PulseActuator struct {
	// contains filtered or unexported fields
}

PulseActuator is a binary driver (on/off) for pulse based actuators like impulse valves or impulse switches. Each state is reached by setting one of 2 outputs for a short time only. If the hardware supports only one pin, the right one can be chosen regarding normal or inverted state. This driver is originally designed to work with tinygo-devices (MCU) but should also work with gobot CPU's.

func New

func New(pinOn, pinOff outputPinner, defaultState bool) *PulseActuator

New creates a new object for pulse actuator

func (*PulseActuator) Configure

func (pa *PulseActuator) Configure() error

Configure configures the pins and the initiate the default state

func (*PulseActuator) InPowerSafeMode

func (pa *PulseActuator) InPowerSafeMode() bool

InPowerSafeMode returns whether the actuator is in power safe mode and do not accept state changes.

func (*PulseActuator) IsOn

func (pa *PulseActuator) IsOn() bool

IsOn returns whether the actuator is in on state.

func (*PulseActuator) IsReady

func (pa *PulseActuator) IsReady() bool

IsReady returns whether the actuator is ready for the next change of state, means the charge time is over.

func (*PulseActuator) Set

func (pa *PulseActuator) Set(on bool) error

Set sets the actuator to the desired state

func (*PulseActuator) SetOff

func (pa *PulseActuator) SetOff() error

SetOff sets the actuator to off state

func (*PulseActuator) SetOn

func (pa *PulseActuator) SetOn() error

SetOn sets the actuator to on state

func (*PulseActuator) SetPowerSafeMode

func (pa *PulseActuator) SetPowerSafeMode(on bool) (bool, error)

SetPowerSafeMode if "true" is given, brings the actuator in the default state and blocks all subsequent calls to change the state by other than this function. If "false" is given, releases all blocks and set the state of the actuator to the one before the function was called with a "true". Returns whether the state was changed to "true".

func (*PulseActuator) Toggle

func (pa *PulseActuator) Toggle() error

Toggle sets the actuator to the opposite state

func (*PulseActuator) WasChanged

func (pa *PulseActuator) WasChanged() bool

WasChanged returns whether the state was really changed from the last change command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL