RF to Wi-fi

After a bit of work, I seam to have RF working.. using a receiver and transmitter but.. something is odd and sometimes no signal is picked up, sometimes it's pick up for a little while then nothing, and even with the antenna attached to the area stated in pictures and stuff, I don't seam to be getting the range of .. well, a few millimetres…

I was wondering, more then keep trying backwards and forwards to figure this all out, would it be much better to just change it to Wi-fi.. sure, that's more advance, but I'm not fully sure just HOW much (a pro is I could see able adding a video signal, where as RF is one-way). Just wondering does anyone have any advice on this or if it would still be better to try and figure out the whole RF problem?

I have heard that you shouldn't stick the two units that close together cause it can get 'drowned' out

What type of RF? NRF24L01+?

Please don't just assume people know what hardware you are using by using generic terms such as "RF" or "Wi-Fi".

No idea what you are on about with the "video signal" and RF is one way. Some RF modules are indeed one way. NRF24L01+ is bi-directional...

Sorry ^_^I think a mixture of being a bit tired and most of what I'm finding trying to say 'Standard' all the time..

the RF is a 433Mhz Transmitter Only and receiver only modules, the transmitter I believe is a ST-TX01-ASK (saw Type), though what they call a datasheet is such a joke that I haven't bothered with it, with a supply voltage of between 3 to 12 volts, which I'm currently using around 5vs (more 4.8v due to impedance) with a 32mm spring antenna which is meant to be copper (I haven't fully tested the metal type). the Transmitter has 3 pins (Positive, Negative and data) while the receiver has a stupid 4 pin setup where the two middle pins are both the SAME data line making it pretty pointless.

as for Wi-fi.. no clue. which was why I was making inquires about it.
as for Video signal, as stated, it was not something that was looked into highly because it was something I would like, more then something I want, but.. probably a M-jpeg format over serial connections.

hope that helps somewhat with your questions

transmitter I believe is a ST-TX01-ASK

well, pretty bad preconditions if YOU don't know what's on your desk.

Helpers need
a 100% correct information about the modules you are using
a clickable link to the datasheet of your modules.
At least a link to the product you bought,
a real picture of your wiring where the helpers can see each module and each wire/connection
both sketches you are using
and if the sketches are from a tutorial, a clickable link to that tutorial.

noiasca:
well, pretty bad preconditions if YOU don’t know what’s on your desk.

fair enough, I’m more used to working with a lot of unknowns and backwards engineering from that but it’s not always the best way, fair enough.

a 100% correct information about the modules you are using
a clickable link to the datasheet of your modules.

well, most places, like I said, just seam to call it a ‘433mhz RF Trans
mitter and Receiver modules’. the only differences I see from the photos, which all use the same PCB print, is about one coil which some say was replaced in a later revision. The board states FS1000A for the transmitter and the receiver is MX-RM-5V 080408. Searching for a data sheet, told me the transmitter module was the ST-TX01-ASK (saw type), but like stated, the one coil seamed to have been replaced and the module shown in the data sheet appears to have 4 pins, instead of 3, so I’m not sure that IS the right one, but using a shop like Components 101 which also points to the same data sheet makes me a bit unsure.

searching for them two module numbers online just seam to find stuff that is either the same, or slightly different revisions, so as I would expect a revision number on the board, but I can’t find one, i’m not sure I can fully ID the components, though this link to a site I don’t know much about <Componentsinfo.com> appears to be the right one and the same revision: FS1000A 433MHZ RF transmitter & XY-MK-5V Receiver Module Explanation, Pinout - Components Info

a real picture of your wiring where the helpers can see each module and each wire/connection

I’ll try to get my camera sorted out so I can take a couple of photos, at the moment, The receiver is back on a mini breadboard due to appearing to have a problem on the Prototype PCB, where the transmitter is in a more completed, but messy, setup which isn’t gonna be too easy to tell too much from looking, though I might have to rebuild that one too if the problem turns out to be that, but I don’t seam to be getting touching contacts… but i’ll have to try it out again… could probably do with getting a second breadboard some time

both sketches you are using

I didn’t post them cause the question wasn’t about some of the coding, and I know I need/want to tweak bits anyway, but I can give them.

I’m using RFTransmitter and RFReciever by Andreas Rohner, partly due to not being able to get Radiohead due to possibily a timer interfacing issue. the Servo’s are used on both the transmitter and receiver only to testing reasons, as they can be connected directly to the transmitter circuit to by-pass the RF in order to test out the code for the movements.

Oh, and i’m using a Sparkfun Pro Micro board

transmitter-

#include <Servo.h>  // servo library

#include <RFTransmitter.h>
#include <SPI.h> //Needed to compile?

Servo servoArmL;        // servo control object for the Left Arm
Servo servoArmR;        //Servo control object for the Right Arm
Servo servoHead;          // Servo control for the head

#define NODE_ID  1 //no clue
#define OUTPUT_PIN 16 //The digital pin for sending data via
RFTransmitter transmitter(OUTPUT_PIN, NODE_ID);

//const int TransmitPin = 12;
const int buttonPin = 2; //the number of the pushbutton pin for Moving Arms
const int RHeadPin = 3; //Number of the pushbutton pin for Turning head Right
const int LHeadPin = 4; //Number of the pushbutton pin for Turning head Left

int buttonState = 0;      //variable for reading the pushbutton status
int RHeadState = 0;
boolean RHeadTrig = false;
int LHeadState = 0;
boolean LHeadTrig = false;

int HeadPos = 90;
int armpos = 0;          //variable for roughtly where the arms are. 0 is down, 1 is up
boolean actionDone = true;//This will tell when an action is done, and there for the next
                          //action can be set

void setup()
{
  servoArmR.attach(15);//, 900, 2100);  //Connect the servo on the Left arm to pin 6
  servoArmL.attach(7); //Connect the servo on the Right arm to pin 5
  servoHead.attach(20); //6 //Connect head Servo to pin 6;

//Initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  pinMode(RHeadPin, INPUT);
  pinMode(LHeadPin, INPUT);

servoArmR.write(0);  //Might be an idea to automatically reset the arm position to down
  servoArmL.write(90);
  servoHead.write(90);
}
void loop()
{
  //*msg = “”; //set msg
  buttonState = digitalRead(buttonPin);
  int position;
 
  if (buttonState == HIGH){
    if (actionDone == true && armpos == 0){
      actionDone = false;
      char msg = “ArmUp”;
      transmitter.send((byte *)msg, strlen(msg) + 1);
      servoArmR.write(90);
      servoArmL.write(0);
      Serial.println(msg);
      delay(100);
      armpos = 1;
    } else if (actionDone == true && armpos == 1){
      servoArmR.write(0);
      servoArmL.write(90);
      actionDone = false;
      char msg = “ArmDown”;
      transmitter.send((byte *)msg, strlen(msg) +1);
     
      Serial.println(msg);
      delay(100);
      armpos = 0;
    }
  } else {
    actionDone = true;
  }
  RHeadState = digitalRead(RHeadPin);
  LHeadState = digitalRead(LHeadPin);
 
  if (RHeadState == HIGH && LHeadState == HIGH){
    HeadPos = 90;
    char msg = “HReset”;
    transmitter.send((byte *)msg, strlen(msg) +1);
    servoHead.write(90);
    Serial.println(msg);
    delay(20);
  } else if (RHeadState == HIGH){
    char msg = “HR”;
    transmitter.send((byte *)msg, strlen(msg) +1);
    if (HeadPos > 0){
      HeadPos -= 4;
    }
    Serial.println(msg);
    servoHead.write(HeadPos);
//    delay(20);
  } else if (LHeadState == HIGH){
    char *msg = “HL”;
    transmitter.send((byte *)msg, strlen(msg) +1);
    if (HeadPos < 180){
      HeadPos += 4;
    }
    Serial.println(msg);
    servoHead.write(HeadPos);
//    delay(20);
  }
}




Receiver-


#include <Servo.h>  // servo library
#include <PinChangeInterruptHandler.h>
#include <RFReceiver.h>
#include <SPI.h> //Needed to compile?

Servo servoArmL;        // servo control object for the Left Arm
Servo servoArmR;        //Servo control object for the Right Arm
Servo servoHead;          // Servo control for the head

//RFTransmitter transmitter(OUTPUT_PIN, NODE_ID);
RFReceiver receiver(9); //Receive on Pin 2
//Receiver cannot be pin 2… needs to be Pin 8,9,10,11,14,15 or 16 on a pro micro

int buttonState = 0;      //variable for reading the pushbutton status
int RHeadState = 0;
int LHeadState = 0;

int HeadPos = 90;
int armpos = 0;          //variable for roughtly where the arms are. 0 is down, 1 is up
boolean actionDone = true;//This will tell when an action is done, and there for the next
                          //action can be set
void setup()
{
  servoArmR.attach(15);//, 900, 2100);  //Connect the servo on the Left arm to pin 6
  servoArmL.attach(7); //Connect the servo on the Right arm to pin 5
  servoHead.attach(20); //6 //Connect head Servo to pin 6;
  //Initialize the pushbutton pin as an input:
  servoArmR.write(0);  //Might be an idea to automatically reset the arm position to down
  servoArmL.write(90);
  servoHead.write(90);
  Serial.begin(9600);
  receiver.begin();
}
void loop()
{
  char msg[MAX_PACKAGE_SIZE];
  msg[MAX_PACKAGE_SIZE - 1] = 0;
  byte senderId = 0;
  byte packageId = 0;
  byte len = receiver.recvPackage((byte *)msg, &senderId, &packageId);
  String msg_copy(msg);
 
  Serial.println(msg);
  int position;
  //int HeadPos = 90;
  //if (strncmp(msg, “ArmUp”, sizeof(“ArmUp”)) == 0){
  if (msg_copy ==“ArmUp”){
    servoArmR.write(90);
    servoArmL.write(0);
    Serial.println(“ArmUp-Move”);
    delay(100);
  } else if (msg_copy == “ArmDown”){
    servoArmR.write(0);
    servoArmL.write(90);
    Serial.println(“ArmDown-Move”);
    delay(100);
  } else if (msg_copy == “HReset”){
    servoHead.write(90);
    Serial.println(“HReset-Move”);
    delay(20);
  } else if (msg_copy == “HR”){
    if (HeadPos > 0){
      HeadPos -= 4;
    }
    Serial.println(“HR-Move”);
    servoHead.write(HeadPos);
    //delay(20);
  } else if (msg_copy == “HL”){
    if (HeadPos < 180){
      HeadPos += 4;
    }
    Serial.println(“HL-Move”);
    servoHead.write(HeadPos);
    //delay(20);
  }
}




I'll get the photos as soon as I am able to get some decent photos done

RadioHead can be configured to use a different hardware timer.

yep. Tried it, still problem. I think someone here commented to me that it might be related to the board i'm using (the Sparkfun ProMicro) not having enough timers or something with the Servos.. there was a lot of errors related to it and it was easier to use a different and smaller system

sorry for delay… a number of issues of life getting in the way…

Pictures aren’t great as I’m no good at taking close photos… I currently have both circuits on a breadboard. Two images attached but I’ll run through the connections:

Reciever:
Ground rail connected to Ground pin on ProMicro
Positive rail connected to VCC pin on ProMicro

Data line for RF reciever connected to Pin 9
vcc to Positive rail
Ground to ground rail
Servo1 control to Pin 20 (marked A2)
Servo1 Power to positive rail
Servo1 Ground to ground rail

Servo 2 and 3 unconnected at present

Transmitter:
Ground rail connected to Ground pin on ProMicro
Positive rail connected to VCC pin on ProMicro

Data line for RF transmitter to Pin 16
Power to positive rail
ground to ground rail

Button 1 input to positive rail
Button 1 output to Pin3
Button 1 output also to resistor (10k-Brown,Black,Orange,Gold)
Resistor to ground rail

Button 2 input to positive rail
Button 2 output to Pin 4
Button 2 output also to resistor (10K)
Resistor to ground rail

Button 3 unconnected at present

Current Receiver code:

#include <Servo.h>  // servo library
#include <PinChangeInterruptHandler.h>
#include <RFReceiver.h>
#include <SPI.h> //Needed to compile?

Servo servoArmL;         // servo control object for the Left Arm
Servo servoArmR;         //Servo control object for the Right Arm
Servo servoHead;          // Servo control for the head

RFReceiver receiver(9); //Receive on Pin 2/9
//Receiver cannot be pin 2.. needs to be Pin 8,9,10,11,14,15 or 16 on a pro micro 

int buttonState = 0;      //variable for reading the pushbutton status
int RHeadState = 0;
int LHeadState = 0;

boolean HeadLeft = false;
boolean HeadRight = false;
int HeadPos = 90;
int armpos = 0;           //variable for roughtly where the arms are. 0 is down, 1 is up
boolean actionDone = true;//This will tell when an action is done, and there for the next
                          //action can be set
void setup()
{
  servoArmR.attach(15);//, 900, 2100);  //Connect the servo on the Left arm to pin 6
  servoArmL.attach(7); //Connect the servo on the Right arm to pin 5
  servoHead.attach(20); //6 //Connect head Servo to pin 6;
  //Initialize the pushbutton pin as an input:
  servoArmR.write(0);   //Might be an idea to automatically reset the arm position to down
  servoArmL.write(90);
  servoHead.write(90);
  Serial.begin(9600);
  receiver.begin();
}
void loop()
{
  char msg[MAX_PACKAGE_SIZE];
  msg[MAX_PACKAGE_SIZE - 1] = 0;
  byte senderId = 0;
  byte packageId = 0;
  byte len = receiver.recvPackage((byte *)msg, &senderId, &packageId);
  String msg_copy(msg);
  
  Serial.println(msg);
  int position;
  if (msg_copy =="ArmUp"){
    servoArmR.write(90);
    servoArmL.write(0);
    Serial.println("ArmUp-Move");
    delay(100);
  } else if (msg_copy == "ArmDown"){
    servoArmR.write(0);
    servoArmL.write(90);
    Serial.println("ArmDown-Move");
    delay(100);
  } else if (msg_copy == "HReset"){
    servoHead.write(90);
    Serial.println("HReset-Move");
    delay(20);
  } else if (msg_copy == "HR"){
    if (HeadLeft){
      HeadRight = false;
      HeadLeft = false;
    } else {
      HeadRight = true;
      HeadLeft = false;
    }
    Serial.println("HL-Move Set");
  } else if (msg_copy == "HL"){
    if (HeadRight){
      HeadLeft = false;
      HeadRight = false;
    } else {
      HeadLeft = true;
      HeadRight = false;
    }
  }
  if (HeadRight){
    if (HeadPos > 0){
      HeadPos -= 4;
    }
    Serial.println("HR-Move");
    servoHead.write(HeadPos);
  }
  if (HeadLeft){
    if (HeadPos < 180){
      HeadPos += 4;
    }
    Serial.println("HL-Move");
    servoHead.write(HeadPos);    
  }
}

Current Transmitter code:

#include <Servo.h>  // servo library
#include <RFTransmitter.h>
#include <SPI.h> //Needed to compile?

Servo servoArmL;         // servo control object for the Left Arm
Servo servoArmR;         //Servo control object for the Right Arm
Servo servoHead;          // Servo control for the head

#define NODE_ID   1 //no clue
#define OUTPUT_PIN 16 //The digital pin for sending data via
RFTransmitter transmitter(OUTPUT_PIN, NODE_ID);

const int buttonPin = 2; //button 3 //the number of the pushbutton pin for Moving Arms
const int RHeadPin = 3; //button 1 //Number of the pushbutton pin for Turning head Right
const int LHeadPin = 4; //button 2 //Number of the pushbutton pin for Turning head Left

int buttonState = 0;      //variable for reading the pushbutton status
int RHeadState = 0;
boolean RHeadTrig = false;
int LHeadState = 0;
boolean LHeadTrig = false;

int HeadPos = 90;
int armpos = 0;           //variable for roughtly where the arms are. 0 is down, 1 is up
boolean actionDone = true;//This will tell when an action is done, and there for the next
                          //action can be set

void setup()
{
  servoArmR.attach(15);//, 900, 2100);  //Connect the servo on the Left arm to pin 6
  servoArmL.attach(7); //Connect the servo on the Right arm to pin 5
  servoHead.attach(20); //6 //Connect head Servo to pin 6;

  //Initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  pinMode(RHeadPin, INPUT);
  pinMode(LHeadPin, INPUT);

  servoArmR.write(0);   //Might be an idea to automatically reset the arm position to down
  servoArmL.write(90);
  servoHead.write(90);
}
void loop()
{
  buttonState = digitalRead(buttonPin);
  int position;
  
  if (buttonState == HIGH){
    if (actionDone == true && armpos == 0){
      actionDone = false;
      char msg[] = "ArmUp";
      transmitter.send((byte *)msg, strlen(msg) + 1);
      servoArmR.write(90);
      servoArmL.write(0);
      Serial.println(msg);
      delay(100);
      armpos = 1;
    } else if (actionDone == true && armpos == 1){
      servoArmR.write(0);
      servoArmL.write(90);
      actionDone = false;
      char msg[] = "ArmDown";
      transmitter.send((byte *)msg, strlen(msg) +1);
      
      Serial.println(msg);
      delay(100);
      armpos = 0;
    }
  } else {
    actionDone = true;
  }
  RHeadState = digitalRead(RHeadPin);
  LHeadState = digitalRead(LHeadPin);
  
  if (RHeadState == HIGH && LHeadState == HIGH){
    HeadPos = 90;
    char msg[] = "HReset";
    transmitter.send((byte *)msg, strlen(msg) +1);
    servoHead.write(90);
    Serial.println(msg);
    delay(20);
  } else if (RHeadState == HIGH){
    char msg[] = "HR";
    transmitter.send((byte *)msg, strlen(msg) +1);
    Serial.println(msg);
    servoHead.write(HeadPos);
  } else if (LHeadState == HIGH){
    char *msg = "HL";
    transmitter.send((byte *)msg, strlen(msg) +1);
    Serial.println(msg);
    servoHead.write(HeadPos);
  }
}

Did you go back and do heavy editing on your earlier posts? Please don't do that. It makes nonsense out of the replies.

You were quoted as saying, "I'm using RFTransmitter and RFReciever by Andreas Rohner, partly due to not being able to get Radiohead due to possibily a timer interfacing issue. " but now there is no post containing that statement.

nope.. I haven't edited anything.

The only odd time I do, I stick the word 'Edit:' then state the edit, but that's only adding something new when I don't think it's worth posting a new reply (and no-one else has replied since).

so.. a Admin or mod? strange..

Images:


ah yes, better way. I could only see to attach or insert if uploaded elsewhere, and that sometimes annoys me cause when you find a old-ish forum with something you have been looking for, only to find the imaged down, it can be a pain !_!

thanks :slight_smile: