Search found 174 matches

by RudyB
Mon May 13, 2019 11:05 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 30 DCC Servo Decoder

Based on the code for the DCC Accessory Decoder we can create a Servo Decoder. All we have to do is add a couple lines of code to toggle the setpoint of the servo, based on the DCC status, and add the code to rotate the servos based on a millis() timer. Link to Fun with Arduino 30 DCC Servo Decoder ...
by RudyB
Mon May 06, 2019 11:29 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 29 DCC Accessory Decoder

With the aid of very little extra hardware we can use Arduino as a DCC decoder, with a price tag that is almost 10x lower than commercially available decoders. In this video we create a DCC Accessory Decoder. In the next video we'll make a DCC Servo Decoder. In stead of DIY, alternatively you can us...
by RudyB
Thu Apr 25, 2019 11:00 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 28 Use an External Editor like Notepad++

When writing more code than just a few lines, it might be worthwhile to invest a little bit of time to to start using a more capable editor than the one integrated in the Arduino IDE. There are several free editors around that have a wealth of features that make code editing more efficient and more ...
by RudyB
Thu Apr 18, 2019 10:04 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 27 Recognize Slow / Fast Rotation of Rotary Encoder

The Servo Tuner that we built in the previous video can be enhanced with two features: 1: Recognition of slow or fast rotation of the rotary encoder, to be able to increment the motor with small steps or with larger steps. 2: Recognition of short or long press of the button, to be able to move to th...
by RudyB
Thu Apr 11, 2019 10:38 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 26 Tune a Servo with a Rotary Encoder

In the previous video we wrote code to read out the pulses and the switch of a rotary encoder. We are now going to use this to tune a servo motor. With every mechanical construction where a servo is used to move something (garage doors, a gate beam, a turnout), the minimum and maximum servo angles n...
by RudyB
Fri Apr 05, 2019 1:51 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 25 Rotary Encoder with Switch

A rotary encoder is a digital device, approximately the size of an analog potentiometer. When rotated, it generates 2 pulse signals from which we can deduct the number of rotation steps and the direction of rotation. It also has a push button on board. When connected to the Arduino we can read out t...
by RudyB
Fri Mar 29, 2019 11:12 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 24 Neopixel Sequencer with Flexible Timing and Colors

In video 23 we made a step sequencer for addressable LEDs (Neopixel). The beauty of it is that a LED on/off sequence is created in a visual way by editing a series of ‘1’s and ‘0’s: 1,1,1,0,0,0,1,1,0,0,1,0,1,1,0,0. The drawback being that the color of every LED is fixed and also the interval time is...
by RudyB
Thu Mar 21, 2019 2:13 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 23 Neopixel Addressable LED, WS2812, struct{...}

Neopixels, or addressable LEDs, are color LEDs with a built in chip that takes care of the one wire data communication and of the Pulse Width Modulation for the built in RGB(+W) LEDs. The LEDs are connected via just 3 wires, GND, 5V, Data. The Data line is connected to an Arduino output and we can c...
by RudyB
Thu Mar 14, 2019 2:22 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 22 Step Sequencer for LEDs with array[] and for() loop

A police car, fire fighter car or an ambulance with flashing lights can liven up any model railway laout. The challenge that we set ourselves is not to have to write different code any time we want another flashing pattern. We want to hav one and the same code and we only want to configure the numbe...
by RudyB
Sun Mar 10, 2019 11:21 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

Fun with Arduino 20 Railway Crossing Putting it all Together

We have seen the separate ingredients for a level crossing in the previous three videos: blinking LEDs, servo to operate the gate, sensors to detect the train ... it is time to put it all together now into one piece of software. We'll use the State Transition Diagram as our starting point and build ...
by RudyB
Thu Mar 07, 2019 10:35 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 45
Views: 2317

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: 45
Views: 2317

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: 45
Views: 2317

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: 45
Views: 2317

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: 45
Views: 2317

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

Go to advanced search