atMETEO
An ATmega based weather station
|
Sensors::HidekiSensor and Sensors::HidekiDevice decode data from wireless Hideki RF 433 MHz sensors. More...
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... | |
Sensors::HidekiSensor and Sensors::HidekiDevice decode data from wireless Hideki RF 433 MHz sensors.
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.
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... | |
![]() | |
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... | |
Sensors::HidekiSensor::HidekiSensor | ( | ) |
Initializes the Hideki sensor decoder.
bool Sensors::HidekiSensor::isValid | ( | ) | const |
Determines if the current decoder state is valid.
true
if the current decoder state is valid, false
if the current state contains data that could not be decoded. bool Sensors::HidekiSensor::isPossiblyValid | ( | ) | const |
Determines if the current data is possibly valid (but not complete).
true
if the current decoder state is valid, false
if the current state contains data that could not be decoded. 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
.
1
-6
. 0
indicates an invalid value. 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.
bool Sensors::HidekiSensor::batteryOk | ( | ) | const |
Determines if the battery is ok.
true
if the battery level is ok, false
if the battery is low. uint8_t Sensors::HidekiSensor::message | ( | ) | const |
Returns the number of the current message.
Hideki sensors retransmit a message 3 times.
1
-3
). bool Sensors::HidekiSensor::isThermoHygro | ( | ) | const |
Determines if the current message contains a Thermo/Hygro data set.
true
if the current message contains a Thermo/Hygro data set, false
otherwise. int8_t Sensors::HidekiSensor::temperature | ( | ) | const |
Gets the temperature value of the current message.
float Sensors::HidekiSensor::temperatureF | ( | ) | const |
Gets the temperature value of the current message as float.
uint8_t Sensors::HidekiSensor::humidity | ( | ) | const |
Gets the humidity value of the current message.
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... | |
|
inline |
Constructs empty data object.
|
inline |
Stores current sensor values into data object.
sensor | HidekiSensor instance to store the values from. |
|
inline |
Resets all values.
|
inline |
Determines if the data object contains valid values.
true
if the values are valid, false
if the no values are set.
|
inline |
Gets the channel value.
|
inline |
Determines if the battery is ok.
true
if the battery level is ok, false
if the battery is low.
|
inline |
Gets the temperature value.
|
inline |
Gets the temperature value as float.
|
inline |
Gets the humidity value.
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.
TShortMin | Minimum length of a short pulse. Has to be set to 183 us. |
TShortMax | Maximum length of a short pulse. Has to be set to 726 us. |
TLongMin | Minimum length of a long pulse. Has to be set to 726 us. |
TLongMax | Maximum length of a long pulse. Has to be set to 1464 us. |
TShortMin
, TShortMax
, TLongMin
and TLongMax
have to be set to the system tick values representing the time (in us) documented above.