Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:41 05 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Decoding DIGOO remote temperature sensor

Author Message
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 12:08pm 14 Mar 2018
Copy link to clipboard 
Print this post

This remote temperature and humidity sensor may be of interest. I have had three connected to the weather station that is available to match them.




Digoo Remote Sensor
$AU6.48 so price is good. I have one for some time and have not had to replaced the batteries on the remote sensor so seem to last pretty well.(Just looked it up just over 1 year on same batteries and still going)

I originally got them with the idea of decoding the 433mhz signal and putting the data into my own weather station. As each unit has a unique code you could connect several.

After a bit of inspiration from an idea from @tassiejim on here I have managed to decode the signal on a micromite using a 433mhz receiver.

  Quote   '------------------------------------------------------------------------------'
' Micromite Decoding of DIGOO Remote temperature sensor from Bangood- '
' '
' '
' Author: Gerry Allardice
' Credits: Tassie Jim for initial decoding code '
' '
dim ProgTitle$ = "DIGOO TEMP/HUMIDITY DECODER" '
' '
dim ProgVer$ = "v1.0.0" '
' '
dim ProgDate$ = "14-Mar-2018" '
'------------------------------------------------------------------------------'
' The DIGOO remote sensor sends code to the console station via 433.92MHz ASK code.
' It can be decoded by using a 433.92 reciever connected to a digital pin eg(16).
' The code seems to take this format.
' bits 1-13 are unique ID for the unit.
' bit 14 indicates that the message was sent using the test button
' bits 15-16 used to identify the channel selected on the remote. CH1-CH3.
' bits 17-28 contain the temperature. if bit 17 is 0 is a positve temperature and value is divided by 10
' If bit 17 is 1 then is a negative temperature and twos compliment is used and divided by 10.
' bits 30-36 are the percentage humidity
' Inspection of the recieved shows the signal is repeated three times and
' a 1 is about 4ms low pulse. 0 is about 2ms low pulse. stop is about 8ms low pulse.



Option Explicit
Option Default NONE


'================================================================================================
' Data Variables
'================================================================================================
dim tick AS INTEGER, tock AS INTEGER
dim code$,codeinv$

'================================================================================================
' Program Initialization
'================================================================================================

Print "Starting " + ProgTitle$ + ": " + ProgVer$ + " - " + ProgDate$

PWM 1, 100000, 50 ' this is out high resolution timer whch gets connected to pin 15
SETPIN 15, CIN
SETPIN 16, INTL, blip ' triggers on a high or low transition

'================================================================================================
' Main program loop
'================================================================================================


DO
'IF INKEY$<>"" THEN
'PRINT code$
'ENDIF
LOOP

END

SUB blip
tock=tick
tick =
PIN(15)

select case tick-tock
case > 800
if len(code$)=37 and left$(code$,1)="1" then
if mid$(code$,17,1)="0" then
Print code$+" ID: "+mid$(code$,1,13) +" CH" +STR$(VAL("&B"+mid$(code$,15,2))+1)+" " +STR$(VAL("&B"+mid$(code$,30,7)))+" "+ STR$(VAL("&B"+mid$(code$,17,12))/10)
else
Print code$ +"ID: "+mid$(code$,1,13)+" CH" +STR$(VAL("&B"+mid$(code$,15,2))+1)+" " +STR$(VAL("&B"+mid$(code$,30,7)))+" -"+ STR$((VAL("&B"+mid$(codeinv$,17,12))+1)/10)
endif

END if
'? len(code$)
code$=""
codeinv$=
""

case > 350
code$ = code$ +
"1"
codeinv$= codeinv$+
"0"
case > 150
code$ = code$ +
"0"
codeinv$= codeinv$+
"1"
case else
code$=
""
codeinv$=
""
END select

END SUB








Regards
Gerry

Edited by disco4now 2018-03-15
Latest F4 Latest H7
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 842
Posted: 08:01pm 14 Mar 2018
Copy link to clipboard 
Print this post

Gerry, well done! I bet a few shedders will be interested!
(I have a network of home-made units that this would supersede - they are much hungrier on batteries).
This opens up all sorts of possibilities for decoding 433 signals (Grogster has a thread on this too). {I now see that you have picked up on Grogster's thread.}

Some questions that spring to mind (and please forgive my ignorance):
- how did you hit on 433.92MHz? (I assume a little off and it doesn't work?)
- which "433.92MHz receiver" do you use (ie the hardware setup) because I WANT ONE!
- this should work on a MM170?
- what sort of range do you get (eg within a two story house and to a 1/4 acre block back yard?)

Cheers, AndrewEdited by Andrew_G 2018-03-16
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 08:19pm 14 Mar 2018
Copy link to clipboard 
Print this post

Excellent,

Can you point a link to the module you are using.

I've tried receiving data form my Clipsal Cent-a-meter with this receiver from FreeTronics & an Arduino, but it seems like the code may never have been refined.

Would rather do it with an MM if I can & it might be similar to the above.


Thanks

Phil.
 
RonnS
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 120
Posted: 08:58pm 14 Mar 2018
Copy link to clipboard 
Print this post

...ingenious
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 09:40pm 14 Mar 2018
Copy link to clipboard 
Print this post

NICE CODING!!!

Paul in NY
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 842
Posted: 10:04pm 14 Mar 2018
Copy link to clipboard 
Print this post

Gerry, I can answer two of my four questions above:
- you "hit on 433.92" because that is what it is - doh!
- yes it should work on a MM170 (as Tassie Jim explains in his inspiration-giving post on Grogster's thread).

Cheers, Andrew
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 225
Posted: 10:42pm 14 Mar 2018
Copy link to clipboard 
Print this post

  Quote  Can you point a link to the module you are using



https://www.banggood.com/Digoo-DG-R8S-433MHz-Wireless-Digital-Hygrometer-Thermometer-Weather-Station-Remote-Sensor-p-113 9603.html?rmmds=search&cur_warehouse=CN


Bill


In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 10:46pm 14 Mar 2018
Copy link to clipboard 
Print this post

  Bill.b said  
  Quote  Can you point a link to the module you are using



https://www.banggood.com/Digoo-DG-R8S-433MHz-Wireless-Digital-Hygrometer-Thermometer-Weather-Station-Remote-Sensor-p-113 9603.html?rmmds=search&cur_warehouse=CN


Bill



It's actually the receiver module that interests me. Curious as to if it's the same as the ones I have.

Phil
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 10:53pm 14 Mar 2018
Copy link to clipboard 
Print this post

This is the one I am using. The range seems to be an issue as its only working for a few feet for now.

433mhz receiver

I did see a comparison of various receivers somewhere but can't seem to find it now.

OK found it.

comparison of receivers


Gerry



Edited by disco4now 2018-03-16
Latest F4 Latest H7
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 10:35am 16 Mar 2018
Copy link to clipboard 
Print this post

I have managed to improve the reception range so these remote sensors may be useful with the micromite.

I removed the coil antenna on the receiver and replaced with 17cm wire. This gave some improvement.

I opened up one of the remote sensors and the transmitter is a separate unit near the top.





It is easy to remove the coil antenna and add a straight 17cm wire.




This set up greatly improves the range. I am receiving from a couple of rooms away and one from outside, so getting to the useful range.




regards
Gerry


Latest F4 Latest H7
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 814
Posted: 01:21pm 20 Apr 2018
Copy link to clipboard 
Print this post

Hi Gerry,

thanks for sharing your code! I received my 433mhz receiver yesterday - it works really nice with your code and my 3 DIGGOO remote sensors!


(How) did you modified your receiver? (...where is the antenna on this little thing? - I ordered it from your link)

THANKS!

Frank
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 06:11am 21 Apr 2018
Copy link to clipboard 
Print this post

Hi Frank,

Here is a diagram showing where the antenna is connected.


Found it here.

I am using this loaded antenna from here. A straight 17.3cm wire also seems to work.

Loaded Antenna




Regards
Gerry














Latest F4 Latest H7
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 814
Posted: 02:47pm 22 Apr 2018
Copy link to clipboard 
Print this post

Hi Gerry,

thanks a lot! I will try it! ...did your receiver work with 3.3V? I receive only data when I supply it with 5V...

Frank
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 844
Posted: 11:55pm 22 Apr 2018
Copy link to clipboard 
Print this post

Hi Frank,
I have only used 5V so can't say about 3.3v.

Gerry
Latest F4 Latest H7
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024