Follow

Bill's Arduino flower class corvette

Started by billmcl61

11 updates 18 likes
billmcl61
Opening post · 6 years ago

Bill's Arduino flower class corvette

Hi Everyone,

Been away for a while but I haven't been idle.
My latest passion is playing with Arduino, I'm still at the very early stages and modifying existing sketches, but the feeling of triumph after biting off to much to chew, that getting something to work gives you is exhilerating (I know that's a spelling mistake but I'can live with that 😊).
I'm taking the flower class corvette off of the top of the fridge and doing something with it. I.E. controlling the RC with a 433MHz comms module. So my build starts here with an update of where I am just now.
The boat - hull is put together and.... well Rome wasn't built in a day, plus I needed thinking time - several years worth 😊
Arduino - Slightly further ahead, I've got the steering part done, I've just to do a bit of re-scaling there to completely finish that part off - I just discovered a trim wheel on the joysticks ... ah read the attached it's all in there 😊
I've tried attaching the document as a pdf file hopefully it's worked
Liked by MouldBuilder and Martin555 and
7 comments
  1. billmcl61
    Warrant Officer
    Oh yeah, 9V battery clips from Germany???. As it happens they are not so easy to find here, I'm sure most towns have a radio shack type store but I haven't found one here. So I just added it to an order of other stuff.

    Bill
  2. billmcl61
    Warrant Officer
    Just looking at your message again Doug, the Radiohead library seems to be the goto place for arduino comms, the link for the download is on the first of the 433MHz weblinks I posted (I think it's the first 😊)

    Bill

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Bill's Arduino flower class corvette

And here is the Fritzing connection details
Liked by Martin555

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Part 1B speed and steering from a single controller

Hi everyone this is the second part of part 1...if that makes sense...a part 1b if you will😊
Although I haven't had a chance to test this part yet the sketch compiles so that's good enough for me 🤞, I revised and brought up to date the frizling drawing and Arduino Sketch, so I'll attach them here. This second part deals with motor control, so hopefully some useful bits for you

Enjoy

Bill
Liked by Martin555

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Some research details on 433MHz comms

I'll try to include some links to 433MHz comms that should be useful for the next stage
Liked by Martin555
3 comments
  1. billmcl61
    Warrant Officer
    And another one, I'll print these 3 documents out and get a clearer picture from there of how this all works.
    As for the legality of this I've tried researching the subject for here in Ireland, but govt depts all over the world seem to pride themselves in making what should be a simple task into an ordeal...I wonder if I should just adopt the Irish approach of "Ah sure, it'll be grand" ... maybe I'm just overthinking this 🙄 😉🤓🙈🙉🙊

    Take care

    Bill
    Liked by Martin555
  2. billmcl61
    Warrant Officer
    Ah, this video answers a lot of my questions. I'm ok with setting up the initial comms settings, libraries etc, but I wasn't sure how to send more than one piece of information between the 2 arduinos i.e the 2 joystick positions.
    All the other example videos I found use a text message to illustrate the concept, but this chap uses a temperature and humidity sensor (2 inputs transmit end, 2 outputs receive end 😁😁😁) which I can modify to suit. Ah at last, I can now hook up 2 arduinos on the bench and test simple comms using the 433MHz units.
    I'll be changing the 433MHz units to RFM69HCW units as these are bi-directional transceivers and you can change the operating frequency to a legal frequency band, but the 433 units will do just now for basic testing and the code will need minimal adjustment for the RFM units
    Mmm just realised that this is the same video as the post above...I don't think I watched it all before😝that'll teach me

    Bill

Sign in to comment on this update.

billmcl61
Update · 6 years ago
Liked by Ianh and G6SWJ and
18 comments
  1. billmcl61
    Warrant Officer
    Hi Jonathan,

    Just been through the datasheet, thank goodness I don't need to know all of that, quite a read 😊 and I found the "HM-TRP Setting GUI" on the Hoperf website, so that I can now put in the basic settings.
    It's quite amazing the difference between the RFM69HCW and the cheap 433MHz modules, not just in documentation but also functionality (transceivers rather than just one way comms), just ordered 2 of them to try out. Now I'll have to find something to send back from the boat, mmm battery level perhaps.
    Thanks again for the info.

    Bill
  2. billmcl61
    Warrant Officer
    Ah that's interesting Jonathan, a nice easy way to check data transfer.

    Bill

Sign in to comment on this update.

billmcl61
Update · 6 years ago

433MHz comms

Hi,

The communications between the Arduino Nano in the Boat and the Arduino Nano in the RC hand set will be carried out by a 433MHz transmitter and receiver set. To interface the Arduino's and the 433MHz set we need to install the Radiohead library, within the Radiohead library is the RFASK.h function which will be called by the line "#include< RFASK.h > " at the start of the sketch in both Nano's. The ASK (amplitude shift keying) function will, after being configured with a few simple commands, read and write our code between the 2 arduino's. Sounds simple huh mmm we'll see 😊

Take care all

Bill
1 comment
  1. G6SWJ
    Midshipman
    Hi Bill,

    The HC12 can be used "barebones" for comms without any library - it simply acts like a wireless Serial Port.

    Utilising the RadionHead library may give you some additional functionality. (Data Packets,CRC checks).

    The HC12 can be "configured" using AT commands - you bring the "SET" pin low and then send your AT commands (change baud rate , radio channel (400Khz steps))

    The failsafe needs to protect your project from data errors but most significantly from signal loss. If the motors are commanded to spin and you loose radio data link you have no way of stopping the motors (or steering) !! - forget what the specs say 1KM + the RF output/receiver capability for these devices is minimal and likely to drop out at some point.

    I don't think the HC12 has an RSSI facility (signal strength) - many other RF devices do and it's a great thing to have...the software can monitor the "signal state". Indeed the remote transceiver can request an "ACK" from the shore based transceiver to see if it's still alive 😊

    I have not used the HC12 but I have used many other Arduino comms devices with great success - BUT I have chosen not to use them to control the throttle or rudder on my models - I value them too much.......

    Investigate using "constrain" for any "maps" or data values you use to command throttle,rudder - the map function is linear and does not trap rogue values passing through if you pass a rogue value in ( the fromLow & fromHigh parameters do not stop out of range values!!)

    You will need to be mindful of the loop efficiency (latency)

    And the last and most important point "Have fun with it" - hope my comments "add" to your journey - they at least might save a few more grey hairs 😊

    Regards
    Jonathan
    Liked by billmcl61

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Stage 2 - complete

Hi Everyone,

The past week has been spent searching for info, it was only when I took a step back and deciphered what I had already that things finally took shape and I actually felt that I understood what was on all the printouts that had amassed around me into ever growing piles. Sometimes you can't see the wood for the trees 😊.
The bottom line is that I can now move the joysticks on one Arduino and see the change in value on the other. This brought a huge sigh of relief, I was beginning to feel that I would never get it.
I used the cheap 433MHz set just to get this bit of code completed, but I will be using Hopefm's RFM69HCW 433MHz module for the next stages and the final project: this module has the major advantage of being able to have it's operating frequency (among other parameters) programmed to a legal one and it's comms is bi-directional-so maybe I might do something there to bring back some telemetry.
Many thanks to Jonathan (G6swj) for his guidance and advice on things, not least on what comms modules to use. I'll do another update tomorrow with the code and some photos.

Bill
Liked by G6SWJ
7 comments
  1. G6SWJ
    Midshipman
    Hi Bill,

    Let the receive function run unrestrained. It's the TX function that you want to run throttled.

    Otherwise the TX is sending another TX packet and the poor RX hasn't processed the first packet - result is a hung system.

    More fun to come program flow wise when you want 2 ways comms - sending back telemetry.....

    I think we forget that even the standard 16 MHz Arduino is fast... really fast.

    More stark when you talk it in terms of 16 Million cycles per second - with every tick of the clock, the CPU fetches and executes one instruction - still makes me smile - crazy technology.

    Beam me up Scotty...

    Regards
    Jonathan .
    Liked by billmcl61
  2. billmcl61
    Warrant Officer
    Ah gotcha, that makes a lot of sense.
    Yeah now you put it in those terms 16MHz is pretty fast, last time I was involved in comms, many years ago, we were working in KHz 😊, but that was just making up (RS232) data cables and making sure the baud rates were the same, I'm pretty sure it was about the same time windows 3.1 came in 😊 which will give you an idea how long ago it was.
    I'm slowly making progress, I've soldered in the pin headers to the Nano's and soldered leads onto everything else ready to put the transmitter together, I'm just thinking of a way that I can put the antenna together now so that I won't have to do to much mangle-isation when I change over to the RFM69HCW modules. Antenna wise I was thinking of a monopole, adding a ground plane antenna to give the signal a bit more oomph.
    I know that I shouldn't, but I'm being drawn to going straight for the RFM modules, I have a bad habit of trying to skip steps-usually ending up with 1 step forward and a lot of shuffling backwards hoping no-one will notice 😊. I'll have to behave and go through the steps 😊
    Oops forgot a power supply to the nano, but added now

    Bill

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Arduino Nano won't download sketch

Hi, my package from Germany finally arrived after 2 weeks with my Arduino Nano's, not A-Z Delivery's fault, just the postal chaos that's still with us.
I tried to load a sketch onto the first one, no dice, mmm tried the second one -same thing, Ah-ha must be the cable I thought so found another mini usb cable -nothing. So back onto the web tried a few things still nothing then found an instructables article with the same issue, tried all of it still no dice, then second comment down hit it right on the nail, the processor isn't the original arduino so if you follow the below steps, bingo it works 😊

MichaelB1268
MichaelB12681 year ago
ReplyUpvote
I bought a cheap Arduino Nano clone from China which uses the CH340C USB chip instead of the chip found on the genuine Arduino. I fixed it by:
1) Installing the CH340 driver
2) Set processor to ATmega328P(Old bootloader)
3) Using Arduino IDE installed locally on my Win10 pc, NOT the online Arduino IDE. NB. If both the locally installed and online Arduino IDE are open at the same time they can generate a different error "avrdude: ser_open(): can't open device "\\.\COM8": Access is denied." Simply close the online Arduino IDE to fix this error.

Bill
Liked by Martin555

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Comms range testing

Hi,

A while since my last post, but as with all things when you hit a minor road block you end up spending days trying to knock it down instead of simply driving around it, I'm still at that stage. (trying to knock it down unfortunately 😴)
I'm now trying to put together a simple (hah!) comms range tester. This comprises of 2 breadboards each with a Nano controller and either a transmitter or receiver. The receiver board also has an oled 0.96" I2C SSD1306 display which will display a free running reference 1 second count and a received packet count which is also sent every second by the transmitter. The transmitter will simply send the value 1 every second and the receiver will add that to the packet count and reset the received buffer back to zero ready for the next transmission. This part is relatively simple to code, just 2 lines on the oled display - a reference count and a received packet count.
The problem is 3 fold:
The Arduinos have limited memory, 16k of main memory and 2k of Sram, the oled consumes 1k of Sram (which can't be moved into the main memory) and the Strings and variables are also held in Sram (which apparently can be moved into Sram) - task number 1.
The Sram can become fragmented, which gives a false impression of the amount of available memory, the memory count doesn't count the gaps in the memory table. Can this be defragged ? - task number 2.
Sometimes the Libraries try to use the same resources which results in something that did work, i.e. the oled display, suddenly no longer working when you add the next stage of code, in this case the comms code (which did work previously) - task number 3.
Questions:
1.The Nano shows available Sram but is it fragmented ? causing a false reading.
2. Is there a conflict between the SSD1306 Oled library and the Radiohead RH-ASK comms library.
I've attached some reference docs of where I am at the moment, some parts of the sketch aren't complete as yet

Take care everyone

Bill
Liked by G6SWJ
3 comments
  1. billmcl61
    Warrant Officer
    Hi Jonathon,

    Yep been there before, I used to write and commission plc's when I was working in engineering, never gave up and the feeling you get when you finally crack it can't be beaten. I found that breaking code down and proving each block on it's own helps a lot, at least you can isolate and concentrate on the problem areas and deal with them one by one. I got an answer from Adafruit in the US which pretty much confirmed what I suspected, the Nano boards don't have enough memory, so I might have to scrub the OLED display and use the serial print monitor instead, just means that I'll have to take my laptop on the range test, which is a real pity, the OLED is a really nice (and compact) display.

    Bill
  2. billmcl61
    Warrant Officer
    Hi everyone,

    I've made some progress, well sort of😊, the memory problems have been solved by using a brilliant text only library SSD1306ascii.h, that Jonathon told me about, for the OLED display that uses very little memory and is perfect for my needs.

    Another good suggestion from Jonathon is to use a second Nano for the RC controller OLED display in the finished project, to spread the memory load.

    I had to do a couple of changes to the range test code to get my 2 lines displayed on the OLED, the first line is a reference free running 1 second counter and the second line is a count of the received packets from the transmitter.

    The transmitter will send a value of 1 for 500 milliseconds and then a value of 0 for 500 milliseconds then keeps toggling between 0 and 1 every 500 milliseconds.

    The receiver then reads these 1's and updates the packet count on the OLED display.

    I've tested this part of the code and everything works...sort of😊, I'm getting some data through then nothing, so I changed to the hello world sketch, which I know works perfectly, and I had the same results.

    So this points to the receiver and transmitter modules, and-or the integrity of the wiring, my money is on the latter😊.

    I'm still hooked up to breadboards (which I'm coming to hate) and despite searching for tight sockets, I feel that I'm not getting good connections.

    After this post I'm going to start soldering things together in a semi permanent fashion, so that I can rule out the wiring integrity doubts.

    It has to be said that the basic 433 MHz modules are susceptible to noise interference and this might be adding to the issue, but lets rule out the obvious first.

    Once I'm happy with my installation, I plan to do the range test well outside of town so that should help with RF interference issues.

    I won't post the code at the moment as I was up to stupid o'clock this morning, and I ended up unsure which sketches I had modified... again 😊, so I'm taking a day off from the code side of things, to do some much needed hardware modifications, then I'll figure out which is the real version of the code.

    I promise I will do some photos soon, I just need to re-find my camera

    Take care everyone

    Bill

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Progress to date

Hi Everyone,

At last I found my camera so I can finally post some pictures, nothing truly awe inspiring, but they mark my progress... Albeit slowly, there's one photo in there that's totally unrelated to this thread but I thought Martin might like it to show off his amazing miniature handy work, sorry that they are a bit blurry but this camera doesn't have stabilisation, once I've posted I'll try to get them in some sort of order and provide some comments to explain them.
Thanks for having a look.
Bill
Liked by G6SWJ
5 comments
  1. billmcl61
    Warrant Officer
    Ah ha, you guys didn't spot the deliberate mistake, I had the transmitter connected instead of the receiver, but by a stroke of luck connected to the right pins, ok it wasn't deliberate, I goofed...

    Not too big of a job, just unpicked the hot glue, drilled a new hole for the antenna and we'll try again.

    Mmm I wonder if I had these... nah couldn't have - could I ?😊

    Bill
    Liked by RNinMunich
  2. billmcl61
    Warrant Officer
    Taking a wee tea break just now so I'll try to make some sense of my previous posts.

    The first post in this thread has a bunch of photos that range in age, some go back to nearly the start of this voyage.

    Photo number 1 is the old remote controller that I pulled down from the attic and took apart and stripped out, I'll be reusing this case for the Arduino based remote controller.

    Photo number 2 is just the back of the controller.

    Photo number 3 is a fairly recent one showing how everything connected to the breadboards, the one on the left is the receiver and also has the oled display attached - even though it's not clear to see. the one on the right is the transmitter.
    Above is a Nano controller and to the right of it is an uno controller, both have pretty much the same capability despite the difference in size.

    Photo 4 is another early photo when I was using the uno to develop the code.
    At this stage the code was all in one before I split it to develop the comms code.
    One of the problems I was having at this stage was losing the joystick signal - which wasn't surprising when the wires were just twisted together 😊

    Photo 5 This is totally unconnected to this thread, just a bit of fun really, I found this wee bottle during my rummage through the attic, and I immediately thought of Martin and his miniature creations, just to the right of it is a 10 Eurocent coin which is pretty small.

    Photo 6 this is some of the bits that I'll be using for the range tester and some main denomination coins to give a sense of scale. the 2 units just above the coins are the RFM69HCW transceivers that I'll be using for the final project, and below the coins is the OLED display.

    Photo 7 shows the circuits still wired to the breadboards and the plastic box that I'll be using for the range testers.
    The straws that I'll be using to hold up the antenna cable, which is just 173 mm of the silicon wire that is from the box also in shot.

    My apologies for the quality of these photos, the camera that I'll be replacing in a week or so is pretty old at this stage, and doesn't have anti shake, and I can't figure out why the flash isn't working.

    Thanks for looking

    Bill

Sign in to comment on this update.

billmcl61
Update · 6 years ago

Minor setback

Hi Everyone,

I soldered everything together yesterday and in a burst of enthusiasm assembled it only to find that something isn't quite right, I suspect a dry joint somewhere...

lesson one (the one I keep forgetting to do - ok that I bypass😊) TEST IN STAGES

lesson two ..... refer to lesson one 😊

So everything is disassembled - again, and I'll check all my joints. If in doubt redo the joints.

I had a closer look at the pinheaders on the Nano this morning and it looks like there could be a few dry joints, so my first step will be to get the soldering iron out again and just work through them one by one.
I'll take a small break from this just to recharge my batteries, and then have another go.

All part of the learning curve 😊

Bill
Liked by MouldBuilder

Sign in to comment on this update.

Delete this post?

It will be removed from the site.

Discard this draft?

Your draft will be deleted and cannot be recovered.

You have an unfinished draft

What would you like to do with it?