McMajan Library Pack  v 2.00
Improve your Arduino !
Energia Class Reference

#include <Ss_Energia.h>

Public Member Functions

 Energia ()
 
void Start (int mp=-1)
 Inizialize Energia. More...
 
void ReadMiddlePoint (uint16_t)
 Read middle point: this function uses Kalman filter to reduce the noise. More...
 
void ReadPowerData (struct Mc_AnalogSensor *, struct Mc_AnalogSensor *, uint8_t wavenumber=1)
 Read voltage and current data from sensors. This function calculates apparent power, real power, rms current and voltage. More...
 
void GetWaveValue (struct Mc_AnalogSensor *, uint8_t wavenumber=1)
 Sample waves. More...
 
void SetRipple (float, uint16_t num=450)
 Set ripple noise. More...
 
float RippleRemover (float)
 Remove ripple value from specified value. More...
 

Public Attributes

int Pin_MiddlePoint
 
float midpoint
 
float ripple
 
uint16_t counter
 
float rmsI
 
float rmsV
 
float rmsS
 
float rP
 
float aP
 
float minI
 
float maxI
 
float minV
 
float maxV
 
float minS
 
float maxS
 

Detailed Description

Definition at line 8 of file Ss_Energia.h.

Constructor & Destructor Documentation

§ Energia()

Energia ( )

Definition at line 75 of file Ss_Energia.cpp.

Member Function Documentation

§ GetWaveValue()

void GetWaveValue ( struct Mc_AnalogSensor S,
uint8_t  wavenumber = 1 
)

Sample waves.

Parameters
Sis the sensor connected to source
wavenumberis the number of waves you want to sample. If not specified it's setted to 1

Definition at line 135 of file Ss_Energia.cpp.

References Mc_SampleAnalogAvg(), midpoint, Mc_AnalogSensor::pin, and Mc_AnalogSensor::sensor_step.

+ Here is the call graph for this function:

§ ReadMiddlePoint()

void ReadMiddlePoint ( uint16_t  campioni)

Read middle point: this function uses Kalman filter to reduce the noise.

Parameters
campioniis the number of samples

Definition at line 123 of file Ss_Energia.cpp.

§ ReadPowerData()

void ReadPowerData ( struct Mc_AnalogSensor V,
struct Mc_AnalogSensor I,
uint8_t  wavenumber = 1 
)

Read voltage and current data from sensors. This function calculates apparent power, real power, rms current and voltage.

Parameters
Vis the pointer to voltage sensor. If NULL, Energia uses default voltage (see Ss_Global.h)
Iis the pointer to current sensor
wavenumbernumber of scanned waves

Definition at line 8 of file Ss_Energia.cpp.

References aP, maxI, maxV, Mc_SampleAnalogAvg(), midpoint, minI, minV, Mc_AnalogSensor::pin, rmsI, rmsV, and Mc_AnalogSensor::sensor_step.

+ Here is the call graph for this function:

§ RippleRemover()

float RippleRemover ( float  value)

Remove ripple value from specified value.

Parameters
valueis the value you want to clean from ripple
Returns
filtered value

Definition at line 113 of file Ss_Energia.cpp.

§ SetRipple()

void SetRipple ( float  rip,
uint16_t  num = 450 
)

Set ripple noise.

Parameters
mpis the analogic pin to read middle point. If not specified Energia uses perfect half scale as middle point.
numspecify the number of samples. If not specificated is set to 450.

Definition at line 95 of file Ss_Energia.cpp.

References ripple.

§ Start()

void Start ( int  mp = -1)

Inizialize Energia.

Parameters
mpis the analogic pin to read middle point. If not specificated Energia uses perfect half scale as middle point.

Definition at line 84 of file Ss_Energia.cpp.

References Mc_Analog_Inist(), and Pin_MiddlePoint.

+ Here is the call graph for this function:

Member Data Documentation

§ aP

float aP

Apparent Power

Definition at line 27 of file Ss_Energia.h.

§ counter

uint16_t counter

count samples

Definition at line 21 of file Ss_Energia.h.

§ maxI

float maxI

maximum current misured

Definition at line 29 of file Ss_Energia.h.

§ maxS

float maxS

maximum sensor misured

Definition at line 33 of file Ss_Energia.h.

§ maxV

float maxV

maximum voltage misured

Definition at line 31 of file Ss_Energia.h.

§ midpoint

float midpoint

Definition at line 19 of file Ss_Energia.h.

§ minI

float minI

minimum current misured

Definition at line 28 of file Ss_Energia.h.

§ minS

float minS

minimum sensor misured

Definition at line 32 of file Ss_Energia.h.

§ minV

float minV

minimum voltage misured

Definition at line 30 of file Ss_Energia.h.

§ Pin_MiddlePoint

int Pin_MiddlePoint

Definition at line 12 of file Ss_Energia.h.

§ ripple

float ripple

Definition at line 20 of file Ss_Energia.h.

§ rmsI

float rmsI

current RMS value

Definition at line 23 of file Ss_Energia.h.

§ rmsS

float rmsS

sensor RMS value: this is not a specific value

Definition at line 25 of file Ss_Energia.h.

§ rmsV

float rmsV

voltage RMS value

Definition at line 24 of file Ss_Energia.h.

§ rP

float rP

Real Power

Definition at line 26 of file Ss_Energia.h.


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