atMETEO
An ATmega based weather station
Files | Classes | Typedefs
Hideki RF 433 MHz

Sensors::HidekiSensor and Sensors::HidekiDevice decode data from wireless Hideki RF 433 MHz sensors. More...

Collaboration diagram for Hideki RF 433 MHz:

Files

file  hidekisensor.h
 Sensors::HidekiSensor and Sensors::HidekiDevice decode data from wireless Hideki RF 433 MHz sensors.
 

Classes

class  Sensors::HidekiSensor
 Decodes data received from a Hideki RF 433 MHz sensor. More...
 
class  Sensors::HidekiData
 Data class for storing values of a HidekiSensor. More...
 

Typedefs

template<uint16_t TShortMin, uint16_t TShortMax, uint16_t TLongMin, uint16_t TLongMax>
using Sensors::HidekiDevice = RfDevice< Demodulator< BiphaseMark< TShortMin, TShortMax, TLongMin, TLongMax > >, ByteDecoder< EvenParity, LsbBitNumbering >, HidekiSensor, 89 >
 Hideki sensor device implemented using a Sensors::HidekiSensor with the RF 433 MHz reception parameters. More...
 

Detailed Description

Sensors::HidekiSensor and Sensors::HidekiDevice decode data from wireless Hideki RF 433 MHz sensors.


Class Documentation

◆ Sensors::HidekiSensor

class Sensors::HidekiSensor

Decodes data received from a Hideki RF 433 MHz sensor.

Hideki sensors are cheap RF 433 MHz sensors for accessing different weather related data such as temperature, humidity, wind direction and speed and others.

Note
The current implementation is limited to a Thermo/Hygro sensor (TS53).

Public Member Functions

 HidekiSensor ()
 Initializes the Hideki sensor decoder. More...
 
bool isValid () const
 Determines if the current decoder state is valid. More...
 
bool isPossiblyValid () const
 Determines if the current data is possibly valid (but not complete). More...
 
uint8_t channel () const
 Returns the channel of the current message. More...
 
uint8_t sensorId () const
 Returns the sensor id of the current message. More...
 
bool batteryOk () const
 Determines if the battery is ok. More...
 
uint8_t message () const
 Returns the number of the current message. More...
 
- Public Member Functions inherited from Sensors::Sensor< HidekiSensor >
SensorStatus setData (uint8_t *data, size_t length)
 Sets the sensor state to the given data buffer. More...
 
SensorStatus addByte (uint8_t byte)
 Adds the byte to the sensor state. More...
 
void reset ()
 Resets the state of the sensor decoder for receiving a new data set. More...
 

Thermo/Hygro

Data only available for messages received from Hideki Thermo/Hygro sensors.

bool isThermoHygro () const
 Determines if the current message contains a Thermo/Hygro data set. More...
 
int8_t temperature () const
 Gets the temperature value of the current message. More...
 
float temperatureF () const
 Gets the temperature value of the current message as float. More...
 
uint8_t humidity () const
 Gets the humidity value of the current message. More...
 

Constructor & Destructor Documentation

◆ HidekiSensor()

Sensors::HidekiSensor::HidekiSensor ( )

Initializes the Hideki sensor decoder.

Member Function Documentation

◆ isValid()

bool Sensors::HidekiSensor::isValid ( ) const

Determines if the current decoder state is valid.

Returns
true if the current decoder state is valid, false if the current state contains data that could not be decoded.

◆ isPossiblyValid()

bool Sensors::HidekiSensor::isPossiblyValid ( ) const

Determines if the current data is possibly valid (but not complete).

Returns
true if the current decoder state is valid, false if the current state contains data that could not be decoded.

◆ channel()

uint8_t Sensors::HidekiSensor::channel ( ) const

Returns the channel of the current message.

The channel can be used to distinguish between multiple sensors of the same type. Hideki sensors support up to 5 channels.

Thermo/Hygro sensors that can be configured with a dip switch use channels 1-3 or 1-5. Thermo/Hygro sensors that cannot be configured operate on fixed channel 1. Other sensors (rain/wind) operate on a dedicated channel 6.

Returns
The channel of the current message 1-6. 0 indicates an invalid value.

◆ sensorId()

uint8_t Sensors::HidekiSensor::sensorId ( ) const

Returns the sensor id of the current message.

Hideki sensors change their id when replacing the battery or on a manual sensor reset. This can be used to identify sensors that operate on the same channel.

Returns
The sensor id of the current message.

◆ batteryOk()

bool Sensors::HidekiSensor::batteryOk ( ) const

Determines if the battery is ok.

Returns
true if the battery level is ok, false if the battery is low.

◆ message()

uint8_t Sensors::HidekiSensor::message ( ) const

Returns the number of the current message.

Hideki sensors retransmit a message 3 times.

Returns
The number of the current message (1-3).

◆ isThermoHygro()

bool Sensors::HidekiSensor::isThermoHygro ( ) const

Determines if the current message contains a Thermo/Hygro data set.

Returns
true if the current message contains a Thermo/Hygro data set, false otherwise.

◆ temperature()

int8_t Sensors::HidekiSensor::temperature ( ) const

Gets the temperature value of the current message.

Returns
The temperature value of the current message.

◆ temperatureF()

float Sensors::HidekiSensor::temperatureF ( ) const

Gets the temperature value of the current message as float.

Returns
The temperature value of the current message.

◆ humidity()

uint8_t Sensors::HidekiSensor::humidity ( ) const

Gets the humidity value of the current message.

Returns
The humidity value of the current message.

◆ Sensors::HidekiData

class Sensors::HidekiData

Data class for storing values of a HidekiSensor.

The HidekiSensor is typically hooked up to the RF 433 MHz receiver which continuously receives pulse widths and modifies the sensor state so that the results are only valid for a short amount of time.

It is often necessary to obtain a copy the sensor values in order to further process them. This can be easily achieved with this helper class.

Public Member Functions

 HidekiData ()
 
void storeSensorValues (const HidekiSensor &sensor)
 
void reset ()
 Resets all values. More...
 
bool isValid () const
 Determines if the data object contains valid values. More...
 
uint8_t channel () const
 Gets the channel value. More...
 
bool batteryOk () const
 Determines if the battery is ok. More...
 
int8_t temperature () const
 Gets the temperature value. More...
 
float temperatureF () const
 Gets the temperature value as float. More...
 
uint8_t humidity () const
 Gets the humidity value. More...
 

Constructor & Destructor Documentation

◆ HidekiData()

Sensors::HidekiData::HidekiData ( )
inline

Constructs empty data object.

Member Function Documentation

◆ storeSensorValues()

void Sensors::HidekiData::storeSensorValues ( const HidekiSensor sensor)
inline

Stores current sensor values into data object.

Parameters
sensorHidekiSensor instance to store the values from.

◆ reset()

void Sensors::HidekiData::reset ( )
inline

Resets all values.

◆ isValid()

bool Sensors::HidekiData::isValid ( ) const
inline

Determines if the data object contains valid values.

Returns
true if the values are valid, false if the no values are set.

◆ channel()

uint8_t Sensors::HidekiData::channel ( ) const
inline

Gets the channel value.

Returns
The channel value.

◆ batteryOk()

bool Sensors::HidekiData::batteryOk ( ) const
inline

Determines if the battery is ok.

Returns
true if the battery level is ok, false if the battery is low.

◆ temperature()

int8_t Sensors::HidekiData::temperature ( ) const
inline

Gets the temperature value.

Returns
The temperature value.

◆ temperatureF()

float Sensors::HidekiData::temperatureF ( ) const
inline

Gets the temperature value as float.

Returns
The temperature value.

◆ humidity()

uint8_t Sensors::HidekiData::humidity ( ) const
inline

Gets the humidity value.

Returns
The humidity value.

Typedef Documentation

◆ HidekiDevice

template<uint16_t TShortMin, uint16_t TShortMax, uint16_t TLongMin, uint16_t TLongMax>
using Sensors::HidekiDevice = typedef RfDevice< Demodulator<BiphaseMark<TShortMin, TShortMax, TLongMin, TLongMax> >, ByteDecoder<EvenParity, LsbBitNumbering>, HidekiSensor, 89>

Hideki sensor device implemented using a Sensors::HidekiSensor with the RF 433 MHz reception parameters.

A Hideki sensor uses Biphase Mark coding and LSB bit numbering with one even parity bit. A message is 89 bits long, the parity for the last byte is omitted.

Template Parameters
TShortMinMinimum length of a short pulse. Has to be set to 183 us.
TShortMaxMaximum length of a short pulse. Has to be set to 726 us.
TLongMinMinimum length of a long pulse. Has to be set to 726 us.
TLongMaxMaximum length of a long pulse. Has to be set to 1464 us.
Note
The parameters TShortMin, TShortMax, TLongMin and TLongMax have to be set to the system tick values representing the time (in us) documented above.