By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by CML

Anyone Arduino...?

Do you use one for anything...

All Topics | Latest Posts

Search for:  in Thread Title in  
Cyclicscooby17/06/2014 14:49:15
avatar
874 forum posts
531 photos

Hi Guys..

Has / does anyone use the Arduino..? For anything, not just RC..

I've been dabbling with PIC processors for a few years now, with limited success. The only programmer board I found was the Maplin one, but its a serial interface. So, it's running thru a PCMCIA serial adapter, on my ancient laptop (P4 1.8g), which I believe is the issue.. It only burns properly about 1 in 10 times and doesn't correctly identify the chip.. I'm fed up messing about with IRQs, baud rates, etc, so wandered if the Arduino would suit my needs..?

My needs are simple.. Flash LED's, PWM'ed, multiplexed if required, and servo read n write.. I appreciate the Arduino is capable of far more, but i'm fed up with the PIC programmer..

Any experience.. ?

Luv Chrisie.. xx

Phil Green17/06/2014 22:33:36
avatar
1542 forum posts
314 photos

Hi Chrisie
I've spent a lifetime doing (& teaching) assembler programming on microprocessors such as pics, 8051, 80x86, right back to the z80, 6800, sc/mp and so on... but only recently tried an Arduino for the first time. I was utterly gobsmacked - its so easy its almost cheating! everything complicated has been done for you, leaving you to tie a few routines together with a simple script - if you've done some pic stuff you will find these unbelievably easy to get along with. The format is based on c++ but pretty much mirrors any modern hll - its very readable. It has tremendous support, it seems everyone uses them, and they're also really cheap. I'm not a convert as a lot of my stuff is synchronous cycle-counting code where the pic excels. But the Arduino is a quick, cheap and very easy way to get a project off the ground!
Cheers
Phil

PS for your pic stuff I'd recommend the pickit 2, about £40 for a real one but you can buy clones for about £25. Its USB so no messy serial comms to configure.  Dont bother with any of the IDE, debugger, ICE etc its not necessary, just the pickit 2 programmer and mpasm is all you need. To create/edit source I use good old windoze notepad.

 

Edited By Phil Green on 18/06/2014 01:22:32

Cyclicscooby19/06/2014 13:34:15
avatar
874 forum posts
531 photos

Cheers Phil.. wink

Sounds like it's worth a bash then.. I used to be a programmer, Cobol on a MF, then on Unix.. Learnt asm on an EMMA at college, and hated it at the time, but when I re-started, for pleasure, I thought BASIC was cheating, and the 'proper' way was asm..

Love the PIC, and its ease of use, but as mentioned, my Velleman board is doing my head in...

I might invest in a new USB board, but, as you said, Arduino n Pi are the new big thing.. Maplin have reduced their PICs to just 2..! Fortunately one is the 628 I use, but it's only a matter of time...

I've never really got my Rx PWM reading quite right on the PIC, but having looked at some 'sketches' online, it appears to be a couple of lines now..!

I like the tiny nano boards, but think I'll start with a normal one, to make fiddling easier..

Just found out I'm not working today, so will see if Maplin have stock...

Thanks alot Phil, much appreciated, especially from someone with your background..

Luv Chrisie.. xx

Phil Green19/06/2014 14:41:39
avatar
1542 forum posts
314 photos

Hi Chrisie

the pic can read the pulse-width of a receiver channel output entirely in hardware, no code necessary and its accurate to 1uS. If the pic in question can invert /T1G then connect the receiver signal directly to T1G, if not connect the receiver channel to the pic comparator input. set up the comparator as a simple inverter. Connect the comparator output to the timer gate. This is necessary for the 12F675 as the timer gate is inverted, ie low enables the count, high stops it. Clear the counter, wait for the channel to return low. The timer now contains the pulse width to 1uS resolution with the internal 4mhz clock.
Dont forget to range check the result to avoid out-of-spec pulses (permit say .8ms to 2.3ms). Polling for completion, range checking and whatever processing requires no more than just a few lines of assembler. Keep it Simple!!!
Phil

 

Edited By Phil Green on 19/06/2014 14:43:40

Plummet19/06/2014 15:02:46
avatar
1408 forum posts
41 photos

Chrisie

I have never touched an Arduino, but have tinkered with a Raspberry Pi. If you have unix experience the linux OS will be familiar. And of course you do not have to footle around in assembler, you can use much higher level language.

Plummet

Phil_G19/06/2014 16:48:13
avatar
58 forum posts
12 photos
Posted by Plummet on 19/06/2014 15:02:46:

of course you do not have to footle around in assembler, you can use much higher level language.

As Aristotle famously said, "pffft..."

Cyclicscooby20/06/2014 01:58:25
avatar
874 forum posts
531 photos

LOL... pfft..

I got one this afty.. I want a mini/micro for the planes, at £10 each, only twice a PIC, but for ease of trial messing about, I got an UNO for £25 from Maplin..

Compared to the PICs, where you have to source and research project parts ( i.e. Gps, accelerometers, etc ) the Arduino is all done for you... 10 years ago I would appreciate the challenge, but for its simplicity, and potential time from idea to complete project, its unbeatable...

I just got it all setup on my old laptop, rebooted laptop, picked up tablet, and found an app thats a complete IDE on my tab.. BONUS... So I messed about with that instead, now its 2am, and i still haven't got round to actually plugging it in, on either pc or tab, to see 'Blink' in action...

Luv Chrisie.. xx

Phil Green20/06/2014 08:40:18
avatar
1542 forum posts
314 photos

... and if you keep a few 5v LEDs in your toolkit 'blink' doesnt even need resistors... smiley

 

You'r right, its too easy Chrisie... now you know how Picasso felt when they invented Paintball...

 

Edited By Phil Green on 20/06/2014 08:41:42

Pup Cam20/06/2014 09:44:57
avatar
44 forum posts
89 photos

I've done some Arduino stuff.

Effectively built a Tx using an Arduino for the encoder and a FrSky 2.4GHz Tx module did the job it was supposed to a treat. Various other R/C based experiments with them too. As Phil says, once you get up and running they're great and with all the available libraries it's a bit like digital Lego.

The Arduino Cookbook from O'Reilly is an excellent introduction and gives you a feel for the staggering versatility of the little beast from flashing lights to serving information to the web, with R/C and stepper motor driving etc (my main areas of interest) somewhere in the middle.

Alan

NigelH23/06/2014 07:36:54
891 forum posts
1 photos

You can get the Arduino Uno R3 ( or a clone ) from China via eBay for less than six quid. Same for an Ethernet shield. I've bought every sensor under the sun from eBay and most of them are like a couple of quid posted,

You can get cheap LCD displays starting at a couple of quid and add an I2C to parallel adapter for a quid. You can then drive it using only two data lines.

if you like what you have made, you can flash the software into a standalone chip which costs about three quid.

You can get the TL866 programmer for about thirty quid that will program many different types of devices.

Cyclicscooby02/07/2014 03:56:10
avatar
874 forum posts
531 photos

Hi Guys..

This Arduino is almost annoyingly good.. Annoyingly, because i`ve achieved more in a week, than 5 years faffing with PICs..

I did get the PIC working enuf to get navs on my heli, with beacon, double and triple strobes. No inputs, just run sequence..

Well I replicated thats on breadboard in 4 hours. That included wiring it up and coding from scratch (to test my new skills). And I only got 2 compo errors, one missing semi-colon and a wiggly bracket pointing the wrong way. Excellent..

2 hours after that I had a fully working button that cycles thru a flash sequence for the two strobes, Single & Off, Single & Single, Single & Double, etc, upto Triple & Triple..

30 mins after that, I was storing the selected sequence to EEprom, so it will continue after reboot..
All dreams on a PIC..


This week i`m doing `Landy Lites` for my RC Landy, with it`s recently converted Dx6.
Reads the 4 primary channels

Flicking the Elevator down n back to centre, cycles Sidelights, Dipped, Side, Off
Flicking Elev Up, If on Dipped beam, toggles mainbeam and spotlights On/Off
OR, if dipped beam not on, it flashes Mainbeam n spots twice
Oh, and the headlights have a `HID` startup, with that flicker n fade in thing they do

Rudder is Indicator stalk and triggers appropriate indicators, which self cancel once the steering has moved in the indicator direction then returned to centre.

If Elevator held high when left indicator triggered, hazard lights activate until toggled off.

All that is working now, with a spare AR600 and breadboard.
Tomorrow i`ll add the Brake and reverse light code.


The serial monitor has been very useful to fine tune the code around the actual Rx PWM values.

The planes and the Landy already have the LEDs mounted, but I dont intend sending the `big` UNO to the sky / muddy 4x4 bog, so I ordered 2 `A star` micro boards, and a `Teensy 3.1` today.

I just have to build a transistor`ed vero board (all high power LEDs ) to mount the Micro`s, a few header pins, and i`m sorted

If anyone wants a copy of my code, just ask. I`m an old programmer, but very new to this..

 

Luv Chrisie.. xx

Edited By Cyclicscooby on 02/07/2014 04:03:05

DJC02/07/2014 10:54:00
28 forum posts

hi

please see on going thread - Futaba M6 Fr Sky 2.4 ghz DIY Conversion by Paul Luby

been tweaked by Phil Green and looking like it will be a future RCM&E article if Paul can find the time to write it.

rgds

dave c

Stevo02/07/2014 11:47:55
2699 forum posts
419 photos

As an alternative,

Ive been using the PicAxe programmer. I've designed Gun flash circuits, remote programmable glow drivers, Glow driver timing circuits for the field, and so far I'm impressed.

The parallel processing of the larger chips sure does make short work of a pseudo random gun flash, and recognising the pulse width in is a doddle.

Currently interfacing it with a serial OLED display for a programmable engine test bed. I have seen reviews for Arduino and they are good too. Make your choice!!!

Cyclicscooby02/07/2014 12:42:52
avatar
874 forum posts
531 photos

PicAxe is a PIC programmer isnt it..? Or is it the language too..?

I have to be honest and give PICs their due, as an ex programmer, I dismissed the 4gl languages and decided asm was the best way. Showing off i suppose, but in reality it just made it more difficult .. By using a 4gl you can bypass all the fiddly timing issues and let the background code sort it out..

I appreciate the Arduino is just a PIC on a pre-made board, but it does make a huge difference in RnD time.

The Libraries make stuff too easy. No checking stack overflows, moving data thru W all the time, carry flags, etc, just ' do that ' and it does..

Maybe i'm getting lazy in my old age, but i'm loving it...

Next question is, what to use it for next.. I'm not interested in ethernet, and all that comms stuff, but the touchscreen LCDs are tempting..

Maybe a 3axis gyro in the Landy (or plane) that displays the angle of the vehicle on a screen attached to the Tx. Like the inclinometer fitted to Shoguns, with warnings when tip angle close..?!

Its like theres so much stuff you can do with it, you cant see the wood for the trees..

Luv Chrisie.. xx

Stevo02/07/2014 12:57:44
2699 forum posts
419 photos

Yep I'm lazy in my old age

It's programmed in basic (!) and yes there's almost no R&D time. For RC usage, its certainly quick enough, but obviously for tight code then ASM is your thing. For example it already has servo out commands, ADCs, pulsin command whereby the input PWM pulse is measured...

Cyclicscooby02/07/2014 13:30:45
avatar
874 forum posts
531 photos

I was suprised at the readings I got from the Rx.. Not quite the 1000 to 2000 ms range i was expecting

It could be, probably is, due to small timing errors within the Arduino/code, but the PWM values were not as accurate as I thougt they would be on a modern 2.4G radio, altho they were consistant, time after time..

I got the following values on a Dx6i with Ar600. Fresh new model memory n bind. Default settings - trims centre, 100% travel, no D/R or expo

Channel Low Centre High

Throttle 1065 1410 1910

Rudder 1135 1470 1905

Elevator 1087 1505 1910

Aileron 1085 1485 1885

Not too far off expected, but any code using it, needs to be 'fine tuned'.

Those are the Raw input values, but i'm remapping them to 255 and averaging the last 3 reads within the code..

Are these similar to your timings..?

Luv Chrisie.. xx

Stevo02/07/2014 13:38:39
2699 forum posts
419 photos

I can't state the exact timings, but not far off what you have indicated. Yes, indeed there has to be some fine tuning as you say for a more demanding application, but simply when I designed the remote glow, you would set the stick to a predetermined level and slide a switch to register it for example.

When the stick was at that value, it was rock solid and repeatable, and stable (JR DMSS receiver).

I'll PM over some code for you later today so you can see.

Steve

Phil Green02/07/2014 13:43:36
avatar
1542 forum posts
314 photos

There you go you see, a 4mhz pic can accurately read an R/C pulse to 1uS entirely in hardware, or to 250nS at 16mhz!

Horses for burgers courses...

Heres my Kraft refit using an arduino nano:  http://www.modelflying.co.uk/forums/postings.asp?th=97589

Cheers
Phil

Edited By Phil Green on 11/07/2014 20:00:14

Phil Green15/07/2014 12:42:24
avatar
1542 forum posts
314 photos

Anyone else having reliability problems?

As an introduction to these boards I bought 5 Nanos, one from HobbyKing, the rest from a 'mid-price' ebay seller.

Of the 5 boards, the HK one arrived with a dry joint or some connectivity problem on the A0 pin - the input ignored the A0 pin and showed the adjacent A1 voltage instead. Otherwise it works ok.

Of the 4 from ebay, one has been working fine for 2 weeks then went into what seems to be a hardware failure - the firmware thats in it runs randomly, ignores reset, and it will not be reprogrammed, not via usb as the bootloader doesnt respond to the IDE, nor will it connect via ICSP, so cannot reload the bootloader.
It seems to be bricked with random content! It was run well within the specs, power supply was good, no outputs shorted or overloaded, no misconfig, it simply failed in normal service after 2 weeks. I replaced the board with another from the same supplier and using exactly the same code, and it runs fine again

Paul mentioned some scary reliability figures in his M6 thread:
   Maybe you pays for what you get. I did read on the Arduino forum that
   failure rates for non-genuine Arduino's is greater than 60%.
   Am yet to experience any failures, maybe I've been lucky.

Maybe my 2 out of 5 is unlucky but if the only way to ensure reliability is to buy genuine Sparkfun ones (they designed it) then it becomes a bit expensive! Any thoughts?

Cheers
Phil

Edited By Phil Green on 17/07/2014 00:27:28

XK5015/07/2014 15:23:08
54 forum posts
3 photos

Although I built a Transam Triton 8080A (1.5K integer BASIC!) in 1977, I hain't a programmer nor an electronics engineer. Indeed, when I first found Paul's and Phil's threads, about three weeks ago, I hadn't got a clue what was going on, but was driven by the idea of modernising an old Remcon Quantum Six.

So, two weeks ago, I downloaded "Getting Started With Arduino" by Massimo Banzi (4 quid-odd, on Kindle) and then felt reasonably confident to order a Sintron Beginners' Kit for 39 quid (the one with the Tower Pro SG90 servo, the stepper motor and an Arduino Uno-compatible board), off Amazon.

For the money, the thing is amazing and a super intro to these things (but you need to follow a trail to get the manuals, as none are supplied in the kit). In the last week, I've successfully occulted my LEDs, said "Hello World!" on the LCD display, built a servo exerciser and even captured serial data as text, on my mac, using the Coolterm app.

Future plan is to get a GPS "shield" and start playing with that. All dead easy, just boiler-plating the downloadable library "programs", as required.

So far, the thing has been totally reliable but, this lunchtime, I discovered the 5V pin is delivering only a smidgeon more than 3.5V, when using the supplied 9V battery, as opposed to USB-supplied power. This fails to drive the 9g servo. Bummer, as it means I'm tied to the laptop .... but I'm not complaining. Might only use the genuine kit for serious stuff, in future, though.

To be researched, but no confusion with the nearby 3.3V pin and the battery appears ok.

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of RCM&E? Use our magazine locator link to find your nearest stockist!

Find RCM&E! 

Latest Forum Posts
Support Our Partners
Sussex Model Centre
Wings & Wheels 2019
CADMA
CML
Cambridge Gliding Club
Slec
electricwingman 2017
Sarik
Advertise With Us
Latest "For Sale" Ads
Do you use a throttle kill switch?
Q: This refers to electric-powered models but do you use a throttle kill switch?

 Yes
 No
 Sometimes
 Rarely

Latest Reviews
Digital Back Issues

RCM&E Digital Back Issues

Contact us

Contact us