The vehicle operates electronically at this point, influenced by its metallic components (which can change the frequency of an oscillator) or by its electronic parts (such as RFID). Different methods yield varying levels of security and error tolerance, and it is even possible to recognize individual car types. For example, a light barrier (direct light) can be employed to distinguish between passenger and freight trains as they pass by. Detection can be achieved using barcodes or RFID chips. A cost-effective detection method involves reflective light barriers positioned in the center of the rails to detect reflections from passing trains. The diode should operate at a current of 20 mA with a forward voltage drop of 1.3 V, necessitating a resistor of 180 ohms. According to the CNY70 datasheet, the collector current at the output with an object 10 mm away is approximately 50 µA. Thus, with a 47 kΩ pull-up resistor, a reasonable voltage (0 to 2.5 V) at the input of the ATtiny microcontroller is achieved, with the pull-up connected to a 2.5 V auxiliary voltage. The phototransistor is activated not only by reflected light but also by ambient light, necessitating measures to mitigate ambient light interference (such as 50 Hz hum from room lighting). This can be accomplished through proper installation and filtering techniques. A specific code, `01010`, is sent to the emitting diode, and the recipient checks if the fluctuations in measured light intensity correspond to this code. The symmetry in the code helps smooth out slow fluctuations. Measurements are taken using the integrated ADC of the ATtiny26, which requires 13 cycles for one measurement at a maximum clock speed of 1 MHz. Five measurements are conducted for each channel. Evaluation occurs by comparing the mean values: if the mean value for channel B is smaller than that for channel A, an object is detected in front of the sensor. When an object is present, light is reflected, activating the phototransistor, which then conducts and reduces the voltage. This evaluation process is repeated every 10 ms for each sensor. Considering a train traveling at 50 km/h (H0 scale), it covers 16 cm in one second, resulting in a query interval of 1.6 mm. The emitter diode is activated only during measurements in phase B, thus reducing the pulsed power consumption to 160 mA. The diode supply is decoupled with an RC low-pass filter to prevent ripple on the S88 bus power supply. The IR LEDs are controlled by a MOSFET, and their supply is also filtered with a low-pass to avoid disturbances from the 160 mA pulses on the S88 bus. The sensors are mounted on small PCBs (9x20 mm) and connected to the main board using 6-pin ribbon cables (RM2). The compact grid (2 mm) allows for easy installation of small sensor boards. The sensor is positioned on the side of the PCB, with pins connected from the side to avoid short circuits between terminals A and E. The board is mounted through a hole, with the cable routed to the side. As a more flexible alternative to the CNY70, the SFH309FH and SFH409 can be used in the same circuit, enhancing the overall range (up to 5 cm) and simplifying installation.
The electronic schematic for this system involves several key components and configurations. The core of the design is based around the ATtiny26 microcontroller, which serves as the processing unit for the sensor input and output signals. The phototransistor (CNY70 or alternative SFH309FH/SFH409) is configured to detect light reflections from trains, with the output connected to one of the ADC inputs on the ATtiny26. The pull-up resistor (47 kΩ) is connected to the ADC input to ensure that a stable voltage is maintained when the phototransistor is in a non-conducting state.
To prevent ambient light interference, especially from artificial lighting such as fluorescent lights, the installation must be shielded appropriately. This can be achieved by using enclosures or tubes that only allow light from the intended direction to reach the phototransistor. The code transmission to the LED is controlled by the microcontroller, which modulates the light output in a specific pattern (in this case, `01010`). The use of an RC low-pass filter is critical in the design to smooth out any voltage ripples caused by the pulsed operation of the IR LEDs.
The MOSFET serves as a switch to control the power to the IR LEDs, allowing for efficient operation and reducing the overall power consumption of the system. The PCB layout is designed for compactness, with careful attention to the placement of components to minimize interference and ensure reliable connections. The ribbon cables used for interconnection are chosen for their flexibility and ease of installation, allowing the sensor modules to be positioned optimally along the track.
To ensure reliable detection, the influences of the ambient light (eg, 50Hz hum from the room light) must be eliminated. This can be achieved by an accordingly protected installation and on the other hand by appropriate filtering.
This is done by sending a certain code to the emitting diode and checking at the recipient, whether the fluctuation of the measured light intensity matches this code. Here a very simple code`01010` is used. The symmetry in the code smoothens slow fluctuations. The measurement is performed with the integrated ADC of the ATtiny26. This converter requires 13 cycles for one measurement at a maximum clock (in the case of 8-bit accuracy) of 1MHz.
5 measurements are performed for each channel: Evaluation: If the mean value for B is smaller than the mean value for A, then there is an object in front of the sensor. When an object is in front of the sensor, the light will be reflected. Thus the photo transistor is lit and begins to conduct. The voltage drops. This evaluation is done every 10ms for a sensor. Assuming a train traveling with 50km/h (scale H0). it will travel 16cm in one sec. Thus, the query interval is 1. 6mm. Because the emitter diode is only turned on during the measurements in phase `B`, the pulsed power consumption of 160mA will be reduced.
The supply of the diodes is decoupled with an RC lowpass to prevent ripple on the power supply of the s88 bus. The IR LEDs are switched by a MOSFET. The supply of the LEDs is filtered by with a lowpass to prevent the 160mA strong pulse disturbing the power supply on the S88 bus.
The sensors are mounted on small pcbs (9*20mm) and connected with 6-pin ribbon cables (RM2) with the board. The small grid (2mm) allows for small sensor boards, which are easy to install. The sensor is mounted on the side of the pcb, the pins are connected from the side. (the pins almost pinch the board, please take care to ensure that the terminals A and E do not cause short circuit) The board will then be mounted through a hole, the cable runs to the side.
`As a more flexible alternative to CNY70 we used SFH309FH and SFH409 in the same circuit (see below). This increases the total range (up to 5cm) and the installation is easier. ` The analysis of IR sensors is done e 🔗 External reference
This timer circuit utilizes a 555 IC timer in conjunction with three 74LS193 counters to control an LED display. The circuit is activated by one individual who turns on the piezo buzzer BZ1 through Q1, simultaneously starting the timer....
This reflex radio project was inspired by Robert Bazian's design. His reflex radio is the "darndest" thing I have seen and his spectacular results inspired me to come up with my own version! These designs are similar to two-transistor...
The RF signal is transmitted from the antenna through CI to a tuned circuit consisting of LI and C2. One end of L2 delivers the RF signal to the base of Q1 for amplification, while the other end connects...
This circuit is designed for quiz events where two participants press their buttons to answer questions. The participant who presses their button first gets the opportunity to answer first, as indicated by the lamps associated with each button. When...
When the display shows "0," players must turn on their light switch as quickly as possible. The player who activates their light switch first is declared the winner. It is important to note that the display does not immediately...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more