steven6282:
Ok scratch that. Looks like I've got at least one bad receiver. Swapped out the receiver with my 2nd receiver and now I'm receiving messages from one end of the house to the other (about 20 meters). It was missing some signals at that range but it was picking up at least 3 in 5.
That's more like it but you shouldn't stick to that 13 cm antenna. 13 cm is for 434MHz.
The wavelength at 315 MHz is 95.2 cm so a 1/4 wavelength antenna would have to be around 24 cm.
I never new antenna lengths had anything to do with it. I only used 13cm because I read that somewhere, don't remember where. Probably the sparkfun comments on the 434mhz version of the transmitter or something.
13cm is really to long for what I'm doing, 24 cm would be bordering on ludicrous lol Not unless I can coil it inside a project box and only have a small part sticking out, but that seems like it would defeat the purpose of an antenna.
People say this is a commonly used frequency in alarm systems and such but I don't recall ever seeing anything with a 24 cm antenna sticking out of it, so how do they achieve it? Like I said if I can coil it around inside the project box I can probably get by, even with 24cm. The question then is should it be a bare piece of wire, a rubber insulated piece of wire, or something else entirely? Is one type of wire / gauge of wire better than others if wire is ok to use? For the project I'm using this in, getting a message through to the receiver is important, but my overall project size needs to remain somewhat small and inconspicuous.
Right, it should be 17. My bad.
I've also read 13 in some guides but it should be 17 for 434MHz and that's what I'm using.
315 MHz ~1.5ft,
1/4 of that, ~11cm, should work well
What is 11cm? 1/8 wavelength?
Guess it should work too.
Experiment a bit. Try 11-12 cm and route it around inside your enclosure and try 24 cm and make more loops. It doesn't necessarily have to stick out.
Maybe it has to if you use a metal enclosure.
Any piece of wire should do. I've used thick single core copper without plastic insulation, thin single core jumper wire with insulation, a multi core wire with insulation from an ethernet cable (there are eight of these in each cable) and that worked fine too. I don't know what's best in theory.
The alarm devices you're mentioning are probably using coil antennas or pcb loop antennas which are a bit harder to get right.
Maybe someone here can tell what dimensions you would need for that.
Right, it should be 17. My bad.
I've also read 13 in some guides but it should be 17 for 434MHz and that's what I'm using.
315 MHz ~1.5ft,
1/4 of that, ~11cm, should work well
What is 11cm? 1/8 wavelength?
Guess it should work too.
Experiment a bit. Try 11-12 cm and route it around inside your enclosure and try 24 cm and make more loops. It doesn't necessarily have to stick out.
Maybe it has to if you use a metal enclosure.
Any piece of wire should do. I've used thick single core copper without plastic insulation, thin single core jumper wire with insulation, a multi core wire with insulation from an ethernet cable (there are eight of these in each cable) and that worked fine too. I don't know what's best in theory.
The alarm devices you're mentioning are probably using coil antennas or pcb loop antennas which are a bit harder to get right.
Maybe someone here can tell what dimensions you would need for that.
What kind of range are you aiming for?
Worse case scenario about 15 meters, but mostly within 10 meters.
I'm still playing with stuff just testing and prototyping right now. Got some transceivers to try out next if I can figure out how to wire them. They just use a bit more power which I'm not crazy about since I'm trying to keep these things low enough to run off batteries for a good amount of time.
Worse case scenario about 15 meters, but mostly within 10 meters.
I'd say you should reach 15 meters no matter what kind of wire and which of the antenna lengths you select as long as it's a length that matches the frequency.
Selecting any other length might not help.
I'm still playing with stuff just testing and prototyping right now. Got some transceivers to try out next if I can figure out how to wire them. They just use a bit more power which I'm not crazy about since I'm trying to keep these things low enough to run off batteries for a good amount of time.
How the heck do you solder something like that? It's really cheap and a 2.4ghz transceiver should have a lot less interference problems, and the power usage is between the rf transmitters and the transceivers I currently have (RFM12B-S2 Wireless Transceiver - 434MHz - WRL-09582 - SparkFun Electronics)
Does it require anything else to work? The description mentions something about works great with a 16mhz crystal, does it require that though?
Do you know for sure that the device is getting 5V? Those little devices usually just work. They worked well for me when I actually made the things before I retired. Clean 5V and Ground, the antenna wires should be about 7" or about 18CM and either vertical or horizontal doesn't matter as long as both are the same way. You might get lucky there as it is possible to decrease the interfering signal by changing antenna polarization, theoretically by a factor of 10, Practically about 1/3.
Lol thanks, I actually found the board version on sparkfun after I posted that, but wasn't going to pay 20 dollars for it on a board, however $5.50, that I can probably swing
And the same module here for $2.75 US (this price is typical of many vendors on Ebay) 5.50 Ea should be for a pair... Check it out. [price-up] NRF24L01 2.4G Wireless Module, Genuine Chip – ElectroDragon.
I recently bought 6 of those devices and a USB Receiver "Dongle" for $9.95... "Free Shipping"... Too ? $22.00 Ea... Yeah I'll Bet... that they would love to sell a bunch at that price, oh yeah and the Features on the $22.50 board are built into the Chip. All of the nRF24XX series Ic's have those features... They're part of what drove the original design and that was an inexpensive Chipset that could co-exist with all the other ISM stuff as well as Microwave Ovens @ 2450 Mhz and most capable of 1000 watts or more @ ~ 2450 mhz as the ovens use a "Power Oscillator" (A Klystron of Magnetron tube) neither of which has any external frequency control (Oscillating Frequency is set by internal cavity dimensions primarily).
Docedison:
And the same module here for $2.75 US (this price is typical of many vendors on Ebay) 5.50 Ea should be for a pair... Check it out. NRF24L01 2.4G Wireless Module, Genuine Chip - ElectroDragon.
I recently bought 6 of those devices and a USB Receiver "Dongle" for $9.95... "Free Shipping"... Too ? $22.00 Ea... Yeah I'll Bet... that they would love to sell a bunch at that price, oh yeah and the Features on the $22.50 board are built into the Chip. All of the nRF24XX series Ic's have those features... They're part of what drove the original design and that was an inexpensive Chipset that could co-exist with all the other ISM stuff as well as Microwave Ovens @ 2450 Mhz and most capable of 1000 watts or more @ ~ 2450 mhz as the ovens use a "Power Oscillator" (A Klystron of Magnetron tube) neither of which has any external frequency control (Oscillating Frequency is set by internal cavity dimensions primarily).
Doc
That $2.75 one doesn't look like the + model that sales for $5.50 at the other place. The + model adds a few features including a slower transmit speed for increased range and less power usage.
Although I'd probably buy this one instead: Nrf24l01 | eBay a little bit more expensive but it's located in the US, so would get here 3 times quicker lol.
So, I'm testing the RF434, with VirtualWire. And is there a way to make it translate what it recieved into a text? Instead of hex codes for each letter.
Sure, just translate the hexcodes into letters. Translation is available at asciitable.com
Say you get 1 character at a time:
// mapping from incoming character to font_array or other commands: \ + = < >
// invalid characters are not defined and are ignored
switch(incomingByte){
case 0x20:
Serial.print(" ");
break;
case 0x21:
Serial.print("!");
break;
case 0x2d:
Serial.print("-");
break;
case 0x2e:
Serial.print(".");
break;
case 0x2f:
Serial.print("/");
break;
case 0x30:
Serial.print("0");
break;
case 0x31:
Serial.print("1");
break;
// etc.
}
But I've ran into another problem, the VirtualWire library is hard to understand.
I'm using a DHT11 to measure the temperature, now getting the readings from the DHT11 is easy, getting em shown in the serial monitor is easy.
Problem comes when I want to send the readings using VirtualWire, thats hard Or I'm sure I'm missing something...
This is my code:
Problems starts in "char *msg = char(DHT11.temperature);" it seems.
// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@open.com.au)
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $
// dewPoint function NOAA
// reference: http://wahiduddin.net/calc/density_algorithms.htm
double dewPoint(double celsius, double humidity)
{
double A0= 373.15/(273.15 + celsius);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078); // temp var
return (241.88 * T) / (17.558-T);
}
// delta max = 0.6544 wrt dewPoint()
// 5x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity/100);
double Td = (b * temp) / (a - temp);
return Td;
}
#include <dht11.h>
dht11 DHT11;
#define DHT11PIN 2
#include <VirtualWire.h>
int tempsend;
char tempconv;
char fuck;
void setup()
{
Serial.begin(9600); // Debugging only
Serial.println("setup");
Serial.println("DHT11 TEST PROGRAM ");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHT11LIB_VERSION);
Serial.println();
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec
}
void loop()
{
Serial.println("\n");
int chk = DHT11.read(DHT11PIN);
Serial.print("Read sensor: ");
switch (chk)
{
case 0: Serial.println("OK"); break;
case -1: Serial.println("Checksum error"); break;
case -2: Serial.println("Time out error"); break;
default: Serial.println("Unknown error"); break;
}
//Serial.print("Humidity (%): ");
//Serial.println((float)DHT11.humidity, 2);
Serial.print("Temperature (oC): ");
Serial.println(DHT11.temperature);
char *msg = char(DHT11.temperature);
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg, strlen(msg));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false);
delay(2000);
}
Since it complains I can't do "'int' to 'char*'", I tried to set a char() conversion first. But then it complains about this "'char' to 'char*'". So I try to remove the * infront of MSG, but then I get the warning about a constant char...
I'm really confused here, anyone want to help me think this one out?
Sigh, I wish VirtualWire would have more examples showing how to send other values than 'const char'.