Author Topic: Question for those with Arduino experience.  (Read 1970 times)

0 Members and 1 Guest are viewing this topic.

narrowminded

  • Crew
  • *
  • Posts: 2305
  • Respect: +743
Question for those with Arduino experience.
« on: November 30, 2019, 01:41:24 AM »
0
I'm considering getting an Arduino Uno to toy with as it seems like it could be very useful piece to know about to drive steppers and to automate some basic train functions.  I have zero experience with these but they tout the open source and ease of use which sounds like it's just the ticket for me. ;)

So when I go to look at some I find "Uno" at prices all over the place yet all claiming to be Uno's.  Closer inspection says they're not, at least not physically, and that leads to the question.  Is there any reason to stay with the original Arduino Uno or are the variants truly the same in function and with reasonable reliability? :|
Mark G.

rodsup9000

  • Crew
  • *
  • Posts: 991
  • Gender: Male
  • Respect: +644
Re: Question for those with Arduino experience.
« Reply #1 on: November 30, 2019, 11:17:36 AM »
+1
 I've been using the cheapest Uno's and Mega's I can find and haven't had any problems with them. I have 7 mega's and 2 Uno's on the layout controlling turnouts. Using the cheap boards on the 5 FDM printers and 2 CNC routers.
Rodney

My Feather River Canyon in N-scale
http://www.therailwire.net/forum/index.php?topic=31585.0

narrowminded

  • Crew
  • *
  • Posts: 2305
  • Respect: +743
Re: Question for those with Arduino experience.
« Reply #2 on: November 30, 2019, 12:54:46 PM »
0
Thanks @rodsup9000  8)

That's exactly the kind of feedback I was looking for!  You wouldn't have any pictures of some of your installations or basic descriptions of any additional components, downloads, breakout boards, or the like I might need?  I'm not looking for the complete nitty gritty but a simple summary that might help to aim me in the right direction for things I'll need to search and study.  I suspect I'll be fine but at this point I have NO experience so don't even know what I don't know.  8)

The uses I'm envisioning right now are both miniature servo control for switches and the like, stepper motors for speed synchronizing a stepper with a rotating shaft (not directly model related), and controlling a couple of turnouts and track voltage to automate the running of two locos or trolleys, parking one on a passing siding, running the second unit , then parking it and reverting back to the first in a continuous loop. 

I also saw some relatively inexpensive variety kits ($10-$20?) with all sorts of modules for beginners to demonstrate the function capabilities of the arduino.  Does that seem like something worthwhile? :| 

REALLY, don't invest too much time but if there's any experience related things/ warnings that you can readily convey that would be GREAT!
Mark G.

rodsup9000

  • Crew
  • *
  • Posts: 991
  • Gender: Male
  • Respect: +644
Re: Question for those with Arduino experience.
« Reply #3 on: November 30, 2019, 10:37:20 PM »
+1
 Mark,

 The Arduino sketches (codes that the arduino uses) that I used for the CNC router and printers were copied and pasted from published plans. The sketches I use for the servos that throw my turnouts was a modified from a sketch I found on the Arduino forum.
 I've done very little of writing any codes myself. What little coding I've done was at one of the Arduino classes I took at last years NMRA convention that was here in KC.

 If you have any experience in writing code, you should be able to understand and write Arduino sketches easily.

 I did buy a couple of the Arduino "experimenter" kits just to play with and learned a little. They are great to have around just to have some of the parts they have for various thing to try.
 
  This is the servo shield I use for Uno's and there is one that fits a mega, also

https://www.ebay.com/itm/Sensor-Shield-V5-0-Sensor-Expansion-Board-for-Arduino-UNO-MEGA-servo-motor-USA/222167190417?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

  I mounted servo a couple of different ways. 4 or 5 years ago when I first started using them, I drew up and printed a mount that works like a tortoise. I made these so that I could mount a limit switch on them, one to control the power to the frog. I did make it possible to mount a second limit switch on them, but have never need to yet.

 






 




 I really didn't like them all that well, so I designed and printed a new mount and it uses a bellcrank.











  What the top side look like












  I use one side of a DPDT switch to control the servo and the the other side of the switch is used for indication on the control panel.











 
Rodney

My Feather River Canyon in N-scale
http://www.therailwire.net/forum/index.php?topic=31585.0

narrowminded

  • Crew
  • *
  • Posts: 2305
  • Respect: +743
Re: Question for those with Arduino experience.
« Reply #4 on: December 01, 2019, 03:17:28 AM »
0
  This is the servo shield I use for Uno's and there is one that fits a mega, also

https://www.ebay.com/itm/Sensor-Shield-V5-0-Sensor-Expansion-Board-for-Arduino-UNO-MEGA-servo-motor-USA/222167190417?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649


Thanks again, Rod. :)

Am I understanding correctly that the basic unit could be used to run a servo properly but that this board adds capacity for more servos being operated from one UNO?
Mark G.

rodsup9000

  • Crew
  • *
  • Posts: 991
  • Gender: Male
  • Respect: +644
Re: Question for those with Arduino experience.
« Reply #5 on: December 01, 2019, 11:43:21 AM »
+1


Am I understanding correctly that the basic unit could be used to run a servo properly but that this board adds capacity for more servos being operated from one UNO?

 A Uno can operate up to 8 servos and the mega will do up to 22 servos. You can even use them in a matrix for yard throats.


 Here is the mega's I have on each end of my staging yard.  (I just noticed that these pics don't have the inputs plugged into them)












 And this the the control panel for the staging. I use relay boards to power the LEDs, so I can use the green/red bicolor LEDs.  On my Oroville yard, I don't use the relays and just use green LEDs.  I can go more in depth on the matrix if anybody wants it.















 The down side of using servos,

The servos must be within about 6 feet of the control board (Arduino or Tam Valley's Octpus II)
With the Arduino, the servos operate fast. The Octpus is slow like the tortoise. (there is a way to program the servo to run slower, but I haven't done enough code writing to figure it out yet)

 The up side
 
Cost
Size
Availability

 Even when using the Octpus II, the cost per turnout is a lot lower than the tortoise.



 I've never tried it, but the Uno will control up to 4 steppers and the Mega will do up to 10. To use steppers, you'll need a stepper driver board like these

https://www.ebay.com/itm/A4988-Stepper-Motor-Driver-Board-Module/302693523371?hash=item4679f09fab:g:pzEAAOSwMhVcBKAF


 You could use a CNC sheild, but if and when I ever get that far, I'll just use pin headers and plug them directly to the Arduino.

 
Rodney

My Feather River Canyon in N-scale
http://www.therailwire.net/forum/index.php?topic=31585.0

peteski

  • Crew
  • *
  • Posts: 31839
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +4613
    • Coming (not so) soon...
Re: Question for those with Arduino experience.
« Reply #6 on: December 01, 2019, 12:53:42 PM »
0
Rod, why not drive the LEDs directly from the Arduino/Uno instead of using old-fashion relays?
. . . 42 . . .

rodsup9000

  • Crew
  • *
  • Posts: 991
  • Gender: Male
  • Respect: +644
Re: Question for those with Arduino experience.
« Reply #7 on: December 01, 2019, 01:21:07 PM »
0
Rod, why not drive the LEDs directly from the Arduino/Uno instead of using old-fashion relays?

 Pete,
 It could, but I'm still learning how to write the code to do that.  Once that I have the code figured out, the relays will be used to power the track so that the tracks will be dead unless it is a lined. Another is that each LED will use 2 pins of the Arduino, Dropping the max number of servos each board can use by half. I use a few relay board like these around the layout. They're cheap and easy to to use.


https://www.ebay.com/itm/USA-5V-12V-1-2-4-8-16-Channel-Relay-Module-Arduino-Raspberry-PI-ARM-AVR-DSP-PIC/401528275302?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
Rodney

My Feather River Canyon in N-scale
http://www.therailwire.net/forum/index.php?topic=31585.0

peteski

  • Crew
  • *
  • Posts: 31839
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +4613
    • Coming (not so) soon...
Re: Question for those with Arduino experience.
« Reply #8 on: December 01, 2019, 01:29:44 PM »
0
Pete,
 It could, but I'm still learning how to write the code to do that.  Once that I have the code figured out, the relays will be used to power the track so that the tracks will be dead unless it is a lined. Another is that each LED will use 2 pins of the Arduino, Dropping the max number of servos each board can use by half. I use a few relay board like these around the layout. They're cheap and easy to to use.


https://www.ebay.com/itm/USA-5V-12V-1-2-4-8-16-Channel-Relay-Module-Arduino-Raspberry-PI-ARM-AVR-DSP-PIC/401528275302?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

Thanks Rod.
It just seemed counter-intuitive to me to use a microcontroller to control mechanical relays, to drive low-power LEDs.  But your explanation makes sense.
. . . 42 . . .

narrowminded

  • Crew
  • *
  • Posts: 2305
  • Respect: +743
Re: Question for those with Arduino experience.
« Reply #9 on: December 01, 2019, 03:03:21 PM »
0
Thanks, Rod.  This is very helpful. 8)  Just the mention of things like the six foot distance issue already puts that potential problem in my head and will trigger the need to check out some things should distance surface as a need.  :)

I'll be interested in various uses so it seems like it would be a good idea to get an experimenter kit with a good variety of modules so I can become familiar with the concept and capabilities.
« Last Edit: December 01, 2019, 03:10:58 PM by narrowminded »
Mark G.



Chinapig

  • Crew
  • *
  • Posts: 100
  • Respect: +28
Re: Question for those with Arduino experience.
« Reply #12 on: December 01, 2019, 04:12:32 PM »
+1
For those that don't want to get involved with Arduino sketches, the stuff this guy does under the name of ArCoMoRa is worth looking at.  I've used all of his programs and they allow you configure the Arduinos to do most railway related things through screen led menus.  I order the parts from him as well, but have in the past built my own DCC/Arduino interfaces and just used his free downloadable programs.

https://www.arcomora.com/

This other fellow has a blog and has done some write-ups on the use of these kits.  Well worth looking at if you want to use Arduinos and don't want to get involved in all of the detail.

https://rudysmodelrailway.wordpress.com/2019/07/08/arduino-ddc-servo-accessory-decoder-fully-configurable-via-usb-part-1/

Ted
« Last Edit: December 01, 2019, 04:14:36 PM by Chinapig »
Ted

Member of Gosport Model Railroad Club, England: www.gosportrailroadgroup.org.uk
modeling oNeTrak modules.

rodsup9000

  • Crew
  • *
  • Posts: 991
  • Gender: Male
  • Respect: +644
Re: Question for those with Arduino experience.
« Reply #13 on: December 02, 2019, 01:40:40 PM »
+1
Just the mention of things like the six foot distance issue already puts that potential problem in my head and will trigger the need to check out some things should distance surface as a need.


 I do have one servo that is almost 10 feet from the Arduino and it works. To do this, I'm using 18 gauge wire on the signal wire.
 The wire that goes to the pin to activate the servo, can be up to 15 feet away. 





And here's another lower priced that also includes a stepper motor, something I'd be interested in.  Maybe just as useful getting started.  Both kits have very good reviews.

https://www.ebay.com/itm/Adeept-Ultimate-Starter-learning-Kit-for-Arduino-UNO-R3-LCD1602-Servo-processing/231677301840?_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D40719%26meid%3D651a0bc11e3c4b998353e29c2c8f4e5d%26pid%3D100675%26rk%3D3%26rkt%3D15%26mehot%3Dpp%26sd%3D392237846657%26itm%3D231677301840%26pmt%3D1%26noa%3D1%26pg%3D2380057&_trksid=p2380057.c100675.m4236&_trkparms=pageci%3A4e3473d8-1479-11ea-9b1e-74dbd18008fb%7Cparentrq%3Ac327980c16e0abc031ce2dd5ffd42555%7Ciid%3A1



  Of the two you've listed, this has more stuff that would be model railroad related.
If your like me, you already have a lot of the stuff included in the other kit just laying around, just not soldered on a board.

 If you don't already have a 5 volt power supply, you should get one. The Arduino and most of the stuff associated with them use 5 volts.
« Last Edit: December 02, 2019, 02:08:37 PM by rodsup9000 »
Rodney

My Feather River Canyon in N-scale
http://www.therailwire.net/forum/index.php?topic=31585.0

narrowminded

  • Crew
  • *
  • Posts: 2305
  • Respect: +743
Re: Question for those with Arduino experience.
« Reply #14 on: December 02, 2019, 09:16:48 PM »
0

Of the two you've listed, this has more stuff that would be model railroad related.


That was my thinking, too. 8)  But then again, maybe I should get a fuller picture of what the capabilities are. :| :)  I'll make a -15% offer on that first one and if they take it I'll probably do it.  I already have 10 of the SG-90 servos but I do want to try out some steppers.  To that end, I found another set of geared stepper motors and Arduino drivers that I think might be perfect for a mine cart/ loco turntable application I have in mind so might do that.  Combined with the first set that will give me a lot of options.  We'll see what happens with an offer and go from there.

The type of turntable style I'm thinking of is similar to this new industrial table.
Mark G.