Is anyone building or has built an Arduino project for 009? I have created a few circuits for other gauges but not yet in 009. I have an idea for a simple small oval layout where the trains automatically park behind the back scene and enter the display area one at a time. I would also be interested to hear about any other members microcontroller creations.
Neil
Hi Neil,
I have not built any Arduino projects, I have dabbled in microcontrollers but with Picaxe controllers mostly, but no rail related projects so far. Things like a bump and spin buggy and an iambic Morse keyer.
If I remember correctly though I think the Deltang radio control system is based on Arduino microcontrollers. There is a chap on RMWeb (Robin2 I think) who dabbles in Arduino control systems. He says you can reprogram the Deltang controllers if you know how to do it - not just changing the parameters, for which Deltang give the instructions on line, but actually loading new code.
Some folk have built their own complete radio control systems for model rail use, using Arduino boards and the appropriate RF chips.
Frank
Warning this is not 009....
The H0 side of my Westdorf layout is fully automated with section signalling, trains stopping in the stations and automated passing loops. It is double track with six trains on each track, at least four trains are out of sight in the storage loops and up to eight are moving at one time.
However, although this system is only a couple of years old now it is all done in 'old school' fashion with relays and magnetic reed switches in the track.
After a couple of problems with some 'fake' relays from China when new it is now 100% reliable and after working out the basic latching relay wiring it was quite easy to set up.
I can just set the trains standard gauge trains running and then operate the narrow gauge (H0e/009) end to end side of the Westdorf layout manually with the standard gauge trains running past.
I did it this way because I find relays easier to understand than electronics. But each to their own.
Brian Meldon
I have used the picAXE in a few things.
Quite a few Arduino projects, but nothing for 009 (yet).
Not OO9 specific but my layout is pure OO9
I am working on a number of PIC microchip projects that are to ad interest to the scenery.
This is combining smoke, leds (fire/arc welders/flashing lights ect) and movement using a micro servo.
I first learned to program in Fortran in the late 1960s and progressed through to Basic, machine code and assembler.
Having retired i have taken time to learning/programming in C using microchip MPLAB and Pickit 4.
Its been a long learning curve but hope to have
Hotel BBQ with fire and smoke
Animated signalman with flag
Fire breathing dragon with smoke and movement
Other projects are planed and will post details on above as they become show-able.
I have built some animations for our club kids OO layout. So far I have flashing lights on emergency vehicles and a Tardis. A building fire simulated using randomly flickering LEDs, a mechanics car lift (using a servo), a car transporter delivering a car (2 servos), a tipper truck (1 servo), a helicopter starting up (mosfet controlled motor), a vibrating road worker with a drill (relay controlled motor) and a working crane (2 servos). The Chinese copies of the Arduino boards are very cheap as long as you do not mind waiting a few weeks for delivery.
My picAXE projects my be found on the website;
the Witch on her broomstick here : http://hnorwood.co.uk/files/broom.htm (http://hnorwood.co.uk/files/broom.htm)
the working Popham semaphore here (I really must get round to finishing it...) http://hnorwood.co.uk/files/semaphore.htm (http://hnorwood.co.uk/files/semaphore.htm)
...and a couple of controllers http://hnorwood.co.uk/files/pwm2.htm (http://hnorwood.co.uk/files/pwm2.htm) and http://hnorwood.co.uk/files/pwm3.htm (http://hnorwood.co.uk/files/pwm3.htm)
(I too have flickering firelight in one of my buildings - but I use a trio of astable multivibrators and some diodes to produce the effect - as, too, in the "eyes" in the sewer pipe.
I like your animations. Very imaginative.
I have been messing around with Arduinos and pics for several years now and I have incorporated quite a few Arduinos into my 009 layout. I have 3 arduinos (pro-minis) each controlling 8 point motors (servos) and 6 under track IR sensors for loco detection and automatic point throwing. 2 arduinos send i2c signals to these point controllers from a mimic switch panel. I have 1 arduino controlling a stepper motor turntable, another controlling a 3 servo dockside crane that unloads slate from a rake of 6 wagons into a longboat barge . I'm currently developing one to control servos and stepper motors to allow automatic loading of slate ( re-cycled from the longboat barge) into wagons that enter the "mine" empty and exit loaded via any one of 3 mine tunnels by gravity feed (Arduino controlled magnetic braking) these then collect in a siding to await a loco to take them to the dockside crane.
I'm using an arduino mega to process the DCC control for my locos, (DCC++) and JMRI from an old PC and android phones as portable wireless throttles. The Arduino mega has about 60 general puropse input/output pins which can be triggered by Addresses for signals, sensors, points/turnouts lights etc within the JMRI software. As these are merely "on" or "off" signals they are effectively switches so DCC isn't necessary for the arduino controlled stuff to work, just a switch. but its nice to be able to throw points and operate the turntable from a portable phone or tablet as well as a fixed mimic, I have a 3D printer so I design print as much as possible, rather than scratch building or buying off the shelf, I have posted a few designs onto Thingiverse, (3D printing forum) and included arduino sketches. https://www.thingiverse.com/bluetobits/designs (https://www.thingiverse.com/bluetobits/designs).
If anyone would like any of my other sketches and circuits please let me know. I can upload stuff here as I develop it if anyone is interested.
Cheers
Steve (bluetobits)
Well your posting has moved me to action and i have completed the first phase off "Frederic The Friendly Dragon" at Castle Valley.
It took some doing but finally managed to get the software and mechanics sorted.
Eventually he will have flames (red LEDs) in the nostrils and (orange LED) in the mouth and hopefully some smoke but there are other tasks(domestic) pending so don't hold your breath.
Video on you tube here
https://www.youtube.com/watch?v=D7tLT5p2PlE
Quote from: Steve Lomax on December 29, 2018, 03:08
I have been messing around with Arduinos and pics for several years now and I have incorporated quite a few Arduinos into my 009 layout. I have 3 arduinos (pro-minis) each controlling 8 point motors (servos) and 6 under track IR sensors for loco detection and automatic point throwing. 2 arduinos send i2c signals to these point controllers from a mimic switch panel. I have 1 arduino controlling a stepper motor turntable, another controlling a 3 servo dockside crane that unloads slate from a rake of 6 wagons into a longboat barge . I'm currently developing one to control servos and stepper motors to allow automatic loading of slate ( re-cycled from the longboat barge) into wagons that enter the "mine" empty and exit loaded via any one of 3 mine tunnels by gravity feed (Arduino controlled magnetic braking) these then collect in a siding to await a loco to take them to the dockside crane.
I'm using an arduino mega to process the DCC control for my locos, (DCC++) and JMRI from an old PC and android phones as portable wireless throttles. The Arduino mega has about 60 general puropse input/output pins which can be triggered by Addresses for signals, sensors, points/turnouts lights etc within the JMRI software. As these are merely "on" or "off" signals they are effectively switches so DCC isn't necessary for the arduino controlled stuff to work, just a switch. but its nice to be able to throw points and operate the turntable from a portable phone or tablet as well as a fixed mimic, I have a 3D printer so I design print as much as possible, rather than scratch building or buying off the shelf, I have posted a few designs onto Thingiverse, (3D printing forum) and included arduino sketches. https://www.thingiverse.com/bluetobits/designs (https://www.thingiverse.com/bluetobits/designs).
If anyone would like any of my other sketches and circuits please let me know. I can upload stuff here as I develop it if anyone is interested.
Cheers
Steve (bluetobits)
Hi Steve,
As someone about to get into Arduino and the things it can do...
I'm interested in how you use the Arduino to operate the point servos very much!
Not so worried about the other things that can be done, but making the points work is a must!
Thanks
There are two servo driver examples in the Arduino IDE. These are a good starting point and will give you an idea of how to structure a sketch to operate a servo. Once you get the basic idea, it is not too difficult to modify the sketches to move a servo to a fixed position at the touch of a button.
Neil
In March's "009 News", David and Sue Griffin's "Hillside Mine", there is mention of an Arduino-controlled NG line which sounds very interesting (a future project I think).
I have been looking at Arduino (and Raspberry Pi) for some time, but, so far it is a solution looking for a problem...Now though, on my diorama layout, there is a rope-worked incline. This unloads a canal boat and moves the goods up to a higher level 009 siding. I think the 'rope' and associated truck(s) can be on an endless loop with automatic starts and stops at each end. Operating under Arduino - in a random fashion - this would make for ideal background interest.
Has anyone tackled such a thing ? I have programmed in DOS and Basic many years ago, but, not down to Assembler level. Could do with some guidance on what's involved.
Dave
Hi Dave,
A "solution looking for a problem" is not a bad way to make a start.
The choice of device depends what you want to do. The Arduino is a microcontroller development board ideal for interfacing and controlling things. The Raspberry Pi is a single board computer. It can control things but its strength lies in doing the sort of thing you might on a (low power) PC (graphics, data processing..) without the worry that if things go haywire you've not lost all the things you might have access to and stored on your PC.
If you have experience of programming in BASIC on a PC then Arduino should not be too unfamiliar. The syntax is C and a bit odd at first but an IF statement is an IF statement etc. in pretty much any language.
There are plenty of low-cost Arduino clones from the Far East and I've not come across one that has caused problems. There are also some excellent starter kits with a prototyping board and a selection of components. There are also some very comprehensive kits too.
Hi Graeme - thanks for the reply.
I'm thinking that I might get the incline working 'mechanically' to start with using a simple motor /gearbox drive, battery-powered and controlled by a DPDT switch plus a couple of limit switches at either end of the line.
The Arduino would then automate the switch positions under program control. That's the theory anyway. As always, the devil is in the detail ! Do you know what power supply the Arduino needs ? It would be nice to be able to choose between 'manual' and 'computer' control without complicating the wiring too much.
Hi Dave,
Power supply options are pretty flexible -
1. for learning and development work it can be powered through the USB cable used to programme and communicate with it.
2. it has an on-board voltage regulator that tolerates quite a wide range of DC supply. Many Starter Kits come with a PP3 battery clip. A 9 V or 12 V "wall wart" mains adaptor is ideal. It has the commonly found barrel connector compatible with wall warts.
3. (more for experienced users) an external regulated 5 V supply can be applied directly to the board.
I introduce my students to programming and interfacing by giving each one (for a returnable deposit) a kit very much like this:
https://www.banggood.com/Basic-Starter-Kit-UNO-R3-Mini-Breadboard-LED-Jumper-Wire-Button-For-Arduino-With-Box-p-1161006.html?rmmds=search&cur_warehouse=CN (https://www.banggood.com/Basic-Starter-Kit-UNO-R3-Mini-Breadboard-LED-Jumper-Wire-Button-For-Arduino-With-Box-p-1161006.html?rmmds=search&cur_warehouse=CN)
Less expensive kits are available as are much more expensive "Christmas present" style ones.
https://www.robotshop.com/uk/arduino-starter-kit.html?gclid=Cj0KCQiAk-7jBRD9ARIsAEy8mh7GsHsDDJUdVRh5x7RmdkdESWBc6UFu-z6EwntB-4WziK2FxE6G2JoaAkZFEALw_wcB (https://www.robotshop.com/uk/arduino-starter-kit.html?gclid=Cj0KCQiAk-7jBRD9ARIsAEy8mh7GsHsDDJUdVRh5x7RmdkdESWBc6UFu-z6EwntB-4WziK2FxE6G2JoaAkZFEALw_wcB)
https://www.banggood.com/UNO-Mega-Nano-Sensor-Relay-Bluetooth-Wifi-LCD-Beginner-Starter-Kit-For-Arduino-p-1132002.html?rmmds=search&cur_warehouse=CN (https://www.banggood.com/UNO-Mega-Nano-Sensor-Relay-Bluetooth-Wifi-LCD-Beginner-Starter-Kit-For-Arduino-p-1132002.html?rmmds=search&cur_warehouse=CN)
If you are familiar with soldering Veroboard circuits, then a quick and reliable way to build a permanent project is to use the more or less functionally equivalent Arduino Nano that can be soldered in (or preferably plugged into an IC socket) on the Veroboard. Clones can be ridiculously inexpensive.
https://www.banggood.com/ATmega328P-Nano-V3-Controller-Board-Compatible-Arduino-p-940937.html?rmmds=search&cur_warehouse=CN (https://www.banggood.com/ATmega328P-Nano-V3-Controller-Board-Compatible-Arduino-p-940937.html?rmmds=search&cur_warehouse=CN)
(I see they are on special offer so I might just buy a dozen!)
Graeme - looks like quite a few affordable options here. You mention "students" - does this imply that you run programming /constructional courses ?
I have done some 'breadboarding' and built simple circuits on PCB's etc in the past and now have a 'scope (Tektronix) that I will use to debug radio control stuff. I understand that Arduino can output servo driver signals and this could be useful for my various bits and bobs mentioned in the previous post ?
Would be interested in more info' regarding courses for future learning...(PM maybe)
Dave
Hi Dave,
Yes, one of the things I do is teach a micrcontroller course to first year engineers. I'll be retiring at the end of the summer and am currently winding down. I hope to be a more active modeller then, including the local MERG (Model Electronic Railway Group) that I used to host. I'm happy to help with learning about Arduino.
Yes, controlling servos from an Arduino is straightforward. Depending on the servo and the load, it might be worth powering the servo from its own supply and not through the Arduino's onboard 5 V regulator.
I find that the onboard 5v regulator can get quite hot if you use an input of 12v. I tend to run my boards direct from an external 5v supply which can handle a bit more current.
Neil
Quote from: GraemeD on March 04, 2019, 08:28
Yes, controlling servos from an Arduino is straightforward. Depending on the servo and the load, it might be worth powering the servo from its own supply and not through the Arduino's onboard 5 V regulator.
I have been advised to use a separate 5V line for servos as they can take quite a bit of current (and noise too?) (this is not arduino, I hasten to add)
Quote from: hughn on March 07, 2019, 15:54
Quote from: GraemeD on March 04, 2019, 08:28
Yes, controlling servos from an Arduino is straightforward. Depending on the servo and the load, it might be worth powering the servo from its own supply and not through the Arduino's onboard 5 V regulator.
I have been advised to use a separate 5V line for servos as they can take quite a bit of current (and noise too?) (this is not arduino, I hasten to add)
Yes. There can be quite a big current spike as the servo starts to move. A load such as driving point blades against their stops and stalling the servo will also draw a hefty current. I remember a Lynxmotion 6-legged walking robot that had two servos per leg would misbehave as the batteries ran down. It would "get up" and the effort was enough to pull the voltage down so much that the microcontroller did a low voltage reset, the robot would collapse as the microcontroller output turned off, it would restart and the whole thing repeat over and over.
It is probably wise only to run no more than a simple test or practice program with a small servo and with no load if powered directly off the Arduino.
Quote from: Neil McGrath on March 06, 2019, 20:54
I find that the onboard 5v regulator can get quite hot if you use an input of 12v. I tend to run my boards direct from an external 5v supply which can handle a bit more current.
Neil
Yes, if I was expecting the Arduino to run a project such as control a something on a model railway for an extended period of time I would not be happy with it getting so hot even though the Arduino web site says the board can handle it.
Hi. Arduino controlled point motors:
I'll try to be brief...
I have a DCC++ (Arduino based DCC) layout and have point (turnout) triggers from JMRI software running the layout on a PC. This allows me to access unused pins on the main Arduino base station. I use an Arduino mega for this so that I can get 50 pins to control points and receive sensor triggers for point and train running automation. I also have a conventional switch panel for points. Although my points are controlled by DCC, the DCC is converted to analog switch control and each point switch on the panel is 3 position, Closed, Thrown or Auto controlled. So I could list the arduino sketches I use, but the code that handles the DCC would need to be removed.
it is easier to start again.
I use SG90 mini servos controlled by Arduino Pro Mini (small and cheap) but any arduino should work
I recon the easiest way is to use 1 arduino to control up to 6 points. They're only
I have some other model railway related arduino projects on my thingiverse page.
There's a 3 servo crane, children's playground and turntable.
https://www.thingiverse.com/bluetobits/designs (https://www.thingiverse.com/bluetobits/designs)
Hi All
I hope this isn't too far 'off-thread' but I've just been looking at the "Sparkfun Inventors Kit". Seems to be Arduino-based and, I believe programming is C# /C++.
You get a 'de-luxe' arduino, breadboard plus bags of components etc for making circuits and projects...
Seems like it might make a nice Xmas present if I can persuade certain family members !
Anyone tried it ?
Dave
No, but Sparkfun have a good reputation and I've got individual parts from them. There are less expensive kits, but I think you can be certain that the individual bits will be reliable and go together well which is not always the case with cheap kits.
Hi Graeme
Just read a review on the Sparkfun IK and the main complaint seems to be the wire gauge used on the low-value resistors (1/4 watt and below) are too 'thin' for the supplied breadboard. This leaves them flopping about in the holes and unable to make a proper connection.
Maybe one could 'double-over' the free ends to make them a tighter fit, or, solder a thicker pin on to suit ?
Otherwise, seems like the reviewers were happy...Kit is around
I tend to just buy the Chinese clone Arduinos together with the components and accessory boards that I need. I will always look for the accessory modules on Ebay that are due to finish their auction at a low price, so I can build up a decent stock of spares that I can dip into. A good supplier is Banggood.com. They have a decent selection of low cost parts and will generally deliver free within a couple of weeks.
Quote from: Dave Cooper on August 30, 2019, 12:04
Hi Graeme
Just read a review on the Sparkfun IK and the main complaint seems to be the wire gauge used on the low-value resistors (1/4 watt and below) are too 'thin' for the supplied breadboard. This leaves them flopping about in the holes and unable to make a proper connection.
Maybe one could 'double-over' the free ends to make them a tighter fit, or, solder a thicker pin on to suit ?
Otherwise, seems like the reviewers were happy...Kit is around
Hi Graeme, I recently needed some 5k pot's to repair a radio control system for a model boat.
On the recommendation of a relative (the same one who supplied me with a free oscilloscope), I ordered from Switch Electronics - a British firm. Price was very reasonable at 59p each and delivery took just a few days. Pot action was beautifully smooth too. I expect they will do a full range of resistors etc.
Their website is "switchelectronics.co.uk" and the on-line catalogue seems very comprehensive. I think I may order a full set of resistors for use with the Arduino kit and just use the kit supplied ones as "stock"...
Dave
Just bend the leads over so they lay flat on the copper about 1mm will do. (before soldering!!!!)
I was taught 50 years ago that soldering is for the electrical connection and a mechanical "joint/fixing" should be for holding the component in place. :police:
Not quite applicable to SMT devices but even thy were glued in place in the early days.
Not quite sure I follow your method here Phil. The problem with the Arduino kits is a round resistor lead being retained by a square breadboard hole. So, the 'mechanical' bit is the fit between the gauge of resistor wire with the internal dimensions of the breadboard's hole.
There's no soldering involved just a 'plug-in and play' philosophy...the electrical connections are taken care of by the breadboard's internal bus wiring once you've decided on which particular row-and-column to use for your component(s).
However, I do agree with your general practice that soldered joints should have mechanical support (even if it's just a bit of heat-shrink !
Dave
Given how simple they are, solderless breadboards are remarkably reliable and cope with a fair range of component wire diameter and profiles (IC legs, some push switches etc.)
Inside, they are simply rows of connected pairs of fingers a bit like rows of dolly pegs with the finger tips touching. The component leg slides between a pair of fingers. With use, and particularly extended rough handling with oversized component legs the fingers splay and no longer retain their spring. With care the back cover can be removed, a row of fingers removed and gently squeezed together before reassembling.
... which is a round about way of saying the connections are made in almost exacly the same way as rail joiner/fishplates on model track - except the component is inserted from the top. It can suffer exactly the same sort of problem as settrack does when it is connected and separated many times - and the solution (with careful application of a pair of pliers) is similar.
Quote from: Dave Cooper on September 05, 2019, 22:55
Not quite sure I follow your method here Phil. The problem with the Arduino kits is a round resistor lead being retained by a square breadboard hole. So, the 'mechanical' bit is the fit between the gauge of resistor wire with the internal dimensions of the breadboard's hole.
There's no soldering involved just a 'plug-in and play' philosophy...the electrical connections are taken care of by the breadboard's internal bus wiring once you've decided on which particular row-and-column to use for your component(s).
However, I do agree with your general practice that soldered joints should have mechanical support (even if it's just a bit of heat-shrink !
Dave
Sorry misunderstood your meaning of breadboard.
Thought it was a more generic expression as bread board originaly used to be a real breadboard with brass nails hammered in and then components soldered to!
Then as "technology" progressed we had the breadboard as you describe and veroboard (now called stripboard).
I assumed it was the veroboard type of prototype as we used to refer to breadbording as any type of lash up prior to committing a design to printed circuit board.
Sorry for the confusion
I would agree that fine wire components in bread board can be a problem with the leads buckling as you push them in.
No problem Phil, if you Google Arduino breadboards a good selection will appear. Also, there are some good Youtube videos on circuits under construction...
Graeme is an expert in this area, so, you could 'steer' any technical questions you may have his way.
Regards,
Dave
Many thanks Dave - I think! (... given the disdain with which "experts" appear to be viewed in present times :D )
Anyway as of last Friday I'm officially retired and am now an amateur ;D ;D ;D
Enjoy your retirement Graeme - I can recommend it !
Quote from: Dave Cooper on September 09, 2019, 19:49
Enjoy your retirement Graeme - I can recommend it !
Thanks! I intend to. An oval of Peco 009 Setrack arrived in the post yesterday. Perhaps even an Arduino project? I'm still thinking...
Just got a book for my 72nd birthday "Exploring Arduino". It seems to be based on the "Uno" board but mentions several others with various pro's and con's...
Any suggestions for a beginner like me ? Likely projects would include automatic control of a 'rope-worked' incline on the 009 lines and, a rotating radar scanner on a model RAF Air-Sea Rescue launch (where space is a little tight).
I'm sure other projects will spring to mind as I plough through the book (probably, of a motor /servo control nature).
Regards,
Dave
Many Happy Returns and all that!
As for projects I recommend starting out taking the "solution looking for a problem" approach. It can be quite easy to come up with a control idea that seems achieveable and commit to building the model only to find the software control is harder than expected or does not give as convincing a solution as hoped.
Building up experience by making your own "toobox" of simple contol programs and exercises will help identify the most likely successful approach to solving more complex tasks.
You mention servos. They can be reliable, inexpensive an easy to control with an Arduino. Clearly the performance of cheaper ones is unlikely to match more expensive ones, so writing some code to put them through their paces will suggest applications appropriate to whatever combination of cost and performance they can deliver.
The Uno is a good starting point as it covers most eventualities. If the bug bites there are inexpensive clones from the Far East and Nano is excellent for building into small projects.
Thanks for the advice Graeme. The book recommends 'Uno' for the projects contained therein. After a quick flick through, they seem to build on the experience of previous ones constructed.
As for the code, there seems to be a good set of ready-built libraries /routines to use as a basis for a new project (C, C++ or Java it's hard to tell ?). All this is accessed via the IDE apparently which you download as a first step.
They also recommend "SparkFun" and/or "Newark element14" for components. I think you said in a previous post that SparkFun were good suppliers but I'd not heard of Newark before... :)
I tend to use the UNO for developing projects as it is easy to connect the jumper wires. After I have proven that the idea works, I will use a Nano for installation on the layout as it is cheaper and smaller. You can get a Nano with or without the USB connector. I will always pay a little extra for the USB version as programming can be fiddly through an adapter. The cheap Chinese clones work well for me.
Neil
Quote from: Dave Cooper on September 10, 2019, 10:17
a rotating radar scanner on a model RAF Air-Sea Rescue launch (where space is a little tight).
Have you thought of fitting an N20 geared motor? They come in speeds as low as 10rpm on 3v-6v. I use one to power my turntable, with extra gearing, at 1.5v from a DCC loco chip.
Quote from: Dave Cooper on September 10, 2019, 10:17
Just got a book for my 72nd birthday "Exploring Arduino". It seems to be based on the "Uno" board but mentions several others with various pro's and con's...
Any suggestions for a beginner like me ? Likely projects would include automatic control of a 'rope-worked' incline on the 009 lines and, a rotating radar scanner on a model RAF Air-Sea Rescue launch (where space is a little tight).
I'm sure other projects will spring to mind as I plough through the book (probably, of a motor /servo control nature).
Regards,
Dave
Anything that involves flashing LEDs is fairly easy to start with (welding or fire effects, emergency vehicles etc).
You could then move on to simple servo circuits. I use mine to operate a tipper truck and a workshop car lift.
Motor control can be from a simple MOSFET for single direction control or an H bridge for forward and reverse operation. The ready made modules can work out cheaper than building these circuits.
This is primarily addressed to Steve Lomax who wrote "I have 1 arduino controlling a stepper motor turntable" but I hope it (or his answer!) is of interest to all.
Steve - I also want to run a turntable with an Arduino and I am also working on a (non-scenic) train lift that will be run with an Arudino - both using stepper motors. I have been sold an A4988 driver and a Rev 3 Motor Shield but I'm confused because I've found some advice on using just one, some on using just the other, and some on using both. What are the reasons for these three permutations and what did you do?
Hi Tom;
Stepper motor windings come in 2 flavours, Bipolar (4 wires) and Unipolar (5 wires).
I use this motor
https://www.ebay.co.uk/itm/ULN2003-Stepper-Motor-Driver-Module-for-Arduino-DC-5V-Stepper-Motor-28BYJ-48/163874356420?hash=item2627ac3cc4:m:mi1fs91xBFn6GrL540-Bo5w (https://www.ebay.co.uk/itm/ULN2003-Stepper-Motor-Driver-Module-for-Arduino-DC-5V-Stepper-Motor-28BYJ-48/163874356420?hash=item2627ac3cc4:m:mi1fs91xBFn6GrL540-Bo5w)
It's a 5 wire Unipolar which works with the arduino examples and is very cheap and massively geared down.
The driver board chip just contains 7 darlington transistors; 4 of which are used to boost the microcontroller output current. The Bipolar nature means that it's just a matter of switching the coils in the motor on and off and this is handled by the Arduino stepper motor library. The driver you have is for a Unipolar stepper motor where the coil voltage needs to be switched on, off AND reversed. Arduino cannot reverse directly so the driver is needed. The arduino will talk to the driver, I'm sure it will work - but I've never used one in a project. If you are new to this I find the best way is to open up the Arduino program on PC, plug in the Arduino to USB and get them talking. There's loads of tutorials on youtube to do this. Then load an example file from the library and get the moto just doing something on that example. Then edit the code little by little to get it to do what you want. Take a look at this:
https://www.youtube.com/watch?v=GgfgWU0bpHk (https://www.youtube.com/watch?v=GgfgWU0bpHk)
As I recall, the output wiring order is not as one would expect. (1 to 1, 2 to 2, etc) I seem to recall 2 and 3 need swapping. I can't remember, use trial and error.
The rev3 Motor Shield can also be used to drive a stepper, but I don't think you will need both drivers. The 'rev3' Arduino is the up to date revision (as of Dec 2019). I would try the A4988 first.
As far as stepper motor turntable, here are some issues I discovered.
A stepper motor does not 'know' where it is (unlike a servo) . Some means of 'homing' the motor is required each time it is powered on. This could be a physical stop pin which forces the motor to stall or skip for a revolution and then it can start counting steps from that position. A microswitch could be used that switches when the turntable is in the home (0) position. The stop or switch position does not need to be anywhere in particular - as long as it is a known and repeatable start position. The gearing on the above stepper motor has some slop in it. I always set my turntable positions to end in a clockwise movement.
It's really hard to get tracks to line up exactly, especially it the turntable is on a bend or slope.
I made some mistakes:
I had track bends too close to the turntable. Next time I will ensure that all ray exits are on straight track.
I thought it wouldn't matter if the turntable track bed gauge was 0.4mm too narrow. It does.
It is important to get smooth rotation and smooth electrical contact transition. It is easy for a brief jamb to cause motor step skips.
I relied on the contact springs against adjustment screws to get the track bed level. This doesn't work. Use a smooth float running surface.
Incidentally , you have everything you need to make a DCC system if you want to experiment with JMRI software. ( search DCC++ and JMRI).
If you have any problems I would be delighted to help if I can.
Steve
Neil
There are many variants of Arduino:
Arduino "Uno" is the original from which all others are based or influenced. It has a removable chip and a USB connector for talking to PCs. It has experimental header sockets for wire jumpers and for a multitude of "shields" that add ancillary components and connectivity to a UNO in a 'Lego' style simple building brick system.
"Genuino" is a EU trade name that went horribly wrong but it's identical to Arduino in every way
"Arduino" is open source. Anyone is allowed to make and sell them and there are loads of other manufacturers (mostly Chinese) that make their own direct copies and variants.
There are a few commonly used Arduino variants: "MEGA256" is a larger version with more power ports, memory etc, "Nano" is a miniaturized version also with USB connectivity "Pro Mini" is a postage stamp sized version but needs a seperate USB - serial module (eg FTDI) to talk to a PC. I use these all the time and can be picked up for less than £2 each. Most Arduino variants are 5V, some are 3.3V. The ESP32 or ESP8266, behave as Arduinos but also have wifi connectivity. (this is an example of the IOT or 'Internet of things' you may have heard about). Although it is a few pence more expensive I recommend always sticking with the '5v mega328P 16Mhz' version and not the 'mega168 8Mhz' unless there is a reason for doing so. Arduino is not the best microcontroller, but it is the most well documented and supported. I have used PIC and found it to be more powerful but Arduino is far more user friendly for beginners; and the onset of ESP devices will probably be a game changer in coming years anyhow. 'Adafruit' is a USA manufacturer (Lady ADA) that offers lots of support, however, many of her products are 'improved' variants which sometimes require specific Adafruit library support and most of her products are slightly more expensive than others. DF Robot (China) have their own range too. Most are generic unbranded. Of course, buying genuine Arduino helps to keep the parent company alive. There is a thriving Arduino support community at https://forum.arduino.cc/ (https://forum.arduino.cc/)
I agree with
Quote from: Steve Lomax on December 10, 2019, 15:32
I have used PIC and found it to be more powerful but Arduino is far more user friendly for beginners
I agree about PIC being more powerful, and they are still my favourite range to work with, but for my purposes the hardware support has not been as comprehensive as arduino and can work out quite a bit more expensive unless you are prepared to roll you own.
For people starting out I still recommend Arduino as they at least know they are starting with working hardware and there is loads of support for beginners.
I use arduinos where buying a cheap shield can save me time, but if that isn't an issue until a few years ago I would have used PIC, but now I want to get into low power Raspberry Pis (under £10 + £5 for USB development pod) and just need a decent project to force me to learn :)
(https://cdn.shopify.com/s/files/1/0174/1800/products/Raspberry_Pi_Zero_W_2_of_6_1024x1024.JPG)
I'd qualify that by saying some PICs are more powerful than some Arduinos. There are 8, 16 and 32-bit PICs and Arduinos using 8-bit and 32-bit processors.
It is a bit of a skewed comparison in that PIC is the name of the microcontrollers manufactured by the semiconductor company Microchip and Arduino is a combination of a software development system, microcontroller circuit board format and standard for input and output hardware or "Shields". A more direct comparison would be between Arduino, PICaxe, OOPIC, BASICstamp and so on and Arduino is almost certainly the most popular one now. There was at one time even an Arduino look-alike (Pinguino) that used a PIC microcontroller.
I think the Arduino is the best option for a beginner too. The software is quite easy to install and get a simple program up and running. The online manual, references and examples are pretty easy to navigate and there are a wide range of beginner kits and add-on input-output "Shields" available. There a plenty of example Sketches in the Arduino software to try out different facilities and the online language reference generally has good beginner's examples (e.g. "how does an if() statement work" - including help on common "gotchas" that often trip up beginners.) There is a lot of YouTube video "walk through" examples too (from excellent to dreadful).
A very big plus for Arduinos is for experimenting and "rapid prototyping" of projects. In many cases ideas can be developed on the "standard" Uno version and protoboard components and then rebuilt on a smaller and less expensive Nano, Nano clone, or similar, on stripboard. Likewise, if the Uno turns out not to have enough capability the software can be loaded onto a bigger version.
Quote[ but now I want to get into low power Raspberry Pis (under £10 + £5 for USB development pod) and just need a decent project to force me to learn :)/quote]
I bumped into someone who was running a DCC layout using a raspberry pi and JMRI (Java). I would love to hear what you end up working on. It's one of those fantastically powerful bits of kit which at first glance seems the best thing since sliced bread but I found it hard to find an application (other than video) that, as a beginner I think I could not achieve on the platform I already use. - I suppose its a case of 'you don't know what you don't know' :)
Quote from: Steve Lomax on December 11, 2019, 11:16
Quote[ but now I want to get into low power Raspberry Pis (under £10 + £5 for USB development pod) and just need a decent project to force me to learn :)/quote]
I bumped into someone who was running a DCC layout using a raspberry pi and JMRI (Java). I would love to hear what you end up working on. It's one of those fantastically powerful bits of kit which at first glance seems the best thing since sliced bread but I found it hard to find an application (other than video) that, as a beginner I think I could not achieve on the platform I already use. - I suppose its a case of 'you don't know what you don't know' :)
SPROG is well established in this respect https://www.sprog-dcc.co.uk/ (https://www.sprog-dcc.co.uk/) I have a very old version and I'm tempted by the Raspberry Pi variant, but must avoid going off down another side alley!
(https://www.sprog-dcc.co.uk/image/cache/catalog/pisprogone_mounted_200-228x228.gif)
Quote from: Steve Lomax on December 11, 2019, 11:16
I would love to hear what you end up working on.
So far just a camera trap :-)
(https://live.staticflickr.com/65535/49204378162_c777be84d0_n.jpg)
Thanks Steve, that was very helpful. And the video you linked is a lot clearer than many. By the way I do use JMRI and will be integrating. As I understand it, one day I will be 'throwing' 'point number 2xx' etc. to move my turntable.
Just in case anyone is looking for an Arduino "Starter Kit", I have been doing a bit of research :
Sparkfun - do a kit for about £80 but seems permanently 'out-of stock'. It's recommended in the book I have "Exploring Arduino" by Jeremy Blum.
Newark element14 - mentioned in the book as a recommended supplier. I just could not make sense of their website's ordering system. (especially for Edition 1 of the book).
Farnell - last time I looked said there was no 'European' ordering /shipping available.
I finally settled on "Elegoo" who do a very comprehensive kit for £29.99. Amazon will supply (which I thought made it easier for Xmas present buyers!).
There seems to be 2 different editions of Jeremy's book and, if you want to follow the book's build sequence, I think it would be best to get a kit for that edition. (some kits include the book as well).
You could, of course, just order up all the items separately from someone such as RS Components. The Elegoo kit comes with a CD giving code samples and it's own project list and seems to have everything included to get you quite deep into Arduino land...
I'll let you know how I get on with the kit (assuming Santa is on-track with this) probably in the new year now.
Dave
I got one of these elegoo starter kits last week, I consider it good value. I also went on ebay and for the princely sum of £4.89 purchased another Uno clone. (I have a specific project in mind, so one is a dedicated unit whilst the second is for experimenting, aka playing)
I would advise raw beginners to thoroughly understand and modify the Blink lesson before moving on.
For UK sources, hobby robot shops might be worth looking at. Many will use the same general components and it is often down to how good the book/booklet with it is.
https://www.robotshop.com/uk/arduino-kits.html (https://www.robotshop.com/uk/arduino-kits.html)
https://coolcomponents.co.uk/collections/arduino/arduino-kits?grid_list=grid-view (https://coolcomponents.co.uk/collections/arduino/arduino-kits?grid_list=grid-view)
There is a fair chance that a booklet will be there to "fill out" the kit contents and it is worth considering a book if gleaning stuff from online does not appeal. The ".... for Dummies" series of books are generally pretty good as the publishers do seem to go for authors well up in their respective fields.
https://www.amazon.co.uk/Arduino-Dummies-Computer-Tech/dp/1119489547/ref=sr_1_3?keywords=arduino&qid=1576279350&s=books&sr=1-3 (https://www.amazon.co.uk/Arduino-Dummies-Computer-Tech/dp/1119489547/ref=sr_1_3?keywords=arduino&qid=1576279350&s=books&sr=1-3)
A look at the contents page and index does suggest it is comprehensive.
The Elegoo kits are pretty good. I had two as presents a few years ago, and although you could buy the bits separately you wouldn't save a lot and it would be a lot of faff.
Their sensor kits are pretty good value too, although they do not come on shields so it takes longer to set them up, but still a good way to learn.
I normally just buy Chinese clones from eBay for a few quid, but note they don't normally come with the correct USB lead or a power supply, unless you specifically buy a kit. So far I have only had one not work, and they just sent me a new one so no big loss really. Having said that I tend to use "official" ones for important projects.
Does anyone know if the Arduino (and associated) chips are sensitive to static ?
I remember years ago having to wear a wrist-strap wired to a bench whilst working on Motorola 68xxx disk controllers...I understand that 'modern' chips are not so sensitive - just wondering.
Dave
Quote from: Dave Cooper on December 14, 2019, 14:20
Does anyone know if the Arduino (and associated) chips are sensitive to static ?
I remember years ago having to wear a wrist-strap wired to a bench whilst working on Motorola 68xxx disk controllers...I understand that 'modern' chips are not so sensitive - just wondering.
Dave
Always a good idea to wear a grounding wrist strap when working with any IC.
They are pretty robust. That is not to say that someone living in a very dry location there may be problems.
If someone is plagued by static discharge, they should probably be rather more concerned about the computer the Arduino is connected to as it will be a lot more expensive to replace.
I've got one on the kitchen table beside me and have been playing with a tiny OLED display that I hope to use to display text from a wireless keyboard on.