Humidistat
Arduino firmware for a humidistat (humidity controller)
Loading...
Searching...
No Matches
SingleHumidistat Class Reference

Control humidity using PID by driving two solenoid valves. Adjust the public setpoint variable and call update(). More...

#include <SingleHumidistat.h>

Inheritance diagram for SingleHumidistat:
[legend]
Collaboration diagram for SingleHumidistat:
[legend]

Public Member Functions

 SingleHumidistat (HumiditySensor *hs, const ConfigStore *cs, etl::array< uint8_t, 2 > pins_solenoid, uint8_t pwmRes)
 Constructor.
 
void update ()
 
void updatePIDParameters ()
 
- Public Member Functions inherited from Humidistat
 Humidistat (const ConfigStore *cs, HumiditySensor *hs, double Kp, double Ki, double Kd, double Kf, uint16_t dt, double cvMin, double cvMax)
 Constructor.
 
double getHumidity () const
 Read the humidity.
 
double getTemperature () const
 Read the temperature.
 
double getCvMin () const
 
double getCvMax () const
 
- Public Member Functions inherited from Controller
 Controller (const ConfigStore *cs, double Kp, double Ki, double Kd, double Kf, uint16_t dt, double cvMin, double cvMax, double defaultSP, double defaultCV)
 Constructor.
 
void getTerms (double &pTerm, double &iTerm, double &dTerm) const
 Get the three PID terms by reference.
 
void update ()
 Run the controller: Typically reads a sensor, runs a cycle of the PID loop and drives some actuator.
 
void updatePIDParameters ()
 Update the PID parameters from the configStore.
 
const ConfigStoregetConfigStore ()
 Get a pointer to the ConfigStore instance.
 

Private Attributes

const uint8_t pins_solenoid [2]
 
const uint8_t pwmRes
 

Additional Inherited Members

- Public Attributes inherited from Controller
bool active = false
 
double pv = 0
 Process variable.
 
double sp
 Setpoint.
 
double cv
 Control variable.
 
- Protected Member Functions inherited from Humidistat
void runCycle ()
 Run a cycle of the controller. Reads a sample from the humidity controller and runs PID.
 
- Protected Attributes inherited from Humidistat
HumiditySensor & hs
 
- Protected Attributes inherited from Controller
PID pid
 
const ConfigStorecs
 
unsigned long sensorLastRead = 0
 

Detailed Description

Control humidity using PID by driving two solenoid valves. Adjust the public setpoint variable and call update().

Definition at line 13 of file SingleHumidistat.h.

Constructor & Destructor Documentation

◆ SingleHumidistat()

SingleHumidistat::SingleHumidistat ( HumiditySensor * hs,
const ConfigStore * cs,
etl::array< uint8_t, 2 > pins_solenoid,
uint8_t pwmRes )

Constructor.

Parameters
hsPointer to a HumiditySensor instance
csPointer to a ConfigStore instance
pins_solenoidArray of 2 integers corresponding to the solenoid pins
pwmResPWM resolution (bits)

Definition at line 6 of file SingleHumidistat.cpp.

Member Function Documentation

◆ update()

void SingleHumidistat::update ( )

Definition at line 11 of file SingleHumidistat.cpp.

Here is the call graph for this function:

◆ updatePIDParameters()

void SingleHumidistat::updatePIDParameters ( )

Definition at line 19 of file SingleHumidistat.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ pins_solenoid

const uint8_t SingleHumidistat::pins_solenoid[2]
private

Definition at line 15 of file SingleHumidistat.h.

◆ pwmRes

const uint8_t SingleHumidistat::pwmRes
private

Definition at line 16 of file SingleHumidistat.h.


The documentation for this class was generated from the following files: