HELP wireless temp sensor

jonny9696

New Member
I currently have a set up of a 18M2, temp sensor, am transmitter and receive and LED display. I have got them all working, I can write code to show numbers and letters on the display.

The code I have used for this is:

main:
pause 500
serout c.1, N2400, (“HELLO123”)
goto main

I then have tried to send the temperature to the LCD using the read command.

main:
pause 500
serout c.1, N2400, (#b1)

readtemp b.6, b1
pause100

goto main

can anyone help me going forward with my code. This code isn't working to send the temperature to the LCD screen.
I have attached the photo's of my set up. It is powered from a 5V main wall supply.

thanks
 
Last edited:

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

Are the radio modules you using what would be described as 'dumb modules' ? If so, and I would guess they are, then there has been considerable discussion of how to use those on the forum.

It is actually more complicated than using just SERIN and SEROUT but not that complicated.
 

jonny9696

New Member
Welcome to the PICAXE forum.

Are the radio modules you using what would be described as 'dumb modules' ? If so, and I would guess they are, then there has been considerable discussion of how to use those on the forum.

It is actually more complicated than using just SERIN and SEROUT but not that complicated.

I have read i2c but it won't let me program the picaxe
 

lbenson

Senior Member
If after your readtemp do you get the right temperature when you try printing it with sertxd?

readtemp b.6, b1
sertxd("temperature is ",#b1,cr,lf)

If not, do you have a pullup resistor (data to 5V, 4.7k).

You mention one-wire but are using the readtemp command instead of owin and owout.
 

PhilHornby

Senior Member
I'm confused

I currently have a set up of a 18M2, temp sensor, am transmitter and receive and LED display...
...I have attached the photo's of my set up. It is powered from a 5V main wall supply.
How many Picaxes are in use here - just the one :confused: ... are you trying to connect the output of the RF receiver to the (serial?) LCD ?

We seem to be missing the photo's (or better a circuit diagram - even if hand drawn)
 

jonny9696

New Member
How many Picaxes are in use here - just the one :confused: ... are you trying to connect the output of the RF receiver to the (serial?) LCD ?

We seem to be missing the photo's (or better a circuit diagram - even if hand drawn)
Currently using 1 picaxe, the LCD is directly connected to the receiver.
 

PhilHornby

Senior Member
You need another Picaxe.

Currently using 1 picaxe, the LCD is directly connected to the receiver.
OK - this could be made to work - with some modification to the code that the Picaxe on the LCD 'backpack' is running (assuming Rev Ed LCD). However, initially it will be easier if you introduce another Picaxe at the receiving end. An 08M2 will be fine.

The output from the cheap RF receivers is not a nice, clean, error-corrected RS232C signal - most of the time, it's just a mush of white noise! When it starts to 'hear' the transmitter, it adjusts its gain, until eventually, a signal emerges.

What you need to do at the transmitting end, is send a load of 'throwaway' characters, just to get the receiver into some kind of 'lock'; then you can send your data. I tend to use a string like "U*U*U*U*" as my conditioning signal (because "U" and "*" have lots of '1' to '0' transitions. Start your actual data transmission with some kind of easily recognisable string ("DATA" would do!), and use the 'prefix' qualifier on the SERIN command on the receiving Picaxe to look for that "DATA"? prefix.

[So - do something like: serout c.1, N2400, ("U*U*U*U*DATA ",#b1) @ the transmitter end, and something like serin pin,N2400,("DATA"),#b1] to receive it. See manual for syntax details)

Other stuff:-

.The transmitter needs to be turned OFF when not in use - otherwise you'll drown out every 433MHz system within earshot and potentially stop a lot of other stuff working. (Connect the GND pin of the transmitter to a Picaxe O/P and take it low when ready to send.)

.Don't have the transmitter and receiver too close together on the breadboard - they sometimes don't like that.

.For any sort of range, you need an aerial on both modules. This can start off as 17.2cm of wire, attached to the cunningly named 'ANT' pin, but more sophisticated (but cheap) designs exist.

.Finally, if your receiver module has an adjuster on it, throw it away :) You need one that's described as a 'Superhet' or 'Superheterodyne' receiver. They are TONS better than the others, but can be had cheaply on eBay.

That might get you started!

UPDATE

433MHz Aerials: https://github.com/OpenHR20/OpenHR20/wiki/2.1)--433-MHz-and-868-MHz--Antenna-Design-Examples and http://www.instructables.com/id/433-MHz-Coil-loaded-antenna/
 
Last edited:

jonny9696

New Member
OK - this could be made to work - with some modification to the code that the Picaxe on the LCD 'backpack' is running (assuming Rev Ed LCD). However, initially it will be easier if you introduce another Picaxe at the receiving end. An 08M2 will be fine.

The output from the cheap RF receivers is not a nice, clean, error-corrected RS232C signal - most of the time, it's just a mush of white noise! When it starts to 'hear' the transmitter, it adjusts its gain, until eventually, a signal emerges.

What you need to do at the transmitting end, is send a load of 'throwaway' characters, just to get the receiver into some kind of 'lock'; then you can send your data. I tend to use a string like "U*U*U*U*" as my conditioning signal (because "U" and "*" have lots of '1' to '0' transitions. Start your actual data transmission with some kind of easily recognisable string ("DATA" would do!), and use the 'prefix' qualifier on the SERIN command on the receiving Picaxe to look for that "DATA"? prefix.

[So - do something like: serout c.1, N2400, ("U*U*U*U*DATA ",#b1) @ the transmitter end, and something like serin pin,N2400,("DATA"),#b1] to receive it. See manual for syntax details)

Other stuff:-

.The transmitter needs to be turned OFF when not in use - otherwise you'll drown out every 433MHz system within earshot and potentially stop a lot of other stuff working. (Connect the GND pin of the transmitter to a Picaxe O/P and take it low when ready to send.)

.Don't have the transmitter and receiver too close together on the breadboard - they sometimes don't like that.

.For any sort of range, you need an aerial on both modules. This can start off as 17.2cm of wire, attached to the cunningly named 'ANT' pin, but more sophisticated (but cheap) designs exist.

.Finally, if your receiver module has an adjuster on it, throw it away :) You need one that's described as a 'Superhet' or 'Superheterodyne' receiver. They are TONS better than the others, but can be had cheaply on eBay.

That might get you started!

UPDATE

433MHz Aerials: https://github.com/OpenHR20/OpenHR20/wiki/2.1)--433-MHz-and-868-MHz--Antenna-Design-Examples and http://www.instructables.com/id/433-MHz-Coil-loaded-antenna/
Thanks for the help, I have actually got it to work by using the original code, the reason why it wouldn't work was because of the current drawn from all of the different components. This was a little fix by adding another PSU to the equation, this was just a 5V battery set up.

thanks everyone for the help :)
 
Top