I
Like boats I like Arduinos, so let's build an RC boat using an Arduino
This project must be wireless must have rudder control main and jib sheet control and completely home build otherwise. What's the point?
Part one of the series will be [how] to build the electronics for a remote control sailboat
But this could be used for a car airplane just about anything
Parts need for the receiver are an Arduino sorrows breadboard of course an antenna and a breakout board some wire and a couple of servos
Transmitter same thing except instead of servos
I'm gonna use a pot and a couple switches to control my rudder and sheet
Wiring an rF 24 module to an Arduino is fairly straightforward
It's using the Spi bus and there are plenty of pin outs on the web
I found this one that helped me connect to things like Mosy. Miso and a few other terminals notice
[I'm] using the rf 24 breakout board that allows me to use a [9-volt] battery if you don't have this breakout board
You can't wire your transceiver directly to 5 volts VCC you'll burn it right out you must connect it to 3.3 volts
Y ring the receiver is pretty easy
Almost using a couple of servos standard Sg. 94 my rudder and a continuous servo for my raising and lowering the sail
Red to positive Brown to negative and orange goes to one of your digital outputs
Transmitter wiring is a little bit easier same basic process using the Spi bus
So I can control my rudder. I'm going to hook a pot across
3.3 volts ground and the input will go right into my a [0]
to raise and lower the sail I'm going to put a couple of push-button switches on and
Simply read a [High-low] value and do a little bit of code logic to figure out if I [should] raise or lower the sail
This is a fairly straightforward wiring process for the Arduino
Let's take a look at the transmitter Code first in
The source code that I provided I've included all [the] pin out information in the common [blog]
I've also provided some [links] to the libraries and nice help page on getting started with the f prf 24
I found it very helpful to create a [structured] [h] file that contains a data structure so I can pass data to and from my
Transmitter or receiver very easily
I simply include that h file in both of my
Transmitter and receiver sketches that way I have access to the same exact Data structure
Here are the adjustable pins for your rF 24 modules?
Now I can create a data structure. That's common to both my receiver and transmitter sketches if
You're not using the breakout board you're trying to power your antenna right off your Arduino
You're probably not going to be able to put your power on high lower [Minimas]. Probably all you're going to be able to do
Since I'm powering mine from an external 9-volt battery using that breakout board I can power all the way up to maximum five one two
to control the [rudder] position
I'll simply map the output of the pot to the actual servo a one 110 degree is sweep
So that means 55 degrees on either side of 90. That's where my
mapping of 35 to 145 degrees comes from
the reason I'm using the
3.3 [volt] and up 5 volt is that pin was just easier for me [to] solder to on my production board?
I'll use two push buttons [to] trim the sail in or out
And some simple logic to detect when those buttons are pushed
Take a quick look at my if statements if one button is pressed the sail will go up or down
If no buttons are pressed will stop the continuous servo motor
With these constant rotation motors 0 or 180 will turn the motor full Clockwise or counter Clockwise
Any other value will simply set the speed of the motor. I'm slowing mine down
So the strings don't jam [up] when I'm letting my sails out now that my data structure is populated
I simply call the radio write function
The receiver code is even easier, but before we get to that
Let's take a look at this structure to see how I'm passing data from the transmitter to the receiver
[I] think it's a lot easier to create a data structure and pass data using it as opposed to letting a parsed string
I've created a structure and store that in a dot h file that way I can include that in both my sketches
For V10 of my RC controller my data structure is pretty simple have an unsigned long for the current time which I'm not even using
I've got a byte value to store the rudder position and another byte value to store whether the sail should come in or come out
I'll simply include that in both my sketches. I have access to the same data
Keep in mind this file has to go in your library folder of the Arduino folder and make sure all Arduino sketches are closed before
You create this file
Now let's finish up the receiver code using the same address ensures the receiver can talk to the transmitter
Again, here's how I initialize my data structure using that RC packet that we just saw
Because I have two servos. I'm going to create an object for each of them giving them a unique name
Then my setup. I simply attach that to a dedicated pin
I'll set my power to high but I may change it to max depending on the actual range this intent is good for a thousand
meters you will see
I'll read the data from the radio and simply write the data rud to my rudder servo
And a data sail to my sail servo
Here's a quick example of the prototype in action
Notice the servo spinning around to raise and lower the sail, and I still have control [over] the rudder
pretty cool
Next time I'll show you how to create a custom enclosure of your Arduino project using some 3D cad modeling and some 3D printing
Well, that's it. Thanks for watching don't forget to comment
you
