2

I'm sending some data from ATTINY85 to Arduino UNO using 433Mhz modules. Coding is Manchester using Manchester.h library from here.

Transmitting data works perfectly, 433 receiver gets data alright.

But Arduino UNO does not seem to receive data! Here is the code of the receiver:

/*
  Manchester Receiver example

  In this example receiver will receive one byte of payload and 4 bit sender id per transmission
  message also contains a checksum and receiver can check if the data has been transmitted correctly
  try different speeds using this 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
*/
#include <Manchester.h>

#define RX_PIN  4  //pin where your receiver is connected

uint8_t moo = 1;
uint8_t data;
uint8_t id;

void setup() {

//  pinMode( RX_PIN, INPUT );
  man.setupReceive(RX_PIN, MAN_600);
  man.beginReceive();
  Serial.begin(9600);
}

void loop() {
  if (man.receiveComplete()) { //received something
    uint16_t m = man.getMessage();

    Serial.write(m);
    man.beginReceive(); //start listening for next message right after you retrieve the message
  }

}

Transmitter code:

/*
  Manchester Transmitter example

  In this example transmitter will send one byte of data and 4bit sender ID per transmission
  message also contains a checksum and receiver can check if the data has been transmitted correctly
  try different speeds using this 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
*/
#include <Manchester.h>

#define TX_PIN  4  //pin where your transmitter is connected
#define SENDER_ID 5

uint8_t transmit_data = 0;

void setup() {
  man.setupTransmit(TX_PIN, MAN_600);
}

void loop() {
  //SENDER_ID can be ID of the sender if you have multiple transmitters so receiver knows who sent it
  //OR it can be receiver ID if you have multiple receivers so receiver knows it's for him
  //OR it can by just any arbitrary 4 bit number
  man.transmit(man.encodeMessage(SENDER_ID, transmit_data));
  transmit_data++;
  delay(200);
}

Anyone got idea what's the problem?

  • Might want to use Serial.println(m) instead of Serial.write(m) in the receiver sketch. – Mikael Patel May 22 '17 at 20:11
  • What clock is used on the ATtiny85? Did you burn the fuses correctly? I.e. is the timing correct? – Mikael Patel May 22 '17 at 20:17
  • @MikaelPatel I use 8MHz internal timer. By "burning fuses" you mean settings that I use while uploading program to microcontroller? For example Tools/B.O.D or Tools/Clock? – Em Ka May 23 '17 at 14:27
  • 1
    check that the chip is receiving data at all, and if it works THEN add the manchester code. – Lesto Apr 2 '18 at 9:54
  • 1
    Does it work from an Arduino Uno to another Arduino Uno? Does it work when you wire link them together? – sa_leinad Oct 29 '18 at 3:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.