HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Apr 30, 2014, 04:55 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
@HD
http://www.rcgroups.com/forums/showthread.php?t=1979636

code is here for tft shield:
http://www.rcgroups.com/forums/showthread.php?t=1979636

hope you like it. Perhaps nice as a V2 or for people who just want an addon.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Sign up now
to remove ads between posts
Old Apr 30, 2014, 06:38 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,589 Posts
@ HD,

Yes, I was thinking the same thing.

@ Danny,

Did your regulators show up yet?
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old May 01, 2014, 01:37 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
No regulators yet. The ebay profile said UK, but I think it's HK instead.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old May 02, 2014, 12:33 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
Got the regulator, no success as of yet. So I continued with the Seperate Arduino for transmission. I use the serial port from the mega (as a pin reader and main controller) and the Arduino Uno (just for transmitting and checking). This gives me the best options for the future. This is how the transmitter looks. It functions well and is fast in respons. Just need to add some cosmetics like a holder plate for the antenna and a few knobs and covers for the slider pots. I keep this version as a final version release version 1. I'll be making some schematics for this one this week. No complicated pcb's needed, most is of the shelf or free-form build. Range is about 1000m they say, but for most of us that's way to much for our boats, so the range is sufficient. The code will be cleaned up this week and get published. I will keep the direct NRF option open in the code, so you guys can experiment with it. The final version still has 10 servo support and the option for digital trims. You can select with comments how many you actually use. Total of 32 switch options. All switches have a software pull-up, so you don't have to use them or solder resistors on them even if you don't use them. A Rotary encoder is supported and work nice. Can be upgraded by the experts on this field. The Encoder and 7-segment led display are optional. If you don't need them, you can set the channel in the code. All functions are debugable with comments. The voltage display is a cheapo from hoobyking. Just removed the paper wrapper and soldered the wires on the switch so I can have a remote push button to change between voltage, Ah and wattage. The system use about 0,2 Ah, I guess my 2200mAh Lipo will last quit a while before the lipo safer kicks in.



and the inside:


Danny

PS: yes, the receving side will follow.
Dutchraptor is online now Find More Posts by Dutchraptor
Last edited by Dutchraptor; May 03, 2014 at 01:19 AM.
Reply With Quote
Old May 02, 2014, 04:22 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,589 Posts
Nice!

Does the LCD panel display anything else?

EDIT: Never mind, just had a chance to read you post in detail.

Hey, does the case close?
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; May 02, 2014 at 06:46 PM.
Reply With Quote
Old May 03, 2014, 01:13 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
This time I have room to spare. I can even add an extra arduino with an Adafruit waveshield for some audio like the $1000+ range transmitters

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old May 05, 2014, 06:59 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
a little code-update for the serial to nrf arduino. This code can also be used to test the connection and control the receiver arduino from any serial source that you can connect to the arduino. It has a debug option that can be turned on or off with comments (line 8). It's been tested and cleaned up. "s" resets the servo's to mid-positions, "p" resets all pins to zero. I use the GND and RX as a serial line from the Main mega, but it can also be used straight from any device that can connect to the arduino by serial. It's been optimised to be used with the arduino nano and uno. Default channel can be set (is now channel 94) for when no channel is set prior in the EPPROM. You can change the channel with code 29010 tot 29099 for channel 10 to 99, which will be saved in the EPPROM. The system will make a softreset and start again on your chosen channel. It also sends this channel command to the nrf. The receiving side will automatically change channel when using the receiver code I created. It will be posted soon.

More to come. Have fun

Danny

Code:
/*
1->gnd
2->VCC 3.3volt
3->pin8
4->pin9
5->pin13
6->pin11
7->pin12
8->not connected
*/

#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
#include <Wire.h>
#include <EEPROM.h>

#define DEBUG

// what channel are we on when NOT dynamic set.
int channel;
int channeldefault = 94;

// let's set some default mid-points for the servo's
int default1 = 128; int default2 = 128; int default3 = 128; int default4 = 128;
int default5 = 128; int default6 = 128; int default7 = 128; int default8 = 128;
int default9 = 128; int default10 = 128;


// lets set some midpoint for init function
int channelsend = 0;
int b;
int channelold;
char msg[140] = "";
int ButtonSend;
int channelchk = 0; 
int timer = 0;

// transmit buffering
//const int zendbuffer1 = 1;       // how sensitive are the navigationpots in relation to communication
//const int zendbuffer2 = 3;       // how sensitive are the other pots in relation to communication
const int transmitbuffer = 5;   // how many millisec. hold for next transmit

//int address = 1;
const int ResetState = 0;        // variable for reading the pushbutton status
const int timetoreset = 1000;     // how long delay after reset
int rotarychannel = 1;
int value;

char buffer[5]; 
// nRF24L01(+) radio attached to SPI and pins 8 & 9
RF24 radio(8,9);
RF24Network network(radio);
// Address of our node
const uint16_t this_node = 1;
// Address of the other node
const uint16_t other_node = 0;

// How often to send to the other unit
const unsigned long interval = 200; //ms
unsigned long last_sent;
long strlnum;

int servo1; int servoin1 = -10; int servo1inold = -1000;
int servo2; int servoin2 = -10; int servo2inold = -1000;
int servo3; int servoin3 = -10; int servo3inold = -1000;
int servo4; int servoin4 = -10; int servo4inold = -1000;
int servo5; int servoin5 = -10; int servo5inold = -1000;
int servo6; int servoin6 = -10; int servo6inold = -1000;
int servo7; int servoin7 = -10; int servo7inold = -1000;
int servo8; int servoin8 = -10; int servo8inold = -1000;
int servo9; int servoin9 = -10; int servo9inold = -1000;
int servo10; int servoin10 = -10; int servo10inold = -1000;


void setup(void)
{
  Serial.begin(115200); 
  Serial.flush();
#ifdef DEBUG
  Serial.println("Welcome to the Wireless SerialControl.");
  Serial.println("Servo 01: 11000 -> 11255        Pingroep 1: 21000 -> 21254");
  Serial.println("Servo 02: 11500 -> 11755        Pingroep 2: 21500 -> 21754");      
  Serial.println("Servo 03: 12000 -> 12255        Pingroep 3: 22000 -> 22254");
  Serial.println("Servo 04: 12500 -> 12755        Pingroep 4: 22500 -> 22754");
  Serial.println("Servo 05: 13000 -> 13255");
  Serial.println("Servo 06: 13500 -> 13755        Channelset: 29010 -> 29099");
  Serial.println("Servo 07: 14000 -> 14255");
  Serial.println("Servo 08: 14500 -> 14755");
  Serial.println("Servo 09: 15000 -> 15255");
  Serial.println("Servo 10: 15500 -> 15755");
  Serial.println("Type s for setting servo to mid-points.");
  Serial.println("Type p for setting all digital pin LOW/off.");
  Serial.println("To calculate the pin values for the digital groeps:");
  Serial.println("Count with adding 128, 64, 32, 16, 8, 4, 2, 1 or 0 for each group");
  Serial.println("21000+128+0+32+0+8+0+0=168 -> leds 1+3+5 on.");
  Serial.println("The servogroup can hold values for 20 servo's");
  Serial.println("The switchgroup can hold values for 19 switch groups of 8 each");
  Serial.println("This system can be expanded to 9 groups. 29000->29200 is");  
  Serial.println("a dedicated group code for the channel change routine.");
#endif

default1 = default1 +11000;
default2 = default2 +11500;
default3 = default3 +12000;
default4 = default4 +12500;
default5 = default5 +13000;
default6 = default6 +13500;
default7 = default7 +14000;
default8 = default8 +14500;
default9 = default9 +15000;
default10 = default10 +15500;

value = EEPROM.read(0);
delay(100);
int count = value*4;
channel = count/4;
if (channel<=0 || channel >= 100){channel=channeldefault;}
  Serial.print("Channel number is: ");Serial.println(channel);
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ channel, /*node address*/ this_node); 
}

void(* resetFunc) (void) = 0; //declare reset function @ address 0

void loop(void){
  network.update(); 

  if (Serial.available() > 0) { 
    int index=0; 
    delay(10); // let the buffer fill up 
    int numChar = Serial.available(); 
    if (numChar>64) { 
      numChar=64; 
    } 
    while (numChar--) { 
      buffer[index++] = Serial.read(); 
    } 
    splitString(buffer); 
  } 
} 

void splitString(char* data) { 
#ifdef DEBUG
  Serial.print("Data entered: "); 
  Serial.println(data); 
#endif
  char* parameter; 
  parameter = strtok (data, " ,"); 
  while (parameter != NULL) { 
    setFUNCTION(parameter); 
    parameter = strtok (NULL, " ,"); 
  } 
  // Clear the text and serial buffers 
  for (int x=0; x<6; x++) { 
    buffer[x]='\0'; 
  } 
  Serial.flush(); 
}

void setFUNCTION(char* data) { 
  char buf[12];
  RF24NetworkHeader header(/*to node*/ other_node);
   if (data[0] == 's') { // funtionele groep
        char* xs1 = (itoa(default1,buf,10));
        const char* sendready1 = (xs1);
        network.write(header,sendready1,strlen(sendready1)); 
        char* xs2 = (itoa(default2,buf,10));
        const char* sendready2 = (xs2);
        network.write(header,sendready2,strlen(sendready2)); 
        char* xs3 = (itoa(default3,buf,10));
        const char* sendready3 = (xs3);
        network.write(header,sendready3,strlen(sendready3)); 
        char* xs4 = (itoa(default4,buf,10));
        const char* sendready4 = (xs4);
        network.write(header,sendready4,strlen(sendready4)); 
        char* xs5 = (itoa(default5,buf,10));
        const char* sendready5 = (xs5);
        network.write(header,sendready5,strlen(sendready5)); 
        char* xs6 = (itoa(default6,buf,10));
        const char* sendready6 = (xs6);
        network.write(header,sendready6,strlen(sendready6));
        char* xs7 = (itoa(default7,buf,10));
        const char* sendready7 = (xs7);
        network.write(header,sendready7,strlen(sendready7)); 
        char* xs8 = (itoa(default8,buf,10));
        const char* sendready8 = (xs8);
        network.write(header,sendready8,strlen(sendready8));  
        char* xs9 = (itoa(default9,buf,10));
        const char* sendready9 = (xs9);
        network.write(header,sendready9,strlen(sendready9)); 
        char* xs10 = (itoa(default10,buf,10));
        const char* sendready10 = (xs10);
        network.write(header,sendready10,strlen(sendready10)); 
   }    
 
   if (data[0] == 'p') { // lets put all pins to OFF
        char* xs99 = (itoa(21000,buf,10));
        const char* sendready99 = (xs99);
        network.write(header,sendready99,strlen(sendready99));
        char* xs98 = (itoa(21500,buf,10));
        const char* sendready98 = (xs98);
        network.write(header,sendready98,strlen(sendready98));
        char* xs97 = (itoa(22000,buf,10));
        const char* sendready97 = (xs97);
        network.write(header,sendready97,strlen(sendready97)); 
        char* xs96 = (itoa(22500,buf,10));
        const char* sendready96 = (xs96);
        network.write(header,sendready96,strlen(sendready96));
        char* xs95 = (itoa(23000,buf,10));
        const char* sendready95 = (xs95);
        network.write(header,sendready95,strlen(sendready95));
        char* xs94 = (itoa(23500,buf,10));
        const char* sendready94 = (xs94);
        network.write(header,sendready94,strlen(sendready94));
   }
   if (data[0] == '2') { // funtionele groep 
    int ButtonSend = strtol(data+1, NULL, 10);  
    ButtonSend=ButtonSend+20000;
    char* xssend = (itoa(ButtonSend,buf,10));
    RF24NetworkHeader header(/*to node*/ other_node);
    const char* ButtonSendCode = (xssend);
    network.write(header,ButtonSendCode,strlen(ButtonSendCode)); 
    delay (transmitbuffer);
      #ifdef DEBUG
        Serial.print("Sending buttoncode: "); 
        Serial.println(xssend);
    #endif
      if (ButtonSend >= 29000 && ButtonSend <= 29200){
      int channelselect = ButtonSend - 29000;
      if (channelselect >=0){
        Serial.print("channel will be: ");Serial.println(channelselect);
        EEPROM.write(0, channelselect);
        delay(timetoreset);
        resetFunc();  //call reset 
      }
    }
   }
    if (data[0] == '1') { // funtionele groep 
      int ButtonSend = strtol(data+1, NULL, 10);  
      ButtonSend=ButtonSend+10000;
      char* xssend = (itoa(ButtonSend,buf,10));
      RF24NetworkHeader header(/*to node*/ other_node);
      const char* ButtonSendCode = (xssend);
      network.write(header,ButtonSendCode,strlen(ButtonSendCode)); 
      delay (transmitbuffer);
      #ifdef DEBUG
        Serial.print("Sending servocode: "); 
        Serial.println(xssend);
      #endif
    }
             
}
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old May 06, 2014, 08:10 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
The schematic for the transmitter side. I hope it's a bit clear how it all goes together. Done it in Fritzing and exported it to PDF.

Danny

EDIT: a switch in the TX->RX would be usefull for programming, that way you don't get any sync errors when uploading.
Dutchraptor is online now Find More Posts by Dutchraptor
Last edited by Dutchraptor; May 06, 2014 at 08:18 PM.
Reply With Quote
Old May 10, 2014, 12:01 PM
Registered User
michel pet's Avatar
nl
Joined Jan 2005
221 Posts
this good be a nice servo bordt i think.

http://www.mhobbies.com/spider-contr...t-project.html

sorry this wil not work at al.
michel pet is offline Find More Posts by michel pet
Last edited by michel pet; May 11, 2014 at 03:49 PM.
Reply With Quote
Old May 11, 2014, 03:55 PM
Registered User
michel pet's Avatar
nl
Joined Jan 2005
221 Posts
i am going to use this 2560 as rx set it makes it a lot smaller i need to make a second pcb for the servo pins and the leds 5 volt and 3,3 volt and the transmitter set.

51x51x??mm

michel pet is offline Find More Posts by michel pet
Reply With Quote
Old Jun 24, 2014, 09:47 AM
Registered User
Joined Jun 2013
362 Posts
hi Danny

how far range that you get with nrf24l01 in this thread ?
John michel is offline Find More Posts by John michel
Reply With Quote
Old Jun 24, 2014, 09:49 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
286 Posts
More then I can see the boat. About 750 to 1000 metre at least.
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Jun 24, 2014, 10:04 AM
Registered User
Joined Jun 2013
362 Posts
woa, impress . If it on sky , i think it will far and far more

if i use nrf24l01 no PA + LA for receiver , maybe it shorter ? i see you use two modul PA +la for transmiter and receiver
John michel is offline Find More Posts by John michel
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
New Product Open Source Lights - Arduino based RC Light Controller LukeZ DIY Electronics 42 Jun 30, 2014 09:10 PM
Discussion Arduino Uno Based Flight Controller? alexgator Multirotor Electronics 4 Feb 15, 2013 12:49 AM
Discussion I want to auto controlled RC helicopter with arduino+wmp+nunchuk parkjungho Electric Heli Talk 3 Jun 21, 2011 02:58 PM
Discussion Arduino project to build autopilot controlled RC plane! Ecibob Electric Plane Talk 2 Apr 25, 2011 10:17 AM