Model Boat Mayhem

Please login or register.

Login with username, password and session length.
Pages: [1] 2 3 4 5 6 7   Go Down

Author Topic: ARDUINO any one?  (Read 61229 times)

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
ARDUINO any one?
« on: December 15, 2015, 11:01:43 am »

Hello,

I am interested to explore the uses and applications of an Arduino microprocessor board in the world of radio control model boating.  So if you have used one it would be great if you could share a short summary of what you accomplished.

If you have not come across an Arduino before it is a simple and cheap way to access microprocessor controlled applications. The Arduino can read the "PWM" signals from your radio control receiver, apply some logic to them (e.g. if this then do that) and then communicate the result of the logic with the outside world in the form of a digital or analogue signal as a result. A few things you can  control LEDS (off, on/brightness), servos, relays

The program ("Sketch") code is very easy to learn and you can achieve solutions often with just a few lines of code. There are thousands of hobbyists using the Arduino and many help forums on the internet so you can always get help when you get stuck. You can download lots of sketch’s from the internet and the software used to load the sketch to the board via USB comes with lots of examples.

Here is a snapshot of some code to make an LED blink connected directly to the board -  Turns on an LED on for one second, then off for one second, repeatedly

Quote
void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

An example of a simple application would be: Controlling an LED on/off using a 2 state(on/off) channel on your radio (Gear etc)

If you want to know more then check out these links or just Google Arduino

What is an Arduino - https://www.arduino.cc/en/Guide/Introduction

Tutorial series - https://www.youtube.com/watch?v=09zfRaLEasY

There are other routes to accessing microprocessors e.g. Pic/Raspberry PI but here I would like to focus just on the Arduino.

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

richald

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,941
  • Retired and loving it!
  • Location: Driffield, East Yorks.
Re: ARDUINO any one?
« Reply #1 on: December 15, 2015, 11:15:53 am »

C-3PO 

I have a lot of arduino bits, boards and sensors  - I've played around with various bits of code.
I like the Arduino - as a retired software engineer who used to code in C   - the programming is
generally very easy and the boards are cheap!

With regard to uses - when I have cleared a bit of the backlog of boat building, the first idea
I want to explore is using an ultrasonic distance sensor to measure 'clear air' in front of the boat
and if a collision is imminent modify the signal between the radio receiver and the ESC to slow
and if necessary stop the boat - - I have some working code but the setup for testing needed
a bit of thought and I wasn't 100% happy with the way the signal from the receiver was being read.

Richard
 
Logged
Senior member of the OGG (Order of the Grumpy Gits)
Membership Number : 002

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #2 on: December 15, 2015, 11:27:23 am »

Thanks Richard,

This is the underlying concept of what Richard is talking about (connected to the ESC to allow throttle control)

https://www.youtube.com/watch?v=cZPEhGXL13I

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

dreadnought72

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,892
  • Wood butcher with ten thumbs
  • Location: Airdrie, Scotland
Re: ARDUINO any one?
« Reply #3 on: December 15, 2015, 12:30:41 pm »

I'm a big fan of the Arduino - I'm currently testing a variety of circuits using stepper motors and rate/heading solid-state gyros controlled by WPM signals from a receiver. More on this later.


What I may well have to write up is my thoughts on Arduino-driven mixers, since there's a lot of questions about mixing channels on the forum and the Arduino is a cheap, easy-entry system into the world of achieving Exactly What You Need.


Andy
Logged
Enjoying every minute sailing W9465 Mertensia

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #4 on: December 15, 2015, 01:17:23 pm »

Andy - sounds very interesting.

You mentioned
Quote
Arduino is a cheap, easy-entry system into the world of achieving Exactly What You Need.

For those that don't know there are several different models of Arduino - a good place to start is the Arduino Uno - it's roughly the size of a credit card.

The Arduino Uno genuine version is about £18, the cloned version less than £5 delivered (eBay) (you need to be careful which clone as some have challenges with the USB chip and can be a real pain) - Similar concept to original manufacturer RX or Orange RX.

Software (IDE) Integrated Development Environment - Free download.

I have used the Arduino clones many times without any issues so you could be experimenting with an Arduino for less than a £5 investment!

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #5 on: December 15, 2015, 02:49:59 pm »

Want to make a servo sweep from side to side. Servo needs to be powered by an external power source (battery)

2 electrical connections to Arduino -
  • Arduino "GND" ground - Battery/servo negative
  • Arduino Pin 9  - to servo signal line

Sketch code below (text after "//" double lines is text notation to help understand the code and is not executed as part of the sketch(program)
Quote
#include <Servo.h>

Servo myservo;  // create servo object to control a servo

int pos = 0;    // variable to store the servo position

void setup() {
   myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop() {
   for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees in steps of 1 degree
     myservo.write(pos);          // tell servo to go to position in variable 'pos'
     delay(15);                       // waits 15ms for the servo to reach the position
   }
   for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
     myservo.write(pos);              // tell servo to go to position in variable 'pos'
     delay(15);                       // waits 15ms for the servo to reach the position
   }
}
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,148
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #6 on: December 15, 2015, 06:34:37 pm »

Interesting,


You can even have a play for free without having to buy an arduino
https://123d.circuits.io/lab
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

richald

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,941
  • Retired and loving it!
  • Location: Driffield, East Yorks.
Re: ARDUINO any one?
« Reply #7 on: December 15, 2015, 06:39:37 pm »

Something else I have just found - online Arduino compile/downlad/test

https://codebender.cc/

https://codebender.cc/libraries

can't comment beyond that from my brief inspection, seems fairly competent.

Richard
Logged
Senior member of the OGG (Order of the Grumpy Gits)
Membership Number : 002

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,148
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #8 on: December 15, 2015, 06:42:46 pm »

Just played on the link I posted in my last post and it did exactly what it should do


I'm ordering one.....
Merry xmas to me :)
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #9 on: December 15, 2015, 07:50:52 pm »

essex2visuvesi - Simulator love it!
Quote
https://123d.circuits.io/lab

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

ballastanksian

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,447
  • Model Boat Mayhem inspires me!
  • Location: Crewkerne
Re: ARDUINO any one?
« Reply #10 on: December 15, 2015, 08:43:04 pm »

I like the concept and will one day give it a go but I have to fully get my wooden head around my battery charger and straight prop shafts first:O)

Logged
Pond weed is your enemy

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,148
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #11 on: December 15, 2015, 10:40:45 pm »

essex2visuvesi - Simulator love it!
C-3PO


Took me less than 5 mins to put together a simulation of your code... and it worked


Just ordered this set as a Christmas pressie to me
http://www.banggood.com/UNO-R3-Starter-Kit-LCD1602-Servo-Buzzer-For-Arduino-p-1008835.html
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

dreadnought72

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,892
  • Wood butcher with ten thumbs
  • Location: Airdrie, Scotland
Re: ARDUINO any one?
« Reply #12 on: December 16, 2015, 12:37:11 am »

The very basics: the Arduinos (and other microprocessors) are nothing but small, cheap, miniature computers. They have a clock, memory and processor. Using code, they can repeatedly, endlessly and faultlessly, read inputs and effect outputs.


Inputs for us are going to be transmitter signals and any type of on-board sensor. Light? Ultrasonic? GPS? Gyro? It doesn't matter - all manner of sensors are available, and they are all remarkably cheap and available. Outputs will tend to be lights, audio and - most usefully - commands that can control servos and ESCs.



Code is not difficult: you can think of it as nothing more than instructions, like a recipe, a knitting pattern or a part of a Haynes Manual. 'Do this if that', 'If done, now do the other'. Programs written in code (typically written on a PC) can be downloaded to the Arduino, tested, stored and initiated when the Arduino is powered up. Code has to be written in a specific manner to be actioned properly in order to avoid misinterpretation. Follow the rules governing the syntax (a posh word for the components of the language of the code) and you won't go far wrong.


So how do you start?


The best approach is to simply sketch a plan for what you want to achieve.


I'll be kicking off a 'how to write a mixer' thread over the next couple of days. Plenty of diagrams and examples will follow.


Using microprocessors is not rocket science (and neither is, it has to be said, rocket science!) and we should be open to embracing the opportunities this new technology is opening for us.


Andy

Logged
Enjoying every minute sailing W9465 Mertensia

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #13 on: December 16, 2015, 07:35:29 am »

Andy,

Great descriptions.. I look forward to your Arduino Mixer accomplishments.

For those that are interested in this area of the hobby it would be great to adopt a supportive approach to sketch code. Normally with code there are many ways to achieve the same thing and as we all comes from different backgrounds with different levels of understanding, collectively we are brilliant!.  So I for one look forward to broadening my understanding in this area from both code and applications of microprocessors in our hobby.

So how does this all apply to the model boating fraternity?

Most of us have multi channel radio control sets and only use 2 channels, so wouldn't it be neat to add some additional functions to your model on those extra channels?

Why do I like Arduino's - it's the mental challenge of working at a solution for something I want to achieve - it keeps my grey matter on it's toes - some of my Arduino projects are still on going after 4 years so be patient don't expect instant results.

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #14 on: December 16, 2015, 08:03:05 am »

What type of board NOT TO BUY from eBay

There are lots of cloned Arduino boards on eBay. I am not an expert but this is my understanding (please anyone correct me if I have this wrong). I would recommend buying a real Arduino board first time out - many suppliers on the internet:

https://proto-pic.co.uk/genuino-uno-rev-3
http://www.amazon.co.uk/Arduino-A000066-ATMEGA328-Microcontroller-Board/dp/B008GRTSV6/ref=sr_1_3?ie=UTF8&qid=1450252867&sr=8-3&keywords=arduino+uno
http://www.mouser.co.uk/ProductDetail/Arduinoorg/A000066/?qs=sGAEpiMZZMtE4ePzUE8d2JuFIVM5Ac0l
https://www.coolcomponents.co.uk/arduino-uno-revision-3.html

Some cloned boards have a weird communication chip which means you have to obtain a USB PC driver from a Chinese site(not a word of English!) - something I do not recommend.

My experience is that the boards with a small chip should be avoided -see images below.
C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

Brian60

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 3,315
  • Location: Hull,UK-but currently residing in Los Martinez, Spain.
Re: ARDUINO any one?
« Reply #15 on: December 16, 2015, 06:51:32 pm »

Oooh this topic is so Deja Vu all over again {-) (you have to have seen the movie)

I raised this exact topic just a year ago....

http://www.modelboatmayhem.co.uk/forum/index.php/topic,49659.msg513084.html#msg513084


And before anyone asks, no I haven't done anything further yet, I have been doing so much other stuff I've not had time to spend with it. I can't believe where time goes to even though I no longer work!

I now have 3 pieces of electronic board to get to grips with, arduino, picaxe and the latest addition a DLM.

What's one of those I hear you all ask --- well go on then, ask! All will be revealed hopefully over the weekend when it is connected and I can photo/video the setup/

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #16 on: December 16, 2015, 07:30:44 pm »

DLM - what's one of those? :)

Sounds like it's a mate of my mate R2D2?

C-3P0

Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

ballastanksian

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,447
  • Model Boat Mayhem inspires me!
  • Location: Crewkerne
Re: ARDUINO any one?
« Reply #17 on: December 16, 2015, 10:57:19 pm »

I recall that a fellow Mayhemer was going to build a transmitter using Aduino components some time back; Possibly any one of you chaps who are describing the workings of the system to us. I have seen the range of parts and accesories available in Maplins and cannot see a radio transmitter compnenent. They do a cute little joystick.

Logged
Pond weed is your enemy

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #18 on: December 16, 2015, 11:27:03 pm »

Hi ballastanksian,


There are several routes you could go down to create an Arduino radio control transmitter. Is this something you would like to achieve?
I am in the final testing of a "proof of concept" one channel radio control system that has unlimited( well almost) "channels of control" that is it has no limitations like the traditional radio control systems we use.


C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: ARDUINO any one?
« Reply #19 on: December 19, 2015, 10:11:07 am »

The list of model boat Arduino applications I have so far

  • LED switching
  • LED Flashing
  • LED Dimming
  • RC Mixer
  • Arduino based full RC system
  • Ultrasonic - collision avoidance
  • Stepper motor control
  • Servo - movement sequence of 1 or more servos e.g gun turret, gun recoil, Missile tracker - control of 2 servos working together
  • Anchor chain movement via servo or stepper motor
  • RC switch - e.g. using gear channel on radio
  • Engine sounds
  • GPS - data can be read by Arduino - not sure what you would do with it without a complex program
  • Light sensor
  • Gyros ?
  • Ballast auto leveller - automatically correct boat listing
  • Temperature sensor - auto shutdown/alarm(?)
  • Voltage sensor - auto shutdown/alarm(?)
  • Bilge pump - automatic sensor triggered

These are just a few ideas that have been suggested. Some of these would need readily available, mostly very cheap additional hardware.

All suggestions welcome - I will add them to the list - those additional channels on your radio want to be used!

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

essex2visuvesi

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,148
  • Location: Finland, England, Finland!
Re: ARDUINO any one?
« Reply #20 on: December 19, 2015, 03:35:28 pm »


  • Stepper motor control
  • Servo - movement sequence of 1 or more servos e.g gun turret, gun recoil, Missile tracker - control of 2 servos working together


This is the main reason for getting mine
Logged
One By One The Penguins Steal My Sanity
Proud member of the OAM  (Order of the Armchair Modeller)
Junior member of the OGG  (Order of the Grumpy Git)

Brian60

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 3,315
  • Location: Hull,UK-but currently residing in Los Martinez, Spain.
Re: ARDUINO any one?
« Reply #21 on: December 19, 2015, 04:50:08 pm »

Multiple proportional control? ie most tx's have 2 joysticks, what about a facility for 4? I understand that some drone copters use 4 joysticks albeit they seem to be being replaced by tilt/tip/yaw controls via holding one of the many tablet style computers.

Failing joystick what about say 4 or more potentiometer type controls so you could set a turret or some other option, to some point via stepper motor and leave it there, until the pot is moved again?

ballastanksian

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,447
  • Model Boat Mayhem inspires me!
  • Location: Crewkerne
Re: ARDUINO any one?
« Reply #22 on: December 19, 2015, 06:51:14 pm »

Hi C3PO, I have considerd the idea especially to recreate the controls of a real ship, ie engine telegraph and a steering wheel along with some switches for turrets, but I must coincentrate first on work, and then on getting my Destroyer and three tugs sailing before I can begin my big project that would appreciate rotating turrets.

Nothing I plan to sail will ever sit on its stern and throw up an impressive wave, so it does not need millisecond perfect control :-)
Logged
Pond weed is your enemy

Netleyned

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 9,051
  • Location: Meridian Line, Mouth of the Humber
    • cleethorpes mba
Re: ARDUINO any one?
« Reply #23 on: December 19, 2015, 06:59:40 pm »



Nothing I plan to sail will ever sit on its stern and throw up an impressive wave, so it does not need millisecond perfect control :-)


Not building a Springer then %)


Ned
Logged
Smooth seas never made skilful sailors
Up Spirits  Stand fast the Holy Ghost.
http://www.cleethorpesmba.co.uk/

ballastanksian

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,447
  • Model Boat Mayhem inspires me!
  • Location: Crewkerne
Re: ARDUINO any one?
« Reply #24 on: December 19, 2015, 07:01:54 pm »

Cheeky! One day I will, just not at the moment :-)
Logged
Pond weed is your enemy
Pages: [1] 2 3 4 5 6 7   Go Up
 

Page created in 0.093 seconds with 22 queries.