Search found 179 matches

by RudyB
Thu Mar 07, 2019 10:35 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 50
Views: 2966

Fun with Arduino 19 Railway Crossing Train Detection with Optical Sensor

There are several ways to do train detection, like sensing rail current, or a magnet under the train that triggers reed switches along the track, or with an optical sensor. The latter is used in this video, only because I had some TRCT5000's lying around and they were easy to setup for a demo. As so...
by RudyB
Thu Feb 28, 2019 9:56 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 50
Views: 2966

Fun with Arduino 18 Railway Crossing, Servo Motor to Operate the Gate

In part 2 of the railway crossing project we are going to connect the servo motor that operates the gate and control it with the Arduino. With the example in the video, the gate beam is mounted directly on the servo. On a layout, the servo motor will probably be mounted under the board, and a metal ...
by RudyB
Wed Feb 27, 2019 7:30 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 50
Views: 2966

Re: Fun with Arduino - a Series of Introductory Videos

There has been a request to also do a UK crossing. Maybe it can be in one video, else there will be an extra video with the yellow and double red additions when the continential one is finished.
by RudyB
Mon Feb 25, 2019 9:42 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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: 50
Views: 2966

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...

Go to advanced search