|||
Current Website Support
75
Contributors
6
Subscribers
You are Not Registered
Donate for your silver medal πŸ…
Β£10
Β£15
Β£25
Β£50
Subscribe for your gold medal πŸ…
Β£1
Β£3
Β£5
Β£10
You Will Be Helping Towards:

  • Domain Fees
  • Security Certificates
  • iOS & Android App Fees
  • Website Hosting
  • Fast Servers
  • Data Backups
  • Upkeep & Maintenance
  • Administration Costs

    Without your support the website wouldn't be what it is today.

    Please consider donating towards these fees to help keep us afloat.

    Read more

    All donations are securely managed through PayPal. Amounts donated are not published online.

    Many thanks for your kind support
  • Join Us On Social Media!
    Model Boats Website
    Model Boats Website
    Home
    Forum
    Build Blogs
    Media Gallery
    Boat Clubs & Lakes
    Events
    Boat Harbour
    How-To Articles
    Plans & Docs
    Useful Links
    6

















    Followers
    Arduino Transmitter link up
    by Elsrickle πŸ‡¬πŸ‡§ ( Warrant Officer)
    πŸ“£










    Click To
    Follow
    19 Posts 18 Replies 1 Photo 28 Likes
    ( Newest Posts Shown First )
    timgarrod
    Master Seaman
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 3 days ago
    😊 View Profile
    πŸ’¬ Send PM
    He All, this is a Fourm me and a couple of other people setup to help with Arduino for RC boats/Subs mentioned above. pulse in works ok for one or two channels but interrupts work better

    http://rcarduino.freeforums.net/
    http://rcarduino.freeforums.net/
    πŸ”—
    1
    http://alvastonpiratesmodelboatclub.co.uk/
    Elsrickle
    Warrant Officer
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 4 days ago
    😊 View Profile
    πŸ’¬ Send PM
    Hi G6SWJ thanks this is getting more complicated for me but am going to give the circuits a try will take me some time to fully understand it all but it’s a great challenge. Have been reading a lot on the arduino site you told me about a lot of help there as well.
    Elsrickle
    1
    RNinMunich
    Fleet Admiral
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡©πŸ‡ͺ Germany
    Online: 5 hours ago
    😊 View Profile
    πŸ’¬ Send PM
    Go for it R. Admiral M ASAPπŸ‘
    Here is your official Round To It😊
    Let us know how you get on 🀞
    Cheers, Fl. Admiral Doug 😁
    😎
    2
    Young at heart - slightly older in other places πŸ˜‰ Cheers Doug
    Elsrickle
    Warrant Officer
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 4 days ago
    😊 View Profile
    πŸ’¬ Send PM
    Hi Stephen thanks your are right on the track I am trying to get too. Will give this a try. I will only be trying it as test at the moment and will work on one led only. As I am totally new to this field I have a lot to learn have only managed to get the default light working so far. But will get onto your circuit first chance I have.
    Ian
    1
    Martin555
    Vice Admiral
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 8 hours ago
    😊 View Profile
    πŸ’¬ Send PM
    Hi G6SWJ.
    Thank you, I will have a go at that as soon as i get a little more time.
    Thank's again.

    Martin555.
    If it looks right it probably is.
    G6SWJ
    Petty Officer 1st Class
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 6 hours ago
    😊 View Profile
    πŸ’¬ Send PM
    Example pulseIn() code to read RC RX pin (tested-working)

    /* This is example code for an RC switch */

    unsigned long ch1;

    /* run setup code once*/
    void setup() {
    pinMode(4, INPUT); // Set our input pins as such
    pinMode(3, OUTPUT);
    Serial.begin(115200);
    }

    /* loop code*/
    void loop() {
    ch1 = pulseIn(4, HIGH, 22500); // Read the pulse width of the channel - timeout after X milliseconds if no change to pin

    if (ch1 > 0) {

    if (ch1 > 1700) { //assigned to a 2 position switch
    digitalWrite (3, HIGH); // turn on
    if (ch1 < 1300) {
    digitalWrite (3, LOW); // turn off
    }
    }
    Serial.println(ch1); // print value read to serial monitor
    }
    }

    Note: Pin 13 on many Arduino boards is connected to the onboard LED - This is great as a fast way to test code. Be aware that as the Arduino boots it normally flashes the led on pin 13 - so if you connect your switch circuit to pin 13 it will also switch on/off on board startup
    3
    G6SWJ
    Petty Officer 1st Class
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 6 hours ago
    😊 View Profile
    πŸ’¬ Send PM
    Never tried using analogRead for PWM - does it work?

    I know you have typed this code from memory which from my experience always leads to silly errors - couple of observations - to stand a chance pin should be A1 not 1 but I think you would have more success with pulseIn() (mandatory use of timeout parameter as if no change in signal code it will waste time waiting for one to arrive!!!) - however I am not a fan of this command due to it's "code blocking" side effect - far better to use Interrupts

    Another pointer - repeated use of analog Read can lead to spurious readings - there is only one AD convertor - the analog pins are multiplexed to the single AD - the solution is to read any analog pin twice with a 5 millisecond delay between and only use the second read.

    The first read forces the multiplexer to look at your desired pin, the delay allows voltage sabilisation and the second read will be a good stable reading

    How do I know this - because I lost many brain cells and hours of my life before I found the solution!!

    Projects have a habit of evolving and getting more complex, using puslseIn() (with timeout parameter set) for reading a few RC receiver pins to control some switches works well, if you then progress to more complex projects you will eventually find that using pulseIn() comes back to haunt you (code blocking) - using interuppts is a sure fire way of sucess with complex projects

    See this link for a great tutorial and explanation - I have used a variant of Ryan's code for years

    https://ryanboland.com/blog/reading-rc-receiver-values/

    _._
    https://ryanboland.com/blog/reading-rc-receiver-values/
    πŸ”—
    3
    Martin555
    Vice Admiral
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 8 hours ago
    😊 View Profile
    πŸ’¬ Send PM
    Hi Stephen.
    Yes please, I would like to see more.
    It would be nice to switch lights on and off.
    At the moment i have the lights on my HMS Cottesmore switching in a loop, i would briefer to use the RX/TX to switch my lighting circuits on/off.

    Martin555.
    1
    If it looks right it probably is.
    Fireboat
    Midshipman
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 5 hours ago
    😊 View Profile
    πŸ’¬ Send PM
    It’s going to be something like:

    void setup() {
    pinMode(1,INPUT); // PWM signal
    pinMode(13,OUTPUT); // lights
    }
    void loop() {
    if (analogRead(1) > 512) { // PWM signal ranges between 0-1023
    digitalWrite(13,HIGH); // switch on lights
    } else {
    digitalWrite(13,LOW); // switch off lights
    }
    }

    The transmitter stick PWM range is probably closer to 250-750 but 512 will be somewhere in the middle. So anything higher and it’ll switch on pin 13.

    Check the max mA on the Arduino output pin before linking to LED’s. Sometimes it’s best to go via a NPN mosfet if powering higher amps. Although another cheat is to switch multiple outputs on at the same time which will get you a few more mA, just don’t melt the Arduino! 🀣 πŸ”₯

    Hope the above gives you a starting point. Just typed it out now! For something that latches and counts stick movements you’ll need to include variables. Let me know if you need an example for that too. I’m sure once you get into it, it’ll begin making more sense πŸ‘

    Stephen
    3
    🚀
    G6SWJ
    Petty Officer 1st Class
    πŸ“ Arduino Transmitter link up
    Flag
    Country: πŸ‡¬πŸ‡§ United Kingdom
    Online: 6 hours ago
    😊 View Profile
    πŸ’¬ Send PM
    Hi Doug,

    The K in morse code is an abbreviation for "over" or "Invitation to transmit " or variations of that ilke.

    If your local you call the town Ket ring - if not you would pronouce it as Ketter ring - easy to spot a local!!!

    Hopefully we can pique others interest in Arduino, a very rewarding aspect to the hobby and it certainly exercises the brain cells. As many will know but if they don't Arduino is designed to be "accessible", whilst the first few hurdles might seem like vertical brick walls they are worth knocking down as once some of the concepts are mastered you can create some amazing projects.

    It's a shame many will not scratch the Arduino surface and see what's invloved - we don't think twice about sending a text message on our phone - but if you put a phone in front a someone who had never done this before they would not have a clue of what to do, and it would seem a complex and all but impossible task!!!

    _._ de G6SWJ
    2
    Show 9 More Posts



    About This Website
    Terms of Service
    Privacy Policy
    Cookies used in this website are gluten free, wheat free and dairy free. By using this website you agree to our use of cookies. More Info