Update:DIY wireless temperature sensor for Tellstick

Moderator: Telldus

Post Reply
niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

This is a description of how you can build your own temperature sensor that is
compatible with the Telldus products; Tellstick DUO / NET. As a matter of fact, the Tellstick will not be able to tell the difference.
It is also verified to work with RFXtrx433 (from RFXCom.com)

Please read the heading of the .asm-file for the most updated information.

An ESIC/Viking temperature sensor clone with better precision(?) and better range, and best of all,
It can mimic up to at least 11 ESIC/Viking temperature sensors with only one device with 10 DS18B20/DS1820/DS18S20/DS1822 and one DTH22.
Or, wireless 1-wire if you'd like.
There is also support for the combined temperature/humidity sensor DHT22/RHT03/AM2302 and a PIR-sensor.
You can combine the sensors above as you want.

There are very few components needed to build the sensor and it will be cheaper
than the ESIC/Viking thermometer as long as you order PIC/Sensors/TX433 from
http://ebay.com or http://dx.com. The cost is however not the reason for
building this clone. It's because you can :)
Better sending range and flexibility comes as a bonus.

Hardware (version<=0.6):
The thermometer is built with the following components,
- PIC12F675
- DS18B20 Dallas Temperature sensor(s) (±0.5C over the range of -10C to +85C) or DS1820/DS18S20/DS1822
- BC547B Transistor
- TX433 Velleman 433 MHz transmitter module
- 1.5k resistor
- 4.7k resistor
- 10k resistor
- LED
- 100n decoupling capacitor

Circuit description (version<=0.6):
Image

Hardware (esic_clone version>=0.7 and fineoffset_clone),
- PIC12F675
- DS18B20 Dallas Temperature sensor(s) (±0.5C over the range of -10C to +85C) or DS1820/DS18S20/DS1822 (Optional)
- DHT22/RHT03/AM2302 Temperature/Humidity sensor (Optional)
- PIR sensor (HC-SR501) Google "DYP-ME003/Specification.pdf" (Optional)
- BC547B Transistor
- 433 MHz transmitter module (t.ex. den som Kjell.com har funkar)
- 2.7k resistor
- 2pcs 4.7k resistor
- 10k resistor
- LED
- 100nF decoupling capacitor

Circuit description (esic_clone ver.>=0.7 and fineoffset_clone)
Image

I have added a transistor to switch on/off the TX433 module.
The original electrical scheme connects the GPIO2-pin directly to TX433 but I
could not get that to work. Probably due to the low currents sent from the PIC.

Software:
This has been one of my first PIC projects, so I am not very familiar with PIC-
assembler. The code could probably be optimised.

The ESIC-thermometer is sending the Humidity value as a 7-bit integer.
In my "clone" I have used the 7-bit humidity field to send the current battery
status level when sending data from the 1-wire sensors. The number you get
is dependent on Vdd. Anything from 3V to 5.5V should be OK to feed the
circuit with. Low numbers mean high voltage in relation to the reference
voltage drop over the LED. In my case 1.77V Vdd=Vdiod/Humidity/2*256,
Vdiod is the voltage drop over the diode and Humidity is the read value from
the Tellstick.

Data packets sent from the DHT22/RHT03/AM2302 readings will contain the actual humidity.

In the case when activity is detected by the PIR-sensor the humidity field is
not used. Nor is the temperature field.

I have not added any support for the battery status bit for the reason above.
It is also not yet implemented in the current telldus-core release.

The system define SAMPLE_DELAY tell how many 2.6 second periods that should pass
until next sample/transmission. This is 23 in the asm-code which corresponds to a transmission
approximately every minute.

The system define PACKET_RESENDS specifies how many packets in every burst that should
be sent. Default is 3, just like the original ESIC-thermometer.

The system define PIR_SENSOR_ID defines the sensorID to be used when an activity has been
detected by the PIR-sensor. Default is HC=15 CC=4.

If you need to re-compile the code you will need MPLab X IDE that is free to download,
http://www.microchip.com/pagehandler/en ... #downloads

esic_clone mimic ESIC/UPC sensors
fineoffset_clone mimic Viking sensors.

Code: Select all

					esic_clone =< 0.6	esic_clone >= 0.7	fineoffset_clone
DS18X20/DS1822		x							x						  x
DHT22/AM2302									  x						  x
PIR-sensor										 x						  x

Tellstick DUO		Yes						Yes						Yes
Tellstick NET		?						  ?						  ?
RFXtrx433			 ?						  Yes						Yes

x = supported
Yes = Verified OK
No = Do not work yet
? = I do not have the HW to verify my self. Can someone verify for me?
Update 1:

Support for up to 3 sensors!

Hardware:
The electric circuit has been updated. Now I only support active(normal) 1-wire mode.

Software:
Most of the code is also updated (esic_clone-0.2). Now it is possible to connect up to 3 DS18B20 / DS18S20 devices.
The scanned temperatures are sent with a House Code and Channel Code that is generated from parts of the unique individual 1-wire 6 byte device id. HC and CC is thus connected to a specific DS18x20 device. A battery change does not change any addresses.
New sensors can be added on the fly without turning off the power.

Read temperatures are sent in a quick burst.

Known faults:
I have tried with 4 sensors, but unfortunately the sender enters a tight loop sending all temperatures over an over again without paus. I will try to solve this in a later version.

Update 2:
Now with support for at least 4 temperature sensors. I do not have more than 4 at home, but more is on the way from China :D

Known faults:
None

It remains to be seen how long time the battery lasts :roll:

Update 3:

esic_clone-0.4.1 is available for download.

Updates:
* Better generation of House Code and Channel Code. The 6 bytes serial number are all XOR:ed to one byte that is used as HC and CC. Hopefully this will give better uniqueness of each sensor.
* New delay-macro.
* 8-bit resolution of the AD conversion of battery status. You can calculate the Vcc by the following formula, Vcc = Vdiod/Humidity/2*256, where Vdiod is the Voltage drop over the LED, and Humidity is the value that can be read from the Tellstick.
* Battery status is read faster.
* Checksum is calculated correct.
* Rewritten 1-wire routines.
* Safer initiation of the watchdog.

Known faults:
DS18S20 is not supported as I previously thought. On the other hand, DS1822 is supported.

Note that there is no support for parasite mode.
Removed version 0.2 to make space for version 0.4.1

Update 4:

esic_clone-0.5 is available for download.

I have corrected a bug where the temperature was 128C wrong if the battery status (a.k.a. humidity) was an odd number.

Update 5:

esic_clone-0.6 is available for download.

The bug where the temperature was shown wrong at 30C.

Update 6:

esic_clone-0.7.1 is available for download.

This is a non backwards compatible update w.r.t. HW
This version has also support for the combined temperature/humidity sensor DHT22/RHT03.

Update 7:

esic_clone-0.8 is available for download.

I have added support for a PIR-sensor.

Update 8:

esic_clone-0.8.1 is available for download.

I have added support for Beyond Measure when using a PIR-sensor.

Update 9:

esic_clone-0.8.3 is available for download.

Bug fix for 0.8.1 feature.

Update 10:

esic_clone-0.9 is available for download.
Corrects the problem with the DHT22-sensor only showing half the Humidity.
Corrects the problem with the DHT22-sensor showing faulty values for sub-zero temperatures.
Adds Data validation to the read DTH22-sensor readings.

Update 11:

fineoffset_clone-0.3 is available for download.
This version has the same features as the esic_clone-0.9, but with the difference that it sends the data over the Fineoffset v1 protocol. This protocol is used by the Viking sensors.

Update 12:

esic_clone-0.9.1 and esic_clone-0.6.2 is available for download.
Corrected the initial checksum value. Now the sensor actually works on RfxTrx433 as well :).
Thanks Pixi at Svenska Elektronikforumet for reporting and verifying the bug.
Thanks Bert at RfxCom that gave me a very quick response and informed me about the initial checksum value.

Update 13:
esic_clone-0.9.2 and fineoffset_clone-0.4 is available for download.
PIR-code updated to be more robust. No sporadic IRQ-events. PIR-event do not affect other sensors temperature readings.

Updated the post with a table that shows compatibility.

Update 14:
esic_clone-0.9.3 and fineoffset_clone-0.5 is available for download.
Increased preamble-length on both esic_clone and fineoffset_clone. This makes a huge improvement on the RFXtrx433 sensor detection. I have seen no missing packets so far. For you who uses a Tellstick DUO there is not so much reason to upgrade from previous version.

Update 15:
Det går även att ladda ner koden här, https://code.google.com/p/wireless-multi-sensor/

Update 16:
esic_clone-0.9.4 is available for download.
Now also support for DS1820, DS18S20 and DS1822.

Update 17:
esic_clone-0.9.5 is available for download.
Corrected a bug that was introduced in 0.9.4 after testing on the wrong hardware.

Update 18:
fineoffset_clone-0.6 is available for download.
Support for the same sensors as the esic_clone has support for.
Correction for the battery status not seen when using DS18X20/22 sensor.
Correction in crc-calculations. Now the fineoffset also works with Tellstick DUO/NET that is using beta firmware.

The PIR sensorID, DHT sensorID, number of packet resends and transmission interval is now configured in the EEPROM-area.
Here is the address locations of each parameter.

Code: Select all

EEPROM address and usage
0x00    Reserved
0x01    VERSION
0x02    PIR_SENSOR_ID
0x03    DHT_SENSOR_ID
0x04    CO2_SENSOR_ID
0x05    PACKET_RESENDS
0x06    SAMPLE_DELAY
Attachments
esic_clone-0.9.5.X.production.hex.zip
Corrected bug introduced due to verification on wrong hardware.
Support for DS1820, DS18S20 and DS1822.
(1.53 KiB) Downloaded 545 times
fineoffset-0.6.hex.zip
Configuration area in EEPROM. Fix CRC. Fix batt.status. Support for more sensors.
(1.64 KiB) Downloaded 489 times
esic_clone-0.6.2.zip
Checksum initialized to b'11'
(9.33 KiB) Downloaded 543 times
Last edited by niclasf on Fri May 30, 2014 10:06 pm, edited 21 times in total.

c0rner
Posts: 23
Joined: Thu Jan 18, 2018 11:08 am

Re: DIY wireless temperature (+misc) sensor for Tellstick

Post by c0rner » Thu Jan 18, 2018 11:08 am

Nice work! You need to change your implementation of the "mandolyn" protocol to get it 100% compatible (aside from your clever use of humi/battery). Humidity is only 7bit and does not need to be divided and temperature is actually 12bit ((value + 50) * 16).

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: DIY wireless temperature (+misc) sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

Thanks cOrner! Do you happen to have a reference or some more details to the 7bit/12bit Humidity/temperature information you give? It makes sense that the Humidity does not need to be divided by two.

I have earlier only seen two interpretations/implementations of the Mandolyn protocol.
1. The one that has been implemented by Telldus in the ProtocolMandolyn.cpp
2. A user called Stest in elektronikforumet.com have another interpretation, http://elektronikforumet.com/forum/view ... 50#p601250

I have implemented according to number 2 since it seem more logic w.r.t. battery status flag and also package sequence number bits in the end.

c0rner
Posts: 23
Joined: Thu Jan 18, 2018 11:08 am

Re: DIY wireless temperature (+misc) sensor for Tellstick

Post by c0rner » Thu Jan 18, 2018 11:08 am

Yeah, there are a couple of variations of this protocol out there but I must admit I have not found any of them to be 100% accurate. What I did was just add all the bits and pieces of what I have found online and also from my own sensor readings and combined it all to something I think is complete.

You can se my implementation here https://gitorious.org/sticktools/protoc ... mandolyn.c as well as the two sources of information I used. Apparently this protocol is also known as UPM.

You should have no trouble implementing the "CRC" from this as well to make your sensor compatible with real weather stations. Btw, the two constant bits in the first byte (11) are most likely there to make the checksum usable.

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

Version 0.3 available now.

perkabolo
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: Update:DIY wireless temperature sensor for Tellstick

Post by perkabolo » Thu Jan 18, 2018 11:08 am

I want it!

Feel like making an instruction "for dummies" with pictures and stuff?

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

I can give it a go, but it will take some time.

I have not yet soldered all togeather :) All components is still sitting on an experiment board.
I will try to solder a real version soon and then I can take pictures.

Are there any special areas you want me to be specific?
Compiling the code?
Flashing the code onto the PIC?
Soldering components?
Following the electrical scheme?

I am glad you like the project :clap:

perkabolo
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: Update:DIY wireless temperature sensor for Tellstick

Post by perkabolo » Thu Jan 18, 2018 11:08 am

Yes please... :oops: all of it... ...with a detailed list of hardware requirements.

Its all new to me, but i'd realy like to give it a try. This could be the "killer hardware" for my tellstick that I have been missing.

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

New version out. esic_clone-0.4
Have Fun.

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

New version is out esic_clone-0.4.1
It replaces version 0.4 that had a faulty timing.

lioelec
Posts: 60
Joined: Thu Jan 18, 2018 11:08 am
Location: TARN 81 France
Contact:

Re: Update:DIY wireless temperature sensor for Tellstick

Post by lioelec » Thu Jan 18, 2018 11:08 am

Hi
your temperature sensor circuit is detected on telldus live ?
telldus Live!, http://tellmon.net, http://templight.se, Domospeak
tellstickNet rev17
20x otio,chacon,phoenix,GAO
2x THN132N
1x niclasf wireless t° sensor

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

Yes, indeed.
Here is the most resent information, http://elektronikforumet.com/forum/view ... =3&t=63772

lioelec
Posts: 60
Joined: Thu Jan 18, 2018 11:08 am
Location: TARN 81 France
Contact:

Re: Update:DIY wireless temperature sensor for Tellstick

Post by lioelec » Thu Jan 18, 2018 11:08 am

ok I will made that
How many circuit could be plug in same time ?
telldus Live!, http://tellmon.net, http://templight.se, Domospeak
tellstickNet rev17
20x otio,chacon,phoenix,GAO
2x THN132N
1x niclasf wireless t° sensor

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

There is one user at the elektronikforumet.se that has tested 10 sensors in total with success. I only have four sensors at home so far, but more ds18b20 are on their way from china.

niclasf
Posts: 163
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: Update:DIY wireless temperature sensor for Tellstick

Post by niclasf » Thu Jan 18, 2018 11:08 am

Esic_clone-0.5 is available for download at the elektronikforumet.

Post Reply