DCC++ Hardware - Block Detection

HVT Jan 27, 2016

  1. HVT

    HVT TrainBoard Member

    74
    93
    15
    After doing the math on the ACS712 current sensor board that was suggested in an earlier post it appears that while it will likely detect the loco it may not meet our needs to detect rolling stock with resistor wheel sets.
    [​IMG]
    The data sheet lists the sensitivity for the 5 amp version at 185mV/A. Doing the math (as I understand Arduino Mega specs) using a 1.1v reference voltage and a 10k ohm resistor on the rear wheel set follows.

    18v/1ok ohm = 0.0018A, 0.0018A*185mV/A*1024units/1.1v = .31 units. According to post #422 on the previous thread this is much too low to be useful.

    Is my math and logic correct?

    The RRCirKits BOD8 with detection coil can detect down to 1mA, and the 10k resistor draws 1.8mA at 18vdc. And it uses electronics to achieve this.

    Any suggestions?

    Dave
     
    Last edited: Jan 28, 2016
    Scott Eric Catalano likes this.
  2. hoyden

    hoyden TrainBoard Supporter

    815
    778
    30
    The math sounds in the ballpark.

    I built block detectors using bridge rectifiers in series with the power that drive an opto-isolator and op amp comparator to generate a logic level signal. It is a handful of electronics and does incur some voltage drop across the rectifier, but can detect resistor wheel sets greater than 5K. The detection coil doesn't incur the voltage drop but costs about 10x as much. I have had 32 blocks in operation for about the past 8 years. The block detectors drive an RR-CirKits TC-64 Tower Controller to generate sensor signals.

    I am always interested in learning an easier way to do this.
     
    Scott Eric Catalano likes this.
  3. w8one

    w8one TrainBoard Member

    89
    109
    5
    The acs712 are 5v parts.
    From my understanding you supply it with 5vdc. At 0 amps it will show 2.5v. With +1 amp 2.5 + 0.185 = 2.685v at -1amp 2.5v - 0.185 = 2.318v.
    At 10 bit 5v / 1024 = 0.0049 v = 1 unit, or 0.0049v / 0.185 = 0.026A = 1 unit
    18v/1ok ohm = 0.0018A, so 0.0018A x 0.185 = 0.0003v. that would be 2.5003v. 10k is to small alone.
    18v/100 ohm = 0.18A, so 0.18 x 0.185 = 0.03v that would be 2.53v this it would see alone.

    If you only had a resistor wheel set on the last car and it was 100 ohm it would see it. If you had 1k on ten cars it would see that too.
    Because this is a dc +/- signal you could see 1k alone, (+0.003v and -0.003v = +/- 0.006v) if you look at the + and the - voltage together 0.006 > 0.0049 if on 1 wheel set.

    I have bought some cheepish rfid stuff but have not messed with them yet.
     
    Scott Eric Catalano and HVT like this.
  4. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    Do they make 100 ohm resistor wheel packs? At 18v that's over 3 watts. Can't use an ordinary resistor across the wheels. Would need to draw the resistance from the metal axle, and even then may get too hot?
     
    Scott Eric Catalano likes this.
  5. w8one

    w8one TrainBoard Member

    89
    109
    5
    At 18v a 560 ohm resistor and a red led (2.0v) would be 30 ma hooked to the wheel set of the last car like a eot device would be seen by the acs712 you might need a diode to keep from killing the led.
     
    acptulsa, Scott Eric Catalano and HVT like this.
  6. HVT

    HVT TrainBoard Member

    74
    93
    15
    W8ONE,

    A red EOT device, or better yet, a lighted caboose with marker lights just might get the current load up enough to do the trick. And a caboose is required in this era.

    Thank you, that is a splendid and practical solution!!

    Dave
     
    Scott Eric Catalano likes this.
  7. conrailandrew

    conrailandrew TrainBoard Member

    18
    29
    11
    I found this this morning, I don't know if there's any practical information in there too use or not, but it looks like the block detection with those little boards has been done.

    http://thenscaler.com/?p=514

    Andrew
     
  8. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Lots of good information there, Andres. Thanks!
    I tried using the Hall sensor with DCC and, with the software in the link you found, it does work but it is not very sensitive. It reliably detected an HO locomotive when running at a good speed but when I slowed it to a crawl it was not found.
    The good news is that I learned a nice programming routine and have decided to put the Hall sensors to bed for now.
    Not I can get back to the sensors that use a coil to detect current flow.
    thanks again!

    dave
     
  9. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    What coil sensors are you going to use? Will it be used in conjunction with the Arduino?
     
  10. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Scott - I am experimenting with a number of coil sensors - Some come with what is called a "burden" resistor that I have found you have to remove to get them to work with the circuit I use with the Arduino.

    Right now I have a test unit working with the Point-to-Point controller that I built up last week. It uses a sensor like this one from Deal Extreme:

    DX-coil.jpg
    I have tried several others and, once the resistors (circled in the image above) are removed, they work, too - Once I have tested more I'll do a proper job of writing up what I have done and post the info here.

    dave
     
  11. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Very good I am interested in seeing the outcome of your tests as this will be very handy in what I want to accomplish on my demo layout
     
  12. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Scott - I finished up my experiments with current sensors and put my notes to together on my web page here:
    http://www.trainelectronics.com/DCC_Arduino/Current_Sense/index.htm

    I still have some additional items on order and will update the page when they arrive.

    The sensor utilizing a coil work very well with the point-to-point controller that I build up last week.

    Please let me know what you think and if you have any questions.

    dave
     
    HVT, Scott Eric Catalano and lnxlnx like this.
  13. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Thanks for the info dave....can't wait to test this.....do you have an Arduino sketch handy? Also can you take more pictures from all angles so I can see the complete setup....I'm a visual person thanks!
     
    Last edited: Feb 9, 2016
    HVT likes this.
  14. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Will add some photos, perhaps tomorrow -
    The current code on my web page here: http://trainelectronics.com/DCC_Arduino/DCC++/IRThrottle/ includes reading the current sensing board - I have no code that just reads it --- it takes nothing more than looking at the status of a pin, high or low.

    dave
     
    HVT and Scott Eric Catalano like this.
  15. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    ok...what i plan to do is read the sensor and make a GUI interface on my computer to light a section of track...thats all....so I would need to read the sensor high or low
     
  16. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Scott - I received the coils from Amazon yesterday and find that they work just as well as the others for detecting when a locomotive enters a block - not bad at $1.80 each!
    I updated my web page ( http://www.trainelectronics.com/DCC_Arduino/Current_Sense/ ) and added a few additional photos of the circuit that I use with these coils.

    Please let me know if you have any questions.

    dave
     
    Scott Eric Catalano likes this.
  17. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
    Hello Dave,

    Good to know then I will order from amazon...which part numbers did you order? Also using HO Scale I've seen people use 10k ohm resistor wheel sets....what do you recommend?
     
  18. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13
    Not sure on the part # but here is a link to what I ordered: http://www.amazon.com/gp/product/B00UT7U982?psc=1&redirect=true&ref_=oh_aui_detailpage_o00_s00

    The circuit I am using might need a bit of tweaking to get it to respond to a 10K resistor - I tested with 4.7K and it worked well as did 1K - none of those values would draw much current.
    dave
     
    Scott Eric Catalano likes this.
  19. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    205
    57
    6
  20. David Bodnar

    David Bodnar TrainBoard Member

    264
    481
    13

Share This Page