My Free Book: (updated) Getting Started With Arduino Programming

I noticed there is a lot of people have a lot of interest in Arduino in automating and controlling their layout. I taught multiple classes on this over the years and ended up writing my own free book. Hopefully it will be of use to some of you.

It’s very step by step with photos and covers most aspects of programming and controlling Arduino boards. If you have any questions, please feel free to write me.

Chapter 1: what is arduino?

https://docs.google.com/document/d/1B4J3W5YNGknMACiwGy09IYAA1AthaOhrFR8NBHwgbGk/edit?usp=sharing

chapter 2
https://docs.google.com/document/d/1CeyqSjzJf-7Y7l8c7xeUil_rQ9xUZqcudJG7DCYzoSA/edit?usp=sharing

Appendix A: basic electronics

https://docs.google.com/document/d/14VHMT5pRuD8Nq42TJhyGsgo3aOZCekYddbOjoCTvyiI/edit?usp=sharing

Thanks very much for posting this to the community!

Coincidentally I just started working yesterday on understanding how to program Arduino nanos. This is all brand new to me.

My goal is to use Arduinos for lighting of buildings and lamposts as well as running servos for some animation on the layout.

Another use I see is to use with sensors for railroad crossings.

Looking forward to reading your book! [:D]

Thanks again!

charles

Thank you Don, you’re not only a good instructor but you did a bang up job putting your book together!!!

Much better than the $15 Arduino book for sure.

Mel

My Model Railroad

Bakersfield, California

Turned 84 in July, aging is definitely not for wimps.

Mel, tried to start a message to you.

can not seem to make that happen?

woodone. AKA Jerry

Jerry

If you sent me an email I haven’t received it.

Mel

My Model Railroad
http://melvineperry.blogspot.com/

Bakersfield, California

Turned 84 in July, aging is definitely not for wimps.

Yes–I did send you one- about 4 PM

I used my I-Pad to do that -shows sent?

I get another out, well I will just copy it and resend it-thanks for keeping me up to date

Nothing
Try my blog email

Mel

My Model Railroad
http://melvineperry.blogspot.com/

Bakersfield, California

Turned 84 in July, aging is definitely not for wimps.

Hi Don,

You deserve a great deal of praise for writing your book! I have tried to get into using Arduino several times but I gave up, perhaps too easily. I have only read the first 20 pages so far, but the important thing is that I think I understand what you are saying! That’s quite an accomplishment on your part. You have motivated me to take another stab at it.

Thanks!!

Dave

the Arduino Forum is available to answer programming questions and provides a wealth of examples

Greg, why not start ginning up a counterpart for ESP32 (and C/MRI)? Community needs one.

Not to beat a dead horse, but I updated the links above.

There’s an intro chapter:

  1. what arduino is,
  2. accessories available for arduino (like servo and stepper motor control)

Appendix for basic electronics showing you some elementry circuits and how to use things like volt meters, voltage dividers diodes, LEDs, etc…

There’s only 3 things you need to know with arduino to master it:

  1. Know if you want to read something (sensor, another arduino device) or control something (ie: Relay, servo, dc motor, stepper motor) and how to set up the pins to do that.
  2. Know the pins are very low current and only operate at 5V/3.3V max. You’ll need to learn how to use transistors/relays/step-up,step-down circuits, logic level shift circuits, or voltage dividers. (All very simple)
  3. A little basic programming and what shield board packages are available (ir detectors, photo voltiac detectors, servo controllers, stepper motor controllers, and DC motor PWM controllers

I could start a series showing how to create IR or current detection to detect a train. Then how to use that information to create working aspect heads or servos for aspect flags/RR Gate Crossings. I could also show how button presses could be used to animate a layout, or even play sound.

Rubbing my hands in anticipation…

I have a Elegoo for UNO starter kit and I am wondering of you know how much difference there is between this and the Arduino?

Thanks

Judging from the Elegoo items and pictures on Amazon this appears to be identical to the “Arduino” brand. A number of companies have made their own clones of the Arduino boards. I don’t know if it is a license agreement or the Arduinos are in the public domain.

The main chip is a genuine atmel. The PCB design is licensed under creative commons and is available on the arduino website, meaning anyone can make one of these. If you burn out the main atmel chip on the uno, you can buy them in bulk < $5 each

Thanks for that reply.

I’m very late to this thread… Don, nice work on the first two chapters and the Appendix! Will you be preparing any chapters on how to operate servos with arduino? It would be nice chapter to encourage adoption of servos. Easy to find links to setting up servos but very little on sketches to operate the turnouts. If I may, I’d suggest a chapter for layout with just 8 turnouts using a Uno + sensor shield.&n

I also started my projects using the Elegoo starter kit. I believe they are almost exactly the same, but the Elegoo has a few more items, and it costs a lot less.

I did use the Uno for mapping out projects and testing them, but I bought a bunch of Nanos for very little money. They work the same as Unos, but cost less.

I’m still just a novice, but I really like my crossing signals I made that are controlled by nanos.

At age 70 with no computer background, I was at first reluctant to do this. But I actually enjoyed learning the basics.

John, great comment on using nanos. One can find great deals on nanos using screw terminals for those who prefer not to solder. I used a uno with sensor shield, very easy for beginners to set up servos with sensor shield. So many options!