Total Pageviews

Tuesday, April 19, 2022

How to test NEM652 decoder with "DCC ready" board

 original article

   A few weeks ago, I  posted article named "DCC ready" board for classical locomotive (DC loco) where it presented how can be use the "DCC ready" board 

--->   

   I'm beginner in DCC so I try to show you how can test a NEM652 decoder on a DCC ready board. Later, I'll show you how you can install the decoder in your locomotive.
   
  For add the NEM652 decoder on DCC ready board you must remove small 8-pin board and connect the decoder:
- initial

- remove 8-pin board
- add NEM652 decoder, with correct position 


   I found some info about the NEM652 decoder:
   In order to test the decoder I used info and files from https://dcc-ex.com/index.html
   I used for tests:
- 0-30V/0-10A power supply (set to 12V voltage & 2A maximum current)
- Arduino Mega board (clone)
- Arduino Motor shield (clone)
- LCD1602 display + i2c interface (added later)
   First I cut trace for VIN as in article from https://dcc-ex.com/get-started/assembly.html
- initial (using a DMM on diode domain, test if resistance is near 0Ω)
- after (using a DMM on diode domain, test if resistance is big, OL - open load on display)
  I used easy way using installer for sketch in Arduino as in article from https://dcc-ex.com/get-started/installer.html
  For controller (Throttle) I used a web throttle as in article from https://dcc-ex.com/get-started/controllers.html
    I used an Automatic white/red light for analog locomotive (DC) instead DC motor:
    I make a video named test a DCC decoder (NEM652) with Arduino Web Throttle where I presented how I used the Web Throttle and how react board with NEM652 decoder.
   Later, I added LCD1602display with i2c interface and I used again installer. Decimal address is 63 for 3F as hexa number for i2c interface adsress

On display of command station is shown logo
or state of decoder
Adapter board + NEM652 decoder + bicolor led as "locomotive" and Arduino Mega + Motor Shield + display as command station:
- forward
- backward

20.04.2022
    I want to find if my decoder has active Function 1 (pin 3) and Function 2 (free purple wire) so I added a green led at pin 3 in series with 3k3 resistor to pin 7 (common V+), also I added a yellow led at free purple wire in series with 3k3 resistor to pin 7 (common V+). Usual value for serie resistor is 1kΩ, but 3k3 was in my way.
   I make another video, named test a DCC decoder (NEM652) with Arduino Web Throttle - 2, where you see how I control "digital locomotive" through Web Throttle 
    Later, I added a wi-fi board with ESP8266-01 at Station:
and I uploaded sketch in Arduino Mega using the installer:
after I find channel for my wi-fi (bbk2 - channel 4):
On display we see the IP adress and port for station:
   I install Engine Driver application on my Android phone (see more info about aplication in article Choosing a Controller (Throttle)
   I tested also Function 1 (Bell) and Function 2 (Horn)

22.04.2022
   I tested the system with Android Throttle (Engine Driver application) and I make a video named test NEM decoder with DCC++EX Arduino Station and Android Throttle. For this situation, information on LCD display are very useful (IP and Port).

Sunday, March 27, 2022

How to solve the issue with incorrect date/year extract from Unix time (with ESP8266 board)

original article


    A reader of my blogs announce my this issue about wrong conversion of the date/year when extract data from Unix Time (Epoch Time). Also, the solution for this issue is simple, like here: https://github.com/arduino-libraries/NTPClient/issues/149.

I open the Serial Monitor and epochTime is ok, but conversion to date not
- 1st step: TOOLS -> BOARD -> BOARD MANAGER
- 2nd step: ssearch ESP8266
- 3th step: search 2.7.4 version
- 4th step: wait to full install a old file
- 5th step: close Arduino IDE and restart Arduino IDE
- 6th: upload the sketch

    I tested and add some feature for clasical Morphing Clock:

Arduino automatic model train (2)

original article 1 and article 2

   I updated the schematic and sketch (software/program) for automatic model train. 

Schematic is

and program wrote by me is controlled_model_train_3a.ino (base sketch was presented in previous article + adjust part from Doz's article Arduino Astronomical Clock (or Arduino Pond Pump Controller!)).

   Using menu, we can change:

- language (english/romanian language), but each can put local language instead romanian, my native language.

- succession of read the sensors, to activate sensor in movement direction

- maximum speed (PWM: 200..255)

- minimum speed (PWM: 25..150), usual 105 i minimum for real motor, 25 is best for leds

- step for speed (PWM: 2..20)


   After system is powered, after welcome messages, you will see STOP! and red led flashing

until is push button from encoder:

- short push: enter in normal mode, in pause

- long push, until a star appear, enter in adjusting menu:

    Steps in menu mode (adjust by encoder rotation+ enter value by pushing value, menu jump to next level):
- language selection, values: 0 - english, 1 - romanian language

- direction ( adjust as display direction to be as in reality):
- order of proximity sensor activation (must be same as direction... if locomotive go forward, sensor from front of locomotive must be activate, etc), value is 0 - normal or 1 - inverse (schematic use just 2 sensors)
- maximum speed (PWM), from 200 to 255 (because maximum PWM at usual Arduino is 255)
- minimum speed (PWM), from 25 to 150, for DC motor typical is 105
- step for speed (PWM), from 2 to 20
After pushing the burton, system enter in normal function, so on display is STOP!
After a short push of button, on display is PAUSE (value changed previousin menu).
Speed increase 
until maximum
proximity sensor from front is actuated and speed decrease
until zero... a little pause
speed increase in backward direction
until maximum
When locomotive in backward movement actuate sensor from back side, speed decrease
untill 0.. pause.. speed increase to forward movement, etc....

    If on display movement is to forward and locomotive goes to backward (upper white leds indicate the direction, also bicolor led: red for backward and white for forward direction)
it need to change the direction ( if is 0 change to 1, if is 1 change to 0)
   After that, it need to check order of proximity sensors... if locomotive goes forward, sensor from front must be actuated... so, you remove locomotive from rail, put finger in front of correct sensor and if BRAKE message apear on display, sensors are correctly choose, if NOT enter in menu and change value for position sensor, if was 0 change to 1 and was 1 change to 0.
    I uploaded Arduino automatic model train (5) video with steps described upper:
Also you can watch  Arduino automatic model train (4) video 

Saturday, March 26, 2022

"DCC ready" board for classical locomotive (DC loco)

original article (romanian language)


     I'm new in model railway system: locomotive, railways, control, etc.

Old locomotives works with DC power, 0..12V for forward and 0..-12V for backward, so classical schematic is

so a "DCC ready" locomotive is a simple DC locomotive with "DCC ready" board, as in schematic:
    This "DCC ready" board looks like 
   This board can be used with 2 miniature 12V bulbs or 2 white leds, as in upper schematic (in some tests, at beginings, I added 1kΩ. resistors when check leds functionality, but I worked with small voltage... after that I disconnect additional resistors and connections remain NC, means not connected/not used).
 Forward led (FW) is on when the voltage on RT terminal is plus (and minus at LT terminal), also motor turns on to forward direction (M1 is plus and M2 is minus), backward/reverse led (RW) is on when the voltage on RT terminal is minus (and plus at LT terminal), also motor turns on to backward direction (M1 is plus and M2 is minus)
- simulated forward movement:
- simulated backward movement
   You can see how system works as in test "DCC ready" board for DC locomotive on automatic railway system video: