Page 2 of 7

Fun with Arduino 03 Connect an External LED and resistor

Posted: Sun Jan 06, 2019 10:41 am
by RudyB
The third video is online.

To control the on board LED is fun, but the real fun only starts when we can control external LEDs, like on a switch panel, or on a model railway layout. This video is about how to connect a LED and how to choose the value of the series resister we need to set the LED brightness.

In the next video we are going to control the external LED and we will simulate a night cycle on a model layout.

Link to Fun with Arduino 03 External LED and Resistor

Image

Fun with Arduino 04 Readable & Maintainable Code

Posted: Sat Jan 12, 2019 10:02 am
by RudyB
The goals in this video are:
  • To make our code better readable and easier to maintain.
  • We imagine pin 8 operates 20 street lights on a model railway layout. They switch on when we press the button. To simulate a night cycle we want them to stay on for 3 minutes and then automatically switch off again.

Link to Fun with Arduino 04 Readable & Maintainable Code , #define, delay()


Image

Fun with Arduino 05 Connect More LEDs with Relay or FET

Posted: Sun Jan 13, 2019 12:45 pm
by RudyB
Arduino outputs can only switch 20mA. If we want to control groups of multuple lights on our model railway layout, we will need some more 'oompf'. A 12V power supply will do great and we can use Relay or FET modules, controlled by the Arduino, to swicth the higher current / voltage. How to do this, how to wire this, is the subject of this video and article.

Link to Fun with Arduino 05 Connect multiple LEDs with a Relay or a FET


Image

Re: Fun with Arduino - a Series of Introductory Videos

Posted: Mon Jan 14, 2019 11:34 am
by paul1066
Many thanks for this, I will be watching these with interest!

Re: Fun with Arduino - a Series of Introductory Videos

Posted: Tue Jan 15, 2019 1:57 pm
by Tricky Dicky
I like your style Rudy and I am looking forward to more videos. When you have finished with Arduino can I put in a request for a series on the Raspberry Pi, pretty please :mrgreen:

Richard

Fun with Arduino 06 Automatic Day & Night Cycle with on/off Switch and LED

Posted: Thu Jan 17, 2019 12:46 pm
by RudyB
In this 6th video we are going to create a fully automatic day & night sequence, witch a toggle switch and an indicator LED on our switch panel. The day & night times are going to be configurable in seconds, which means we need some math to go to milliseconds.

Link to Fun with Arduino 06 Automatic Day & Night Cycle with on/off Switch


Image

Fun with Arduino 07 Day & Night Cycle, Multiple Light Groups, Random Times

Posted: Sun Jan 20, 2019 11:24 am
by RudyB
Our day / night module of the previous video works perfect, but it controls just one light group. On our layout we probably have multiple groups ... houses, street lights, a railway station or an industry area. In this video we're going to see how we can control multiple light groups in a day / night cycle, while of course they do not switch all at the same time and also while making it non predictable.

Link to Fun with Arduino 07 Day & Night Cycle, Multiple Light Groups, Random Times


Image

Re: Fun with Arduino - a Series of Introductory Videos

Posted: Sun Jan 20, 2019 9:12 pm
by Paul-H
Hi

A quick question I hope

I have a sketch written for the Arduino Mega that operates servo motors for use with turnouts.

I would like to try it on a UNO, how easy is it to get the sketch to load and work on the UNO.

Sorry to hijack the thread

Paul

Re: Fun with Arduino - a Series of Introductory Videos

Posted: Sun Jan 20, 2019 11:11 pm
by RudyB
Paul, usually there are no major differences in the code as such, but the UNO has less I/O pins ... you'll have to carefully scan your code and change 'out of range' pin numbers into numbers that are in range for an UNO.

Fun with Arduino 08 User Interface Serial.print()

Posted: Thu Jan 24, 2019 3:39 pm
by RudyB
Our way of modifying the day / night cycle time seemed quite handy, but we do need to modify the code and upload it again every time we like to change the cycle time. Is there maybe an easier way?

Yes there is ... we can change the cycle time 'on the fly' via a User Interface. There are different solutions, with hardware otr with software. We're going to try them both. In this video we'll do the first preparations, writing text and numbers to the PC screen via Serial.print().

Link to Fun with Arduino 08 User Interface Serial.print()


Image