Search found 191 matches

by RudyB
Mon Feb 25, 2019 9:42 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 17 Railway Crossing, State Transition Diagram, switch()

We're at the start of a new Arduino project: an automatic railway crossing. The system comprises several parts: train detection (optical), blinking lights ('blink' with a twist), a moving beam (servo motor). We'll look into a way of specifying these kinds of systems as well as a way to translate the...
by RudyB
Thu Feb 21, 2019 11:09 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 16 LED Dimming with Fade, analogWrite(), millis()

Now that we know how to dim LEDs with analoWrite(), we can go a step further and change the dimming over time to create a gradual fade in or out. This is a nice effect for instance for LED strips mounted under kitchen cabinets, or for LED strip overhead lighting on a model railway layout to simulate...
by RudyB
Sun Feb 17, 2019 9:56 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 15 LED Dimmer, analogWrite(), Pulse Width Modulation

We used analogRead() to read the voltage on our potentiometer. The Arduino also has the opposite instruction: analogWrite(). This name is somewhat misleading. Unlike with an analog input, where a 10 bit A/D converter is used, the Arduino does not have a D/A converter on board. The analogWrite() func...
by RudyB
Thu Feb 14, 2019 9:49 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 14 Day Night Cycle with millis(), no Delay, Direct Feedback

Now that we know how to get rid of the delay(0 and use millis() in stead (video 13) we can finalize our Automatic Day Night Light Cycle unit to have direct on screen feedback of cycle time adjustment by the user and to have the cycle stop, and the lights turn off, immediately when the switch is set ...
by RudyB
Sun Feb 10, 2019 9:36 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 13 Timer with millis(), no delay(), Multitasking

The delay() statement that we used so far for our timing stalls the Arduino. This leads to a complete lack of feedback when we change the cycle time while the cycle is running. Luckily there is a solution: we can use the Arduino internal clock, which counts milliseconds from the moment the Arduino i...
by RudyB
Thu Feb 07, 2019 10:40 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 12 Analog Input, analogRead(), Change Range, map()

Now that we can change the cycle time via the PC keyboard, let's have a look at a hardware oriented solution ... a rotating knob. We connect a potentiometer to an analog input and read the voltage with the analogRead() instruction. With the map() instruction we can convert the range from 0-1023 to t...
by RudyB
Sun Feb 03, 2019 8:46 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 11 Keyboard Input via Serial Read and ParseInt

The User Interface works, it shows the status if the day / night cycle on screen. We're now going to add the option to change the cycle time via the keyboard. The functions we are going to use are Serial.available(), which tells us that there is new input, and Serial.read() or Serial.parseInt() to r...
by RudyB
Thu Jan 31, 2019 2:14 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 10 Show Cycle Status and Time with Serial.print

Now that we have our code working, by using the correct data type or by typecasting, we can continue the work on our User interface. The goal in this video is to display the status of our day / night cycle on screen ... is it switched on or off, is it day or night, and what is the currently used day...
by RudyB
Sun Jan 27, 2019 10:06 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 09 Variables byte int long unsigned

Before we continue to work on our User Interface, let's first take a moment to have a closer look at variables and data types. We are going to use ever more variables in the coming videos ... and ... we'll have a look at a pitfall concerning data types that prevented our code from previous video 8 t...
by RudyB
Thu Jan 24, 2019 3:38 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 08 User Interface Serial.print()

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 so...
by RudyB
Sun Jan 20, 2019 11:22 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

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

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 / nigh...
by RudyB
Thu Jan 17, 2019 12:45 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

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

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 Automat...
by RudyB
Sun Jan 13, 2019 12:42 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 05 Connect More LEDs with Relay or FET

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, ...
by RudyB
Fri Jan 11, 2019 1:42 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

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

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 a...
by RudyB
Sun Jan 06, 2019 10:39 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 55
Views: 5031

Fun with Arduino 03 Connect an External LED and resistor

I was running behind with posts ... parts 2 and 3 are here now. 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...

Go to advanced search