Problem with 433MHz RF modules.

I’m having trouble with Manchester and RF modules. My setup is:

A 3.3V powered Tiny85 as the emitter. Should send a 9999 when button isn’t pressed, and 2761 when pressed.

I use a Pro Mini 3.3V (clone) as the receiver. When I wire the Tiny TX pin directly to the Pro Mini RX pin setup more or less work. Serial monitor shows that Pro Mini receives 9999 continuosly (even on a previous sketch where it only should send when pressed) when I press the button it takes some time to notice it’s pressed (I don’t use an interruption after all) and then serial monitor shows 2761 numbers for a while. I wouldn’t mind that for now, IF it worked wirelessly. But I can’t get it to work via the RF modules. I’ve connected a LED to the Tiny pin 1 so I know it actually sends something. And I own a Puxxing-888 which shows something seems to be sent. In a similar way I connected a LED to the DATA pin on the 433 Received, and when I transmit via PUxxing radio, that LEDs turns on. But I can’t get past that.

#include <Manchester.h>
/*
  Manchester Transmitter example
  In this example transmitter will send one 16 bit number
  per transmission.
  Try different speeds using these constants, your maximum
  possible speed will depend on various factors like transmitter 
  type, distance, microcontroller speed, ...
  MAN_300 0
  MAN_600 1
  MAN_1200 2
  MAN_2400 3
  MAN_4800 4
  MAN_9600 5
  MAN_19200 6
  MAN_38400 7
*/
#define TX_PIN 1  //pin where your transmitter is connected
uint16_t data1 = 2761;
uint16_t data2 = 9999;
int buttonState = 0;
const int buttonPin = 3;

void setup() {
  man.setupTransmit(TX_PIN, MAN_2400);
  pinMode(buttonPin, INPUT);
} 
void loop() {

  buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH ) {
  man.transmit(data1);
  delay(200);
  } else if (buttonState == LOW){
  man.transmit(data2);
  delay(200);  
  }
  digitalWrite(0, !digitalRead(0));
  delay(500);
}
#include <Manchester.h>
/*
  Manchester Receiver
  In this example receiver will receive one 16 bit number per
  transmittion to switch a relay on or off. 
  try different speeds using these constants, your maximum possible
  speed will depend on various factors like transmitter type, 
  distance,  microcontroller speed, ...

  MAN_300 0
  MAN_600 1
  MAN_1200 2
  MAN_2400 3
  MAN_4800 4
  MAN_9600 5
  MAN_19200 6
  MAN_38400 7
*/
#define RX_PIN 4
uint16_t m;

void setup() {
  Serial.begin(9600);
  man.setupReceive(RX_PIN, MAN_2400);
  man.beginReceive();
}

void loop() {
  if (man.receiveComplete()) {
    m = man.getMessage();
    Serial.println(m);
    man.beginReceive(); //start listening for next message right after you retrieve the message
  }
  Serial.println(m);
}

You could set up the receiver with a laptop and Audacity, like this, to see if the message being sent is as you expected it to be.

Saddly I can't do that ATM. I tried one thing: when I transmit fro my Puxxing radio the LED lights up even if the circuit isn't powered. I made the coil antennas, but now everething works even worse.

Use the VirtualWire library to send your messages. http://www.airspayce.com/mikem/arduino/VirtualWire/ or the subsequent RadioHead library and its RH_ASK driver. Try sending the unpushed button data periodically, like a message every 1/4 second or so, and the pushed button data more frequently, every 1/10 second or similar.

CrossRoads:
Use the VirtualWire library to send your messages.
VirtualWire: VirtualWire library for Arduino and other boards
or the subsequent RadioHead library and its RH_ASK driver.
Try sending the unpushed button data periodically, like a message every 1/4 second or so, and the pushed button data more frequently, every 1/10 second or similar.

Thank you. RadioHead isn’t compatible with Tiny85 for what I’ve read and tested.

To summarize:

Manchester works perfect when there's a wired communication, but not through RF modules. A simple (no libraries) low/high digitalWrite to RF transmitter, with the RF receptor wired to an analogue input seems to work (althought the high signal is perceived as a 600 value but that value gets smaller every cycle). VirtualWire library doesn't seem to work for receiving.

God, I don't get why nothing ever works for me.

Manchester works perfect when there's a wired communication, but not through RF modules.

Then something is wrong with the modules, or your wiring.

with the RF receptor wired to an analogue input seems to work

Using analogRead() for digital communications won't work with radios. Too slow.

jremington: Then something is wrong with the modules, or your wiring. Using analogRead() for digital communications won't work with radios. Too slow.

I know it's too slow, I simply wanted to know if the transmiter worked. And seems that it identifies when the emitter sends a high or a low signal.

Took a few tries but one of the manchester libraries finally worked on a bare ATTiny85 to transmit. But receiver was using a Nano to display the message sent on an i2c LCD.

INTP: Took a few tries but one of the manchester libraries finally worked on a bare ATTiny85 to transmit. But receiver was using a Nano to display the message sent on an i2c LCD.

Could you provide more details? Why it took various tries? Hoe did you solved it?

Following this example, VirtualWire also works perfectly when there's a wired communication, but not through modules.

EDIT:

Weid, if I transmit something from my radio, sometimes I actually receive the messageges from the ATTiny. It's as if the receptor doesn't know when a transmission end and a new one starts.

Got: 104 101 108 108 111 32 210 
Got: 104 101 108 108 111 32 54 
Got: 104 101 108 108 111 32 157 
Got: 104 101 108 108 111 32 159 
Got: 104 101 108 108 111 32 182 
Got: 104 101 108 108 111 32 183 
Got: 104 101 108 108 111 32 184 
Got: 104 101 108 108 111 32 218 
Got: 104 101 108 108 111 32 237 
Got: 104 101 108 108 111 32 238 
Got: 104 101 108 108 111 32 239

I received a new pair, but still doesn't work. When both parts are powered by 3.3V when the emitter sends (and LED is ON) the receiver is ON too.

But when both are powered by 5V, the receiver seems to be inverted. Always on 'til the emitter lights up and the receiver LED goes off.

My 433 MHz modules don’t work at 3.3V. I have several and they work fine at 5V, the design voltage.

Note that the TX module transmits only when DATA is high.

https://www.youtube.com/watch?v=ZAEdJfrcyxA

I made a video about it, halfway I change the USB-serial adaptor supply from 3.3V to 5V and receiverd turns to work inverted.

It works! My God it works, can't believe it! Using VirtualWire.

Emitter: Tiny85 + 433 emitter. Working at 3.7V from a LiPo. Receiver: Pro mini (8MHz, 3.3V version) + 433 Receiver. Working at 3.3V from USB Serial adaptor.

You're using VirtualWire on both transmitter and receiver?