Description: A model railway operates under computer control, utilizing a laptop to send commands via the USB port to an Arduino. The Arduino employs PWM (Pulse Width Modulation) to regulate the speed of the train. There were several challenges encountered, particularly with the Arduino crashing repeatedly when the train began to move. It appears that the power supply being used was unable to handle the PWM load, resulting in voltage instability. To resolve this, the Arduino was powered through the USB connection, while the external power supply was dedicated to powering the direction change relay and the locomotive. It is essential to maintain a common ground connection, as the Darlington TIP120 transistors require this for proper operation. The ultimate goal of this project is to automate the model layout at the Corris Railway Museum, allowing visitors to insert coins into a slot to operate the train for a set number of laps based on the amount inserted. More coins will increase the train's speed. The software includes reed switches at both ends of the track for reversing, as well as additional reed switches for station stops. A schematic of the hardware driver circuit is provided, although it is noted to be a rough representation, along with a photo of the breadboard prototype.
The model railway control system integrates several components and functionalities designed to enhance user interaction and operational efficiency. The Arduino microcontroller serves as the central processing unit, receiving commands from the laptop over a USB interface. This setup allows for real-time control and flexibility in operation, making it suitable for interactive exhibits such as the one planned for the Corris Railway Museum.
PWM is utilized to modulate the voltage supplied to the train's motor, allowing for smooth acceleration and deceleration. However, the initial setup faced issues due to the power supply's inability to manage the PWM load effectively. The solution involved isolating the Arduino's power supply from the motor's power, ensuring that the control logic remained stable while the motor received adequate power from the dedicated external supply. This configuration is crucial for maintaining the integrity of the control signals and preventing system crashes.
The Darlington TIP120 transistors are employed as motor drivers in this design, providing the necessary current amplification to control the motor's operation. The common ground is vital for the transistors to function correctly, ensuring that the control signals from the Arduino can effectively switch the motor on and off.
The automation aspect of the project is facilitated through the use of a coin acceptor mechanism, which interfaces with the Arduino to track the number of coins inserted. Based on the input, the software determines the duration and speed of the train's operation. The inclusion of reed switches at strategic locations along the track allows for automated reversing and stopping at designated stations, enhancing the overall user experience.
The hardware driver circuit schematic, while noted to be rough, illustrates the connections between the Arduino, power supplies, motor drivers, and reed switches. This schematic serves as a foundational guide for replicating or modifying the system as needed. The breadboard prototype photograph provides a visual reference for the physical layout and component arrangement, showcasing the initial stages of the project development.
Overall, this model railway control system exemplifies an innovative approach to integrating electronics and software for interactive educational experiences, with potential for further enhancements and refinements in future iterations.Model railway running under computer control using the laptop to send commands over the USB port to the Arduino, which then does PWM to control the speed of the train. There were a few hiccups along the way not least of which the Arduino crashed repeatedly when the train started moving it appears that the power pack I was using didn`t like having its load being PWMed, causing voltage problems.
I resorted to running the Arduino off the USB supply, disconnecting the common 12V power input to the board, and just using that external power pack to provide power for the direction change relay and output to the loco. Make sure that you keep the ground connected though, as the Darlington TIP120s need that to be common in order to work.
The eventual use for this project is to automate the model layout in the Corris Railway Museum, and allow visitors to put coins in a slot and the train will then run for a number of returns depending on the coin put in. More coins the train runs a little quicker. The software allows for reed switches at either end of the line for reversing, as well as reed switches for stations.
The hardware driver circuit is shown here in the schematic below (I know it`s pretty rough, but it`s as good as I can do at short notice), and photo of the really dodgy looking breadboard prototype.
Speed control is achieved through pulse width modulation (PWM) of the gates of two MGP20N45 TMOS devices. Consequently, the motor speed is directly proportional to the pulse width of the incoming digital signal, which can be generated by a microprocessor...
Faulty readings from the DS18B20 temperature sensors used in tank thermometers were likely caused by the waterproofing method involving heat shrink and silicone. This situation provided an opportunity to enhance the code for better tolerance against erroneous readings. The tank...
A switching power supply that has an output voltage significantly lower than its input voltage exhibits a unique characteristic: the current drawn from the supply is less than the output current. However, the input power (UI) is, naturally, greater than...
The Bug-Eyed Eggliner project involves creating a whimsical animated figure with large, illuminated, and movable eyes. The project utilizes a combination of wooden balls for the eyes, a PICAXE microcontroller for control, and a servo mechanism to achieve eye movement....
The ISL6185 USB power controller family can be utilized to design a straightforward USB power supply electronic project that offers fully independent overcurrent (OC) fault protection for two or more USB ports. This product family includes sixteen distinct functional product...
The industrial fuel oil furnace controller circuit consists of a power supply circuit, a testing and ignition control circuit, and a control implementation circuit, as illustrated in the accompanying diagram. The power supply circuit includes a step-down capacitor (C6), a...
Today, nearly all computers are equipped with logic blocks designed to implement a USB port. In practice, a USB port can deliver over 100 mA of continuous current at 5V to the peripherals connected to the bus. This capability allows...
This sketch transmits an ASCII 'A' (byte value 65) upon startup and continues to do so until it receives a serial response from the computer. After receiving a response, it sends three sensor values as individual bytes and waits for...
The Arduino reads temperature from an MCP9700 temperature sensor IC and displays the temperature in the Arduino IDE serial monitor window.
The circuit utilizes an Arduino microcontroller along with an MCP9700 temperature sensor integrated circuit (IC) to measure ambient temperature. The...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more