Voltage for Sensors

Barry Gordon Apr 27, 2020

  1. Barry Gordon

    Barry Gordon TrainBoard Member

    23
    6
    2
    I am using small obstacle sensors for loco detection on my test railroad. There are 24 of them installed. they are located at the end of sidings (8) and at the end points (thrown and not thrown) of each switch (2*8=16). The sensors emit an IR light stream and if it is not reflected back to the IR sensor the sensor reports an inactive state. I have painted the underside of each locomotive with a dab of white paint which causes very reliable reflectivity. Each sensor has as indicators, a power LED and an "Active" LED which shows very reliable obstacle detection taking place. (original Sensor)

    Sensor.jpg

    I have modified the sensor by removing the emitter and receiver LEDs and replacing them with 2 pin header connectors. I am using 3 mm emitter and receiver LED's on 8" cables with matching connectors. The LED's go through the baseboard and roadbed (Kato-Unitrack) and sit below the rails in adjacent section separated by a RR tie.

    However, the JMRI sensor table is not actively tracking the sensor state. The sensor state table shows incorrect sensor states and does not always track the state change. When JMRI is started with no trains on the track the sensor table shows some sensors as active, some as inactive and some as unknown. I believe they should all show as inactive

    I am using 3.3 v to drive all the sensors and suspect this may be the problem. I did this because there were LED failures reported using these sensors at 5 v. The sensors are rated to operate from 3-5 volts. I Do not believe pull up resistors are being used. I could try the sensors at 5 v with a one wire change, but before I do that I would appreciate comments from any who have played with similar devices and how they have configured and used them.

    TIA,

    Barry Gordon
     
  2. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    The extension cables you have the LEDs on; are they screened? I'm wondering if they are picking up interference from the track.
     
  3. Barry Gordon

    Barry Gordon TrainBoard Member

    23
    6
    2
    Thanks for the reply Jimbo,

    The LED cables are not shielded. The fact that the status LED on the PCB never flashes and goes to a constant on state only when a true obstacle is detected indicates to me that there is no cross-talk or interference problem.

    Barry
     
  4. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    Ah! - OK!

    I don't use JMRI, though my layout does use Hall effect sensors. Are you programming each sensor into DCC++? I don't know if JMRI takes care of that?
     
  5. Barry Gordon

    Barry Gordon TrainBoard Member

    23
    6
    2
    I plan to try 5 volts as Vcc for the sensors.

    I am pretty sure JMRI does program the sensors into the DCC++

    I'm pretty far along with a RPi (Nodejs) module for talking with the DCC++. This will replace the use of JMRI. I use MS Visual Studio code for writing the Javascript code as it has a superb debugging/emulation environment for testing the code. I have gotten to the point where I can send commands to the DCC++ and display the reply. I have tested all of the single letter commands and will start testing the more complex commands shortly.

    My layout is in my Home Theater under the screen on a 10" x 10' shelf. Eventually I will be using my theater remote control (a Philips Pronto PRO) which currently operates the theater, to run the layout.
     
  6. papahnash

    papahnash TrainBoard Member

    337
    69
    17
    I am using that same sensor for crossing gates. I have 4 of them that have been working on 5v for over a year. I also removed the LED's from the circuit board and wired them with twisted pairs wire to minimize interference. The LED's are also mounted in Kato Unitrack at an angle 30-60 degrees from verticle facing each other. I add shrink tube to the LED's so that only the end was exposed. They are very dependable.
     
  7. Rasputen

    Rasputen TrainBoard Member

    565
    186
    27
    Are you using the same power supply for the sensor boards and what ever computer is running JMRI ?? I would measure the signal relative to the computer ground, with the sensor in each state.
     
  8. Barry Gordon

    Barry Gordon TrainBoard Member

    23
    6
    2
    Thanks guys,
    I am glad ti hear that your sensors have operating for over a year on 5 volts. That boosts my confidence.
    I am using to different power supplies. 5 Volts for the RPI and 3.3 volts for the sensors, but the ground of both supplies are tied together.
    I am going to try the 5 volt supply as soon as I get some other "Household repair" projects done.

    Barry
     

Share This Page