Hi i am kind of new to arduino
And i have 2 questions, i hope you can help
1: when i code a transmitter (tx/rx), i cant get it to work without the usb cable( external supply from reciver). If i remove the usb cable, and connect it again, it wont work until it has been programmed again. Arduino RF link using 433MHz Transmitter / Receiver modules
2: i have triet to make my own transmitter and receiver, it looks as it transmits ok, but i cant get any output from the recever. The essential is, i have to be able to send 3 different signals and have 3 different outputs from the recever.
The Transmitter are just as basic as it can be. I change the byte written between (71,72,73) when i program.
// Used Arduino UNO
// This is a simple test app for cheap RF transmitter and receiver hardware.
// 433MHz RF Transmitter: http://electronics-diy.com/product_details.php?pid=250
// 433MHz RF Receiver: http://electronics-diy.com/product_details.php?pid=251
// Arduino digital pins
#define BUTTON_PIN 2
void setup(){
pinMode(BUTTON_PIN, INPUT);
Serial.begin(600);} // Hardware supports up to 2400, but 1200 gives longer range
void loop(){
Serial.write (73);
delay(5000);} // Debounce button
The Receiver are supposed to, identify which out of the 3 bytes are send, but as is,
it do not seem to receive much at all
// Used Arduino UNO
// This is a simple test app for cheap RF transmitter and receiver hardware.
// 433MHz RF Transmitter: http://electronics-diy.com/product_details.php?pid=250
// 433MHz RF Receiver: http://electronics-diy.com/product_details.php?pid=251
int LEDPIN = 2;
int ser;
boolean newData = false;
int light_led = 0;
void setup(){
pinMode(LEDPIN, OUTPUT);
digitalWrite(LEDPIN, LOW);
Serial.begin(600);} // Hardware supports up to 2400, but 1200 gives longer range
void loop(){
ser_read ();
if (ser == 71){ // Check to see if we got the 71 test number
light_led = 1;}
if (ser == 72){ // Check to see if we got the 71 test number
light_led = 2;}
if (ser == 73){ // Check to see if we got the 71 test number
light_led = 3;}
newData = false;
// Afhænig af værdien af light_led vælges en af de nedenstående programmer
switch (light_led){//(light_led) {
case 1:
digitalWrite(LEDPIN, HIGH);
delay(1000);
digitalWrite(LEDPIN, LOW);
ser=0;
break;
case 2:
analogWrite (LEDPIN,100);
delay(1000);
digitalWrite(LEDPIN, LOW);
ser=0;
break;
case 3:
analogWrite (LEDPIN,20);
delay(1000);
digitalWrite(LEDPIN, LOW);
ser=0;
break;
}}
void ser_read (){
if (Serial.available() > 0) {
ser=Serial.read();
newData = true;}}