Humidity sensor SHT2x for ArduPilotMega

I have implemented an i2c temperature+humidity sensor on my ArduPilotMega. This could be useful for anybody, so I will try to explain here how I did it.

 

What is needed:

3689425376?profile=original

the sensor i used is the SHT21 from Sensirion, but it should also work for the SHT25. On the manufacturer website you can find technical data about the sensors, and they also sell their sensors themselves:

I received the sensor from Sensirion mounted on a breakout board.

 

 

3689425326?profile=original

3689425416?profile=original

a connector to easily change the sensor breakout borad.I used one from samtec(ref SMS-104-01-G-S).

 

 

 

3689425387?profile=originalAn I2C/SMBus Voltage Traslator (I2C Level Shifter) With adapter because the sensor uses 3.3V i2c when the APM outputs 5V

 

 

 

 

3689425335?profile=originalAn EM-406/uBlox/MTK Adapter Cable 10 cm , or whatever length.

(only 4 wires are required. So you can remove the red one and the black one standing next to it)

 

 

 

Code:

I did include all the files I modified here.

 

Code features:

-I did not implement mavlink code for data transmission. It seems it requires changes in Mission Planner, which I cannot do.

-In the Command Line Interpreter (CLI), in the test "menu", the "meteo" command output temperature and humidity, until "enter" is pressed.

-It can log temperature and humidity about every second (I have to check if the logging interval is really 1 sec). The logged data can be retrieved in Mission Planner. Logging can be enabled or disabled in the "logs" menu.

 

So far it seems to work fine. I will test more in the next days.


a)     ArduPilotMega.pde

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Eric, 

    If you're still around, could you post a new download link to this code?

  • For a high altitude balloon/UAV drop example check out the Near Space Corporation.

  • I got it, thank you!

  • Andrew

    I have uploaded the file on a third party web service, accessible from the same link as before. Probably the link will not stand forever, so don't wait too much.

  • I'm interested in seeing the code. Do you have another web host you can use?

  • Scott

    Yes that could be a good solution for meteorological stations. I would rather go for a fixed wing UAV, as the wind can blow your balloon 50 km away in windy conditions.

    Some gps might also not work at very high altitudes, due to limitations of manufacturers. very high speed can also  be a limitation, when the balloon blasts at about 30km, the UAV would fall faster than sound speed.

  • Andrew

    I tried a few times to uplaod the file again, with no success :(. I don't know what I do wrong.

    If you are interested I can send you the source code.

  • @Eric...brings up an interesting thought - What about an instrument package / Quadrotor attached to a balloon...balloon goes up and measurements are taken / logged, then at a given altitude the system performs a cutaway, free falls most of the trip down, then pops a parachute for deceleration and to right the quad, then the quad performs a RTL function landing at the launch point  No more lost expensive instrument packages / radios; could be a fun / interesting project.

  • Download link is broken.

  • Nice attempt, could be very useful for measuring the temperature of the Lipo in flight.

This reply was deleted.