Go Down

Topic: Decoding RF signal from Ambient Weather Thermo-Hygrometer (Read 45439 times) previous topic - next topic

BaronVonSchnowzer

Would be glad to if you can point me to an easy way of posting the code somewhere. It exceeds the 9K character limit of a post for posting it inline and I haven't tackled using git (I'm still back on Subversion).

Also, is there a way of monitoring a thread? I've marked my replies with "Notify me of replies" but I'm not getting email notifications.

BaronVonSchnowzer

#31
Jan 25, 2015, 08:37 pm Last Edit: Jan 25, 2015, 10:55 pm by BaronVonSchnowzer
Per robwlakes request, <update: link removed, code is attached in my next reply) It is based on the excellent work of others on the Manchester decoding found in the F007th sketches. Apologies for the changes for style - it is simply personal preference. I also modified it to use arrays rather than 7 scalars. And removed the Wifi and Xively code I wasn't using. I plan to soon combine it with the webserver example via the exec library and serve the sensor values via my Ethernet shield.

TomGeorge

Hi, use the Attachments and other options, to attach your sketch.

Tom..... :)
Everything runs on smoke, let the smoke out, it stops running....

BaronVonSchnowzer

Thanks for the pointer. Duh!
Here is the full code attached.

robwlakes

That is looking very good. Very compact, effective coding.  Nicely done.

Glad to be of assistance,

Rob
Learning Flute and C++, heading for a meltdown.

whatsupskip

The Ambient F007TH Sensor appears to be the same as the (Australia & NZ) Jaycar XC-0328 kit and the Jaycar XC0329 individual sensor. I just noticed today that they have put both of these on clearance, so this connection is only likely to be of use to those who already have one.

I have been trying to understand the basic parts of the code. I would like to use a NodeMCU ESP8266 or WEMOS equivalent to replace the CC3000 in the existing code.

If I understand correctly, one of the key lines is:

pinMode(RxPin, INPUT);

I can see that "int RxPin = 8;    //The number of signal from the Rx"

I don't understand what this corresponds to. Is it the number of potential sensors? Is it the input on the CC3000?

Using a RXB6 receiver module I was able to decode 433MHz codes from a 433MHz RF switch.
The code used for that used
"mySwitch.enableReceive(13); // Receiver on interrupt GPio 13 => that is pin D7"

Would the line become?:
pinMode.enableReceive(13);

Any assistance would be very much appreciated.

jremington

Quote
pinMode(RxPin, INPUT);

I can see that "int RxPin = 8;    //The number of signal from the Rx"

I don't understand what this corresponds to.
Arduino pin 8 is used in this case as an input to read the data output by the receiver. Any cheap 433 MHz receiver should work with the code in reply #33 above.


robwlakes

int RxPin = 8;

means that instead of using the character/number "8" to represent the number of the pin in question, the label "RxPin" can be used instead.  Change 8 to another number in that line and that number will be used by the rest of the program wherever RxPin is used. The comment added after the // is quite unhelpful.  As jremington suggests the 433MhzRx's output is attached to pin 8 which is the input in this case.


Quote
Using a RXB6 receiver module I was able to decode 433MHz codes from a 433MHz RF switch.
The code used for that used
"mySwitch.enableReceive(13); // Receiver on interrupt GPio 13 => that is pin D7"

Would the line become?:
pinMode.enableReceive(13);
This is more confusing to me.  mySwitch.enableReceive(13); would be some sort of procedure call either in another part of the same program or a library call.  If it is an Arduino it sounds some what unusual as I am not aware that 13 is the interrupt pin on an Arduino. Usually people just make use of Pin13 as an output with a status LED on it.

pinMode() sets the operation of a given pin as either an input or as an output,  and should not be considered interchangeable with mySwitch (most likely a library call?).

If you have code working with CC3000 it is unlikely you can swap a  NodeMCU ESP8266 or WEMOS in and not adjust your code to the new hardware.  Most likely you will need appropriate libraries for the new hard ware and then have to adapt the main program to use the new hardware library.

I hope this helps, R


Learning Flute and C++, heading for a meltdown.

whatsupskip

Thank you both for such helpful and prompt responses.

Looks like I will need to do more research on this topic, but at least I appear to have found working code and a well known name and model number of these sensors.

I wonder if Ambient is going to discontinue these sensors or it is just a decision taken by the local importer/distributor Jaycar?

robwlakes

I had to swap from a "Bios" weather station setup using a USB interface, to my current one with Oregon Scientific + Arduino->USB and it works so much better.  I bought a second OS Anemometer as a backup, as that was what broke on the Bios (I had bought 2 Bios systems when they were no longer sold, so third time unlucky). However the swap to the OS+Arduino solution is so much better, forced me to move on. I also have a 3-D printer now so could probably print repairs eg broken cups.  :)

Good luck...
Learning Flute and C++, heading for a meltdown.

whatsupskip

Just remember to scan the cups before they are broken. If it is broken in a storm, you might not have all the bits to work with.

whatsupskip

#41
May 31, 2017, 07:53 am Last Edit: May 31, 2017, 08:03 am by whatsupskip
int RxPin = 8;

means that instead of using the character/number "8" to represent the number of the pin in question, the label "RxPin" can be used instead.  Change 8 to another number in that line and that number will be used by the rest of the program wherever RxPin is used. The comment added after the // is quite unhelpful.  As jremington suggests the 433MhzRx's output is attached to pin 8 which is the input in this case.
Thanks for the help again.

I now have the WEMOS D1 Mini reading the data correctly and outputting the serial monitor.
Here are the changes I made to the code to get it to work.

Code: [Select]

// Libraries
// #include <SPI.h> Not needed as this is already included for ESP8266

#define MAX_BYTES 7
#define countof(x) (sizeof(x)/sizeof(x[0]))
// Interface Definitions
int RxPin           = 13;   // Receiver on interrupt GPIO 13 => that is pin D7


whatsupskip

https://github.com/robwlakes/ArduinoWeatherOS

Cheers, Rob 
Rob I was having a look at your Github page, very impressive work. I didn't think a Github page could look that good. In the circuit diagram I noticed that you have the ground next to the antenna connection on the 433MHz receiver going to the ground on the Arduino Uno. If I understand correctly, this is not the correct way to do it. This particular ground is the ground plane for the antenna. Now depending on the physical design of your system and where the antenna is located, the way you have it may actually degrade the reception sensitivity of your system. If it is working fine, then don't worry.

I have been amazed at the range I have been obtaining with the RXB6. I just have it on a breadboard without an antenna and it is picking up the signal at the other end of the house. Never expected that.


robwlakes

Yep, I agree with what you are saying, I now use a bit of coax with the shield stripped back and the core as an antenna.  So the shield goes to the earth nearest the ANT and the core to the ANT connection.  I have found it works really well.

I have added an indicator light as well as incorporating a UV detector and original sensor in to the design as well.  i am pleased you are getting value from this project.
Learning Flute and C++, heading for a meltdown.

AnotherGingerlee

What a great project!

I am really interested because I have built a multi zone heating controller using a Raspberry Pi, but now it needs some wireless thermostats, well, thermometers. I considered porting this code to run on a PIC which would be connected to the Pi using I2C but then I thought that it would be quicker to use an Arduino, but I know NOTHING about them.

Could someone give me some Arduino hints, please.

EG Would a 'Arduino Nano v3.0 - Compatible Board CH340G 5V 16MHz atmega328 Tested' be compatible?
Could I connect it to a PC using USB and no fancy hardware programmer, and then modify the code to send the data to the Pi over I2C or bit-bang it out - using a free development environment?

This is a non-commercial hack so as cheap as possible, please.
I have a homebrew PIC programmer and free C development environment so it would only cost 2.40GBP/3.20USD for a PIC12F1822 if I went that route. (I also have vero board etc lying around)
But I'm sure you want to persuade me to go Arduino, don't you? (where's the smiley face button?)
Sorry to those that get offended at the mention of such 'other' devices!

Go Up