It says it's an sht11 replacement on ebay, not sht21. That's might be
right, I'm not sure. But it's definitely not compatible with sht21, that's
an i2c sensor, and this is some unique one wire stuff.
To use it as sht11, you should create some files, similar to the four at
tos/platforms/telosa/chips/sht11.
What you should have change:
-Filenames. Otherwise, it will collide with the sht11 drivers.
-The string "Sht11.Resource" in HplSensirionSht11C and SensirionSht11C.
Again, otherwise it will collide with the sht11 drivers.
-The three pins and one interrupt in HplSensirionSht11C. This seems too
much for this chip, are you sure it's compatible? Check the datasheets!

After that, it should work just like the sht11, if it's really compatible.



By the way, the original problem with the sht21:

components new Sht21C as TempSensor;

This is obviously syntax error. It should be eighter
components Sht21C as TempSensor;
if Sht21C is not generic, which is the case or
components new Sht21C() as TempSensor;
if Sht21C would be generic.

But, for the sht21, non of this is correct, the top level components are
Sht21HumidityC and Sht21TemperatureC, both of them are generic, and
provides converted value in int16_t, not uint16_t. (or you can use the
unconverted values from Sht21RawHumidityC and Sht21RawTemperatureC, both of
them are generic, and provides uint16_t)

Best,
Andras Biro
http://ucmote.com




On Tue, Apr 8, 2014 at 8:41 PM, Antonis Tzounis <atzou...@gmail.com> wrote:

> Hello,
> Thank you for your reply.
> I'm using Telosb motes.
> The sensor module is DHT21 AM2301:
>
>
> https://www.google.gr/url?sa=t&source=web&rct=j&ei=OUJEU-jAFqjA0QXYwoGoDQ&url=http://meteobox.tk/files/AM2301.pdf&cd=1&ved=0CCoQFjAA&usg=AFQjCNHlxYDeUx4xhm7zJS7GrqbjMIe4xQ&sig2=qBcK4lWfQmh-0_YfzIQrOg
>
> In Ebay this sensor is sold as SHT replacement. The ones I have use one
> cable for data.
>
>
>
>
>
> -------- Αρχικό μήνυμα --------
> Από: András Bíró <andras.b...@ucmote.com>
> Ημερομηνία: 08/04/2014 21:10 (GMT+02:00)
> Προς: Antonis Tzounis <atzou...@gmail.com>
> Κοιν.: tinyos forum <tinyos-help@millennium.berkeley.edu>
> Θέμα: Re: [Tinyos-help] Help regarding SHT21 sensor
>
>
> Hi Antonis,
>
> What platform are you using?
> What is DHT21? I couldn't find anything about it..
>
>  Best,
> Andras Biro
> http://ucmote.com
>
>
>
> On Tue, Apr 8, 2014 at 6:22 PM, Antonis Tzounis <atzou...@gmail.com>wrote:
>
>> Hello,
>> I am trying to use SHT21 sensor, but there are errors both in my
>> configuration file and when I am trying to compile my code.  The error is
>> : component 'Sht21C' is not generic
>>
>> This is the part of the code that has this error:
>>  components new Sht21C as TempSensor;
>> components new Sht21C as HumiSensor;
>>
>> Please not that I have already created in my main module file.
>> //READ (SENSE)
>> interface Read<uint16_t> as TempRead; //Temperature reader
>> interface Read<uint16_t> as HumiRead; //Humidity reader
>>
>> And I implement the wiring back in my configuration file.
>>
>> This code works with SensirionSht11() device (which is generic).
>>
>> What am I doing wrong? Do you think it will work with DHT21(3-pin
>> interface) sensor?
>>
>> I am quite new in TinyOs so any suggestion, further reading or guidance
>> would be very helpful.
>> Thank you all.
>>
>> _______________________________________________
>> Tinyos-help mailing list
>> Tinyos-help@millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>
>
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to