Transmitting and receiving through 433MHz ASK RF module without Radiohead lib.

Hello all, I want to transmit and receive data (strings or numbers) through 433MHz ASK transmitter and receiver modules without Radiohead library. I am using software serial to transmit and receive data from 5th and 11th pins respectively. I used UNO for transmitter and Nano for receiver. Baud rate used is 9600. But I am getting some symbols at my serial monitor. I want to transmit and receive without Radiohead library. Suggestions pls. Thank you in advance

Moved here

What made you think that it belonged to the "Website and Forum" section ?

I am new to this forum. I have gone through new topic and I have posted. Kindly assist me if i am wrong

I have gone through new topic and I have posted.

Yes, but you were in the wrong forum section when you did it

Suggestions pls.

Post both the Tx and Rx code using code tags when you do

See the advice on posting a programming question given in Read this before posting a programming question

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

But I am getting some symbols at my serial monitor

What do you mean by that?

Why the reluctance to use the RH library?

I just want to develop code for transmission and receiving of data from the scratch. Kindly help me

vinayayyagari:
I just want to develop code for transmission and receiving of data from the scratch. Kindly help me

Start by posting your current code

The rational steps to be able to program the communications as you like is to FIRST get it working with known libraries, etc. Then you can confirm all the hardware is working. If your new code has problems, you can go back to the working code and reassure yourself that the hardware is still working properly.

Otherwise, you are combining the debugging of your electronics and wiring with writing your software.

Paul

I just want to develop code for transmission and receiving of data from the scratch.

Please describe what have you done so far.

Post the code you have, or describe the data encoding techniques you are considering.

Step 1 of writing device drivers from scratch - completely understand the hardware. Do you?

I have just sent a string “Hello World” and reading from a software serial port. I have not used any coding techniques since it is not required as this particular stage. Pls assist me i am getting some symbols in my serial monitor. The TX and RX code is given below.

TX code:

#include<SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(11, 5);
void setup()
{
  mySerial.begin(9600);
  Serial.begin(9600);
  pinMode (5, OUTPUT);
}

void loop()
{
  int byteSent = mySerial.println("Hello World");
  Serial.print(byteSent);
  delay(1000);
}

RX Code:

#include<SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(12, 5);
# define BUFSIZE 10
int bs;
void setup()
{

  Serial.begin(9600);
  while (!Serial)
  {
    ;
  }
  mySerial.begin(9600);
  while (!mySerial)
    pinMode (12, INPUT);
}

void loop()
{
  char buf[BUFSIZE];
  char x;
  int buflen;
  buflen = BUFSIZE;
  if (mySerial.available() > 0)
  {
    for (bs = 0; bs <= BUFSIZE; bs = bs + 1)
    {
      x = mySerial.read();
      buf[bs] = x;
      Serial.println(buf);
    }
    Serial.print("Received "); Serial.print(buflen, DEC); Serial.write(" bytes:  ");
    buf[buflen] = 0;
    Serial.println((char*)buf);
  }
  delay (1000);
}

We can't assist you. Your concept is deeply flawed. The OOK radio modules transmission characteristics require special characteristics of the data stream, in order to operate. You can not just send serial ASCII over the link and expect it to work. You should research the RadioHead OOK implementation and receiver hardware documentation to understand why.

See reply #10!

If you have specific, creative ideas about making a working protocol, then please do post them, and we can have a real discussion about it. I suppose you could blindly develop a new protocol without comparison with the existing code (not sure why you would want to do that, though...). It would be an interesting discussion, but you need to propose some actual ideas, not just vague suggestions, questions, and failed experiments.

The string wont be going in binary form to OOK transmitter if i use print?

vinayayyagari:
The string wont be going in binary form to OOK transmitter if i use print?

It will, but the characteristics of the radios are such that transmissions are going to be very unreliable. There's a blog post by the author of the Manchester library that talks about some of the issues here: Mchr3k - Arduino: Wireless sensor node - manchester lib (3)

One thing you might want to experiment with is to set the baud rate to 1200 or 2400 for your current code. This isn't going to work particularly well, but you'll probably see the string you're sending minus the first character or two and you'll probably see random characters received when nothing is being sent. Perhaps this will provide the motivation to use an over-the-air protocol that is more reliable ala RadioHead.

Also be aware that it is illegal to transmit on 433MHz in some countries, using more than a very limited duty cycle. This is to prevent interference between consumer devices that use the frequency.

aarg:
We can't assist you. Your concept is deeply flawed. The OOK radio modules transmission characteristics require special characteristics of the data stream, in order to operate. You can not just send serial ASCII over the link and expect it to work. You should research the RadioHead OOK implementation and receiver hardware documentation to understand why.

See reply #10!

If you have specific, creative ideas about making a working protocol, then please do post them, and we can have a real discussion about it. I suppose you could blindly develop a new protocol without comparison with the existing code (not sure why you would want to do that, though...). It would be an interesting discussion, but you need to propose some actual ideas, not just vague suggestions, questions, and failed experiments.

You are correct we need to use protocol. I want to understand how it will really motivate us to use coding .
I sent alternate 1s and 0s and received correctly. I don’t understand why It is not working for series of 1s and 0s (strings or numbers)

By using digitalWrite and digitalRead , I could able to send 1s and 0s. Is there anything to do with digital write and read to send characters?

vinayayyagari:
By using digitalWrite and digitalRead , I could able to send 1s and 0s. Is there anything to do with digital write and read to send characters?

Yes, that is what RadioHead does. But not just ANY 1s and 0s. It has to follow some rules. This is the last advice you will get from me, as you seem to be ignoring it.

Some pattern of 1's and 0's, with some timing between transitions, make up a character.

You might actually learn something if you study what others have done.