Controllin a motor brushless by RF 433mhz

Hi guys!

I'm new here and I need help in a problem!

I don't get a program where I can control a brushless motor by RF 433mhz and a potentiometer to control yor velocity.

Whatever informations, programs and others will be welcome!

Thank you very much!

The brushless motor part is easy. You have to buy an ESC (Electronic Speed Control) and connect the small three pin servo cable to the arduino . You can find the ESC at Hobbyking.
http://hobbyking.com/hobbyking/store/index.asp
Red=> No connection (this is an OUTPUT from the BEC 5V regulator built into the ESC)
Black=> Arduino GND
Yellow (or orange)=> connect to whichever pin you use for the Servo Library

I can't help you with the RF link because I don't have a 433Mhz radio pair. I don't know what the format is for these. I suggest you try google for that but put the word "arduino " at the beginning of your search to screen out PIC and Basic Stamp examples.

Hello,

Yes you can indeed controll a brushless motor using an ESC connected to the arduino but I suggest you to get a better wireless communication system. I would say that a 2.4Ghz module is better : for example, the NRF24L01 is awesome ! It gives you 1km range and 2Mbps data rate : NRF24L01+PA+LNA SMA Antenna Wireless Transceiver communication module 2.4G 1100m | eBay here is the ebay link for it

@FabioSantos85, your original question is very unclear. Are you planning to have 2 Arduinos communicating with each other using a wireless link with one of them connected to the motor controller and the other doing what?

...R

It gives you 1km range and 2Mbps data rate : NRF24L01+PA+LNA SMA Antenna Wireless Transceiver communication module 2.4G 1100m | eBay here is the ebay link for it

Not with the pcb antenna. Maybe with the external screw on antenna but you won't get 1 km with that little trace antenna.
I have heard the range for NRF24L01 sucks but I haven't actually tested it myself. I have a pair of the cheapest ones but I know that 2.4Ghz radios in general do get good range. (commercial consumer non-hobbyist products).

If general if you want range go for longer wavelengths (or use high gain directional antennas)

http://www.seeedstudio.com/wiki/Grove_-_433MHz_Simple_RF_Link_Kit

http://ninjablocks.com/blogs/how-to/7501042-adding-rf-433mhz-to-your-arduino

https://sites.google.com/site/summerfuelrobots/arduino-sensor-tutorials/rf-wireless-transmitter-receiver-module-433mhz-for-arduino

@FabioSantos85, your original question is very unclear. Are you planning to have 2 Arduinos communicating with each other using a wireless link with one of them connected to the motor controller and the other doing what?

Hi Robin2!

Correct my friend, I’m sorry about the question, my English is low yet kkkkkkkk, but I’m trying!

So, I’m trying to communicate two arduinos with each other using a module RF 433mhz and controlling by pottentiometer to control the motor brushless velocity, but I’m not having success. I’ve tried with RCswitch and VirtualWire library but anything happens.

I hope your help my friend!

This needs to be broken out into several simple pieces

FIRST With a single Arduino and no wireless are you able to control the motor in the way you want with a potentiometer?

SECOND With the 2 Arduinos (and no motor or potentiometer) can you send bytes from one Arduino to the other?

...R

Robin2,

I want to do a quadcopter, but I need to do a test using two arduinos, RF transmitter and receiver, potentiometer and just one brushless motor.

I've gotten to communicate the RF transmitter and receiver in simple programs, but in programs where I used a potentiometer and brushless motor there wasn't communication.

I would like a simple program where I can control a brushless motor by RF 433mhz just this.

Thank you Robin2!

What about the FIRST step in my earlier post?

There can be no progress until you have that part working.

...R

Which 433MHz modules are you working with? The cheap OOK ones have absolutely
awful selectivity and will pick up tonnes of interference and are unsuitable. You need
a transceiver-on-a-chip FM system with proper antenna matching circuit at the very least.
OOK (on-off keying) is extremely prone to picking up EMI. FM is definitely the way to go.

MarkT,

I've realized research about the transceiver and I like nRF24L01, has a good price.

Do you have any code about servo control by transceiver?

Thank you for your help!

You need to break the task down into pieces, one piece is servo control,
one piece is handling the transceiver. Once you have those pieces and
understand them it should be fairly clear how to connect them. Search
for prior examples of both.

Hi guys!

After much work, I got the communication between transmitter and receiver RF 433mhz. I thank you very much for the help, now I intend to develop communication for 4 brushless motors. I want to build a quadcopter drone.

I post the video on youtube: Controlling a brushless motor by RF 433mhz - YouTube

Thanks guys!

Please post your final code. - Scotty

Transmitter code:

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

int pinoPotenciometro = 0;

void setup() {

Serial.begin(9600);

mySwitch.enableTransmit(10);
delay(500);

}

void loop() {

int valordoSensor = analogRead(pinoPotenciometro);
valordoSensor = valordoSensor /6;
mySwitch.send(valordoSensor, 24);
delay(200);

}

Receiver code:

#include <RCSwitch.h>
#include <Servo.h>

int pos = 0;
//avalia a posicao do motor antes para
//nao receber ruido do emissor
int posicaoAnterior =0;

//cria o objeto dp servo motor
Servo myservo;

//Instacia a Biblioteca RF
RCSwitch mySwitch = RCSwitch();

//led de status
int led =13;

int led1 =3;
int led2 =4;
int led3 =5;
int led4 =6;
int led5 =7;
int led6 =8;

void setup() {
//liga o servo ao pino 10
myservo.attach(10);
Serial.begin(9600);

mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2
//seta o pino do leds e led de status como saida
pinMode(led, OUTPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
}

void loop() {

if (mySwitch.available()) {

int value = mySwitch.getReceivedValue();

if (value == 0) {
Serial.println(“Unknown encoding”);

} else {
//verifica se houve alguma alteracao
//no ptenciometro e descarta ruidos
int posicaoFinal = posicaoAnterior - mySwitch.getReceivedValue();

if(posicaoFinal < -4 || posicaoFinal > 4){
Serial.println( mySwitch.getReceivedValue());
myservo.write(mySwitch.getReceivedValue());
//verifica quais leds devem ser acesos
statusLeds(mySwitch.getReceivedValue());
}
//salva a ultima posicao lida
posicaoAnterior = mySwitch.getReceivedValue();

}
mySwitch.resetAvailable();
}

digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)

}

//metodo que avalia qual led deve acender
void statusLeds(int x){

if(x < 31){

digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);

}else if(x < 61){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);

}else if(x < 91){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);

}else if(x < 121){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
}else if(x < 151){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, LOW);
}else if(x < 171){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
}
}

Don’t need leds, just 2 Arduinos. I’m sorry the codes are in Portuguese.

My videos: Wireless Control using RF 433mhz module - YouTube
Controlling a brushless motor by RF 433mhz - YouTube