Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperature and humidity sensor support #18910

Merged
merged 2 commits into from
Feb 1, 2022

Conversation

roman-dvorak
Copy link
Contributor

Hi,
i created a driver for the SHT3x sensor by Senserion. Thanks to this, meteorological conditions can be measured in flight. There are several temperature sensors, but most of them are housed in some packaging and the temperature stabilization takes a very long time or is heated by the surrounding electronics.

Humidity is another important factor in some flights.

Describe problem solved by this pull request
The problem is solved by creating an I2C driver for the sensor and a message (temperature, humidity) with enabled logging. The driver can re-establish the connection and re-initialize the sensor after accidentally disconnecting the sensor.

A new message has been created for sending and logging this data. In the next PR, I would like to create a translation into the MAVLink message.

Test
The functionality was verified with the SHT31 sensor in the TFHT01 board.

TFHT

@dagar
Copy link
Member

dagar commented Dec 25, 2021

Did you see #18474?

I was thinking adding this as sensor_hygrometer would be consistent.

@roman-dvorak
Copy link
Contributor Author

roman-dvorak commented Dec 25, 2021

I didn't know that. I only knew the 'hygrometer' mavlink message.

Mentioned PR receives data from a UAVCAN source. I would therefore suggest to use the uORB message from PR #18474 (sensor_hygrometer.msg) and fill it with the temperature/humidity data from my SHT3x I2C driver.

Is there any assumption when it will be merged? To just make a rebase.

@dagar
Copy link
Member

dagar commented Dec 25, 2021

I didn't know that. I only knew the 'hygrometer' mavlink message.

Mentioned PR receives data from a UAVCAN source. I would therefore suggest to use the uORB message from PR #18474 (sensor_hygrometer.msg) and fill it with the temperature/humidity data from my SHT3x I2C driver.

Is there any assumption when it will be merged? To just make a rebase.

It was waiting for the DSDL to move to DroneCAN. We should be able to bring it in now.

@dagar
Copy link
Member

dagar commented Dec 27, 2021

@roman-dvorak sensor_hygrometer will be merged shortly. #18913

msg/humidity_temperature.msg Outdated Show resolved Hide resolved
src/drivers/drv_sensor.h Outdated Show resolved Hide resolved
@dagar
Copy link
Member

dagar commented Dec 27, 2021

How do you start this? Do you want to add a new parameter?

PARAM_DEFINE_INT32(SENS_EN_MS4525, 0);

# TE MS4525 differential pressure sensor external I2C
if param compare -s SENS_EN_MS4525 1
then
ms4525_airspeed start -X
fi

@roman-dvorak roman-dvorak force-pushed the tf/driver-sht35 branch 3 times, most recently from 457df22 to fb4c075 Compare December 27, 2021 19:14
@roman-dvorak

This comment has been minimized.

@roman-dvorak
Copy link
Contributor Author

@dagar, can you review again?

@mrpollo
Copy link
Contributor

mrpollo commented Jan 26, 2022

@roman-dvorak please rebase. We can merge as soon as GitHub Actions completes

SHT3x driver, clean code
changes leading to merge TFHT with CUAV hygrometer
Delete humidity_temperature.msg
Update CMakeLists.txt
rename 'atmosphefir_quantities' to 'hygrometers'
fix logging
removed cmake files
fix PR issues
@roman-dvorak
Copy link
Contributor Author

roman-dvorak commented Jan 27, 2022

@mrpollo @dagar
Hi, I did a rebase and I tested it again with a real sensor that everything works. Thank you!

Can you enable CI tests for this PR

@dagar dagar merged commit 2b12297 into PX4:master Feb 1, 2022
@roman-dvorak roman-dvorak deleted the tf/driver-sht35 branch February 1, 2022 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants