Total Pageviews

Sunday, March 6, 2022

Automatic white/red light for analog locomotive (DC)

 original article

   Most of the simple analog locomotive use DC voltage with normal or reverse polarity, normal polarity go locomotive forward and reverse voltage go locomotive backward.

   I used for test on breadboard a 5mm bicolour led (red/white) LTW30EEDYJA but for 3mm can be used OSRWPA3132A.

   I designed a simple schematic with additional 3 pieces: 2 diodes (1N4007) and a resistor (680Ω..1kΩ):


   For normal polarity for power supply of the analog locomotive white led is on
and for reverse polarity red led is on
   I make movie named automatic white/red light for loco with a 3 pins led:

Thursday, March 3, 2022

Arduino automatic model train

original article

   As a noobie with the model train system and because I haven't too much free space for test with big railways, I search for an automatic model train system, where it used IR module for define frake momment (stop position is not instant, as in rea case, if push brake pedal and car stop is after few meters).

    First I found the video I Made an Automated Model Train With An Arduino! where it used direct control (DC voltage with normal or reversed polarity). I tested manually the functionality of the system with my adapted sketch as in video Automatic Model Train (test)

After that, I found article Back-and-forth train control by Arduino with IR sensor

with PWM control for speed, so I adapt the sketch (my sketch) and made a first test with push a carriage push by me, to see how system work, as in video Automatic Model Train (test 2)
   Finally, I added L298 H-bridge module as in schematic
    First video is Arduino automatic model train

and second (with an oscilloscope on railway power) is Arduino automatic model train (2)


5-March-2022
    After I clean and greased an old Fleischmann 1966 as in movie 1966 Fleischmann 1306 Shunter: O&K MV9 - Bringing it back to life I make a new video named Fleischmann 1966 on Arduino automatic model train.
   PS: Improved sketch is controlled_model_train_1b.ino where it used for start PWM at 105 (aprox. 40%) not 0, remain maximum at 255 from 255 (100%). This mode to start the loco is useful for old DC motor.
   In next image you can see how automatic system for control the train ("loco") works:
   If train go forward, speed is constant, at maximum, if IR module 2 is actuated, speed decrease slow until train stop. After a small pause, train go backward, with speed increase from zero to maximum, and than IR module 1 is actuated, speed decrease slow to until train stop. Again, after a small pause, train go forward and cycle is repeated, as in next image:

Thursday, February 24, 2022

Automatic Railway Crossing system

original article



   `A schematic for an automatic railway crossing system:

I wrote a sketch for control 2 servos, warning ligts and sounds: doublebarriers_5.ino. As any Arduino fans knows, sounds and servo (using Tone and Servo libraries) not work simultanieous, but I used a trick, I activate servo when I want movements, deactivate the servo when I need sounds.

   When any IR sensor modules is actuated (LOW level) servos close the gates, red leds flash and speaker sound as in video double barriers with sound and lights (4)
    When railway is free gates are open, white led flashing.

   As I presened in previous post, Dragos (albasete) test sketch for real diorama, so:
  - barriers:
- warnings (sounds)

Railway Crossing system with manual control

original article



   I'm beginner as railways diorama, but I want to help the passionate peoples.

   First project with railway crossing system was for a manual control. 

   System control 2 servos with warning lights and sounds.

   Test schematic is

and program (sketch) is doublebarriers_3a7.ino.
    Real system created by my is on breadboard:
but Dragos (albasete) work more professional:

   I uploaded a short video named double barriers with sound and lights

Monday, April 20, 2020

Flashing led without delay

   I found another solution to made flashing led without delay than example from arduino IDE
   My solution is to use also millis() function but in other style. Millis() function count time from power up the Arduino (microcontroller)
   I use another variable, to made time from power up in seconds.After that I use rest function (%), for odd number led is on, for even number led is off. For example: 7%2=1 => led on, 8%2=0 => led off.
  You can see a simple mobvie with this style for control a led:
   I wrote 2 simple sketches: blink_wo_delay.ino and blink_wo_delay2.ino with same effects but little changes as commands.
  

Saturday, April 18, 2020

Consumption measurement for MAX7219 32x8 led display

   For measure the consumption for display made with 4 8x8 led modules drived by MAX7219. I use clock presented in article named ceas animat complex cu date de pe net, whitch use just a development board WeMos D1 Mini and display with 32x8 leds.
   Schematic for a module with 8x8 leds is:
Leds are controlated through muplexing system, so consumption is low.
    First, I removed the display for measure the resistor control for consumption:
I used also a microscope:
Value is 103, so is 10kohmi. You can ckech using an online calculator:
   My display is powered at 3.3V, but I also made measurements at 5V.
   I chose this clock because it can be controlled from a local web page and it's easy to change the intensity.
   We have selected the intensity at 0, the one commonly used at night or when it is cloudy outside and the average consumption is 16mA at 3.3V and 28mA at 5V:
   I selected the intensity at 4, the one commonly used during very bright daytime and the average consumption is 46mA at 3.3V and 66-73mA at 5V:

Friday, April 17, 2020

Bidirectional detection with ultrasonic sensors

   I will made a box with 2 doors and system need to detect movement so I tested a simple system with Arduino board and 2 ultrasonic sensors (HC-SR04).
   I used info from an old project (made a 7 yesrs ago)
   New test schematic is
   My program is bidirectional_detection_ultrasonic.ino and if any sensor detect an object bellow 25cm led is turned on for 3 seconds.
   I made 2 video with this system: