Easy Arduino Current Sensing for Occupancy Detection

  Рет қаралды 22,807

DIY and Digital Railroad

DIY and Digital Railroad

Күн бұрын

Пікірлер: 64
@RonsTrainsNThings
@RonsTrainsNThings 4 жыл бұрын
I'm glad you made thos video before I started buying ir sensors for arduino block detection. This is definitely the preferred method.
@kenneybennett9359
@kenneybennett9359 Жыл бұрын
Hi, I just started watching your videos, wonderful content along with great innovation. I have been playing with arduino systems, learning coding and such. I have about 100 locomotives I have been collecting over the years and I was wondering how you control large consists of say 5 locks at a time. I would appreciate any ideas or suggestions you might have. Thank you, Kenney
@panamrailfan4377
@panamrailfan4377 4 жыл бұрын
Jimmy, I’m pretty sure you can simplify your main loop into 4 lines of code, I’ll investigate today! Of course, your purpose is to teach people Arduino and the Arduino has tons of headroom in this case. This was perfect! Great work and great tip for the railroad!
@johnnyrobertson5971
@johnnyrobertson5971 4 жыл бұрын
Hello Jimmy, thank you always for any Arduino projects and love how you teach the world of Arduino’s. Enjoy your videos and appreciate how you give this to us so freely. Be safe up there and happy railroading!!
@SaintLouisLines
@SaintLouisLines 3 жыл бұрын
Jimmy, this is exactly the information I've been looking for with respect to interfacing block detection with the Arduino. I already have multiple Arduino's networked to JMRI using the Chubb Computer/Model Railroad Interface (C/MRI), but none are being used for current sensing. Thank you so much for this timely tutorial. Count me in as a new subscriber!
@TheTrainFreak
@TheTrainFreak 4 жыл бұрын
I love using the BD20's and have been using those for a while. I haven't jumped into using Arduino yet but I do have a NCE AIU-01 card that allows me to connect 14 BD20s on it with my system being connected to JMRI. You are correct as needing at least 1 axel with a resistor on rolling stock but I prefer two axels (the inner axel on each truck) to have the best reading without it looking too disruptive. Of course rolling stock with lighting and/or sound won't need the resisted axel. This was a main issue I had when getting into block detection years ago. Great video Jimmy as always and congrats again on your 10K subs!
@nesr8786
@nesr8786 4 жыл бұрын
Thanks Jimmy that was a lot simpler to the previous block detection you done a while ago .much appreciated, Take care for now .Mac
@Drsef50
@Drsef50 4 жыл бұрын
What a terrific video. I'm going to order a couple of BD-20's and start designing a couple of track projects that I've kept on the back burner awaiting a simple and reliable triggering mechanism. Thanks, Dave
@l.rod2827
@l.rod2827 Жыл бұрын
Just watched your video and it was very helpful. I'm looking at installing 2 BD20 (one for each mainline) to run operate (2) two aspect signals. I'm thinking for the coding to have two inputs (pin7,&6) and four output pins (5,4,3,2) with the similar coding {if va1A1,
@darylroe9929
@darylroe9929 4 жыл бұрын
Can't wait for your updates on this subject.
@hansfehlow9657
@hansfehlow9657 4 жыл бұрын
Wow nice and simple Jimmy. Thank you for making this video and explaining the process. Happy Modelling and stay safe. Hans ...
@davelees3922
@davelees3922 Жыл бұрын
Hi Jimmy, I'm a relatively new subscriber, but love the videos... can I ask, how easy would it be to have the Arduino code monitoring 4 inputs (and therefore controlling 4 LEDs)...?
@TechBuild
@TechBuild 4 жыл бұрын
This is a great addition for model railroad automation projects!
@austinhale7265
@austinhale7265 4 жыл бұрын
I had been trying to figure out how to use IR without having to blow a bunch of holes in everything, so this is a much better option, and nicely presented/explained as always! How many blocks done this way can a single Arduino monitor/control?
@darrentecklenberg4280
@darrentecklenberg4280 7 ай бұрын
Hi Jimmy, Thanks for the video which I have found useful, however as I am new to Arduino coding I am a little puzzled at point 08:40 of the video when you specify the if statements where if (valA10) then show the LED as LOW - surely valA10 are both TRUE statements?
@artyz2002
@artyz2002 4 жыл бұрын
This is easy, thank you. I am preferring to use this system with my new layout as I be doing night operations, and the ir don't work to great in the dark. Thank you.
@KaiDon1
@KaiDon1 3 жыл бұрын
I used standard 5 Amp, one , you need to wire more turn to CT , It works fine and stable on my layout.
@KaiDon1
@KaiDon1 3 жыл бұрын
Also,need to set up the A/D unit.
@redwoodcityintheuknscalera7179
@redwoodcityintheuknscalera7179 4 жыл бұрын
Hi jimmy the quicker you show us how to do this for the block signals the better i think i can do it but can't wait to follow along with your video
@ariegt
@ariegt 4 жыл бұрын
ever tried the "ACS712" ? it will set you back just 1 buck !!! for the axle sensing you can put special resistence paint on them , old trick ... but it is best to use only the last car for it , otherwise you can put to much load on your track. You will see it is not flawless for detecting the whole train. i still prefer the infra-reds ( begin + end ) in combination with the asc712 load detector to get it water tight. P.S i am also looking into motor drivers (PWM and or DCC) with a current sensor build in . A Power(dcc) unit with a build in sensor of usage sounds perfect to me. keep it up, kind regards Arie-gt
@ariegt
@ariegt 4 жыл бұрын
@Randy Rinker well if you take ohms low and do your math it goes a little bit faster then that. If you take 15 cars with 10K axles you end up at almost 300-Ohm , nothing to smoke up your wiring but still something to take in mind
@ariegt
@ariegt 4 жыл бұрын
@Randy Rinker who is talking about 300ma ? you can also use just 10k on just only the last car or caboose , but don't forget to hang it on the tail or the system fails
@ariegt
@ariegt 4 жыл бұрын
@Randy Rinker yes in a perfect world you know exactly where the front of the train is at and also the end. As you also stated earlier , it is nice to have IR at certain spots. You can also use 0.1-Ohm resistor in series of your track and meassure the voltage over it , maybe the cheapest solution for train detection
@yawarsaeed6499
@yawarsaeed6499 3 жыл бұрын
Thanks for sharing such an Awesome project. Can you please share where did you connect the current sensing loop wires to the track. Can you please preferably share the wiring diagram as in video all is clear except the sending loop wires termination to the track . An early response will be highly appreciated. Take care, stay safe.
@HumancityJunction
@HumancityJunction 4 жыл бұрын
Thanks Jimmy for a great explanation that is easy to follow about current sensing.
@scottericcatalano596
@scottericcatalano596 4 жыл бұрын
I also recommend using #define this saves having to remember pin numbers down the road especially if you get more and more sensors and LEDs etc
@Core-vu6mc
@Core-vu6mc 10 ай бұрын
There is an easier way. Just get one of those small blue coils, a 50 ohm burden resistor and a pair of leads. Connect the burden resister across the terminals of the coil. Connect the leads to the terminals as well. One lead then goes to the ground on the Arduino. The other goes to an analog pin like A0. Wrap your track wire two or three times through the coil. The Arduino sketch can read the value from A0. You will have a small floor value even with no train on the track. Just set your code to turn on the led above that value. It will also detect stopped trains for the same reason as the more complex and expensive circuit shown. No need to provide power to the coil. It works via induction.
@YigalBZ
@YigalBZ 9 ай бұрын
This is not checking for exitance of train on the rail. It is checking for moving train on the rails. There is a bid difference.
@DIYDigitalRailroad
@DIYDigitalRailroad 9 ай бұрын
Actually this checks for a current draw on the tracks. A Locomotive will complete a circuit and draw some current even when completely stopped. You can also do this with rolling stock by using resistor wheelsets.
@YigalBZ
@YigalBZ 9 ай бұрын
@@DIYDigitalRailroad Although it is often true, it is a very risky method: sometimes the current consumes is very low, so measurement can result with error conclusions. Small current can flow without a train, or if a wagon was left. Or a train that is not consuming power due to a problem. My point is that this method detects power, not existence of a train.
@jeffemaxse8928
@jeffemaxse8928 Жыл бұрын
Hi Jimmy, Hi guys, Another great video. Living in France, I can't get my BD20 sensor easily and quickly (except to order them in the United States, or in the United Kingdom with mind-blowing customs duties !!!), can a sensor such as the ACS712 be used instead ? If someone has tested this type of sensor, please let me know if I can use it to control the barriers of a crossing (until now opening and closing with a switch). Many Thanks
@williambryant5946
@williambryant5946 4 жыл бұрын
So you could use this with CTC panels to light the bulb on the panel and show what block the train is in. Will it work if the train is in two blocks? What I mean is if you have several of these sensors and blocks back to back will it show the train in each one using the same code or would the code need to be changed? I don't see why it wouldn't or why you'd have to change the code but I'm not great with writing code and understanding how it works completely. I'm at the level of I can do it if you show me what to write like you have in this video. You are doing great videos that share awesome information. Thanks for doing these videos. Stay well. -Wil 👍
@joegusherowski8548
@joegusherowski8548 10 ай бұрын
Hey Will, sorry for the very late response. But the idea that you are describing is totally feasible. In the video, he mentions that you do not specifically need a locomotive with a motor to cause an increase in current draw to trigger the sensor. If you were to add any sort of resistance to any other piece of rolling stock (ex. use a resistor on a caboose axle), it would also trigger the sensor in any block it traveled through. If you were to add resistance to every locomotive/railcar of a 100 car train, and your blocks were for 40 car lengths, your train would show up in 3 blocks at a time. So the changes you would need to make from this video to make a CTC panel would be: - Follow the same wiring for each block, so you would have a wire from each block sensor going to the Arduino digital pins. - In the code, under VoidSetup, you would need to write a pinMode(#, Input/Output) for every pin you were using. So this includes inputs for all the new sensors, and outputs for all the LEDs you would use. - In the code, under VoidLoop, you would need to create a new variable for each input (int = ValA#) - Copy the "if" and "else if" statements with your new variable(s), and obviously change the digitalWrite(#, H/L) to the correct pin number. Hope this helps.
@railwayjade
@railwayjade 4 жыл бұрын
Now we are talking! This is what I was hoping to see 😎😎🥳🥳
@1964cali
@1964cali 3 жыл бұрын
Need a sensor on the loco to turn on sectional block lights within a block, say the length of loco. And a sensor to turn off lights on the caboose as it leaves a section of block. This way one wouldn’t worry about the length of train and it’ll show as it leaves the sectional blocks to show the end of train.
@1964cali
@1964cali 3 жыл бұрын
Let’s say for each 20” section of a block, the loco would turn on the light and leave them on as it progress forward. Then as the caboose comes through, it would turn off the lights. Wouldn’t matter if it’s a 3 car train or a 10 car train. The lights left on would indicate occupancy as train moves through the layout. For each light left on would indicate the presence of a car. It would continually show the location of the loco as it moves forward a sectional block and location of caboose as it leaves a section block. Kinda like running LEDs.
@TimberSurf
@TimberSurf 4 жыл бұрын
You have finally worked out current sensing is way better than infra red, problem is that at £14.50 a pop, I need 40 detectors, its just not an option to buy BD20's!
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
I wish they were cheaper. I first tried to use the generic ones and they just weren't sensitive enough and they couldnt pick up the train consistently. I will keep working on it.
@scottericcatalano596
@scottericcatalano596 4 жыл бұрын
There are CT modules on Amazon and eBay that work just fine for Nscale and HO scale....a few years ago I did the testing....I have pictures no video...it worked for DC and DCC just fine.
@TimberSurf
@TimberSurf 4 жыл бұрын
@@scottericcatalano596 I found this years ago thenscaler.com/?p=1080, but it was inconclusive! If you could share the type of sensor you used, we could work out the rest!
@scottericcatalano596
@scottericcatalano596 4 жыл бұрын
@@TimberSurf this is what I used arduino.cfnet.org/CT-COIL/DEMOLAYOUT-CURRENTDETECTOR-1.jpg
@TimberSurf
@TimberSurf 4 жыл бұрын
@@scottericcatalano596 Ok so you are measuring the AC, rather than the more complicated shield jimmy is showing!
@paulbarcham1356
@paulbarcham1356 4 жыл бұрын
Just looking at this video I do projects myself, but have not seen these before, been knocking ideas around my head on how to do dcc mcb cheaper. The question are these a standard arduino input device I. E the current is turned into a 0 to 5 vdc? As I think you could use these into the anlog input and have the out puts controling a relay with some compare logic to open the relay on a voltage raise over time or once limit reached. Please can you let me know and what they are called. Let you the out come if you are interested.
@wmjwell
@wmjwell 2 жыл бұрын
Hi Jimmy, thanks for the classes and I really enjoy them. Keep on making them. Please add me to the drawing. Thanks, Jim
@willmilberger5307
@willmilberger5307 4 жыл бұрын
Do you link your arduinos together, or do you have them seperate and categorize (lighting, sensors, loco and turnout), or a individual one and add a new one as you go?
@geofflarcombe3084
@geofflarcombe3084 4 жыл бұрын
Need to state this only works for AC current ? eg DCC Not for DC only layouts
@colintelfer2756
@colintelfer2756 9 ай бұрын
good video however being hard of hearing the music doesn't do it any favours
@jspupster
@jspupster 3 жыл бұрын
so you need a BD20 and an Arduino per block?
@DIYDigitalRailroad
@DIYDigitalRailroad 3 жыл бұрын
Yes, but I am trying to figure out better ways that are less expensive to accomplish this.
@swyntopia
@swyntopia 3 жыл бұрын
How many ampere is the threshold of this sensor ?
@DIYDigitalRailroad
@DIYDigitalRailroad 3 жыл бұрын
The BD-20 ranges from 0.1 to 20 amps. It’s a very solid detector.
@swyntopia
@swyntopia 3 жыл бұрын
@@DIYDigitalRailroad Thank you !
@ClinchfieldModelRailroad
@ClinchfieldModelRailroad 4 жыл бұрын
I must have missed something because I don't see where you mention how to hook up the wire going through the coil. Looks incomplete to me.
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
So that was representative of the bus wire going to the section of track.
@downunderDSB
@downunderDSB 4 жыл бұрын
Aarghh, just bought a handful of LED detectors - your video is a few weeks late! This solution is much better and less intrusive than LEDs poking up...oh well
@HelmutFischer-thehefi
@HelmutFischer-thehefi 4 жыл бұрын
Please! No Music while you are talking! I don't know why so much KZbinrs do that. Hate it!
@williambryant5946
@williambryant5946 4 жыл бұрын
Agreed I can't focus on what he's saying.
@Ax89
@Ax89 4 жыл бұрын
That was going to be my comment but you beat me to it!
@gravesclay
@gravesclay 4 жыл бұрын
It's called a lead in and is pretty standard in all media production.
@HelmutFischer-thehefi
@HelmutFischer-thehefi 4 жыл бұрын
@@gravesclay No. It's no lead in, when during the whole talking and therefore not common in good productions. And even it would be both, I still don't like it, because it is disturbing. I also don't want it in news on the radio. It's simple idiotic.
Arduino Model Railroad Crossing Signal With Current Sensing!
13:26
DIY and Digital Railroad
Рет қаралды 14 М.
Block Detection For Your Model Railroad (269)
22:00
Model Railroading
Рет қаралды 24 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 38 МЛН
NANO Precision Detector Update
19:37
Model Train Technology
Рет қаралды 7 М.
WOW! ⚡AC VOLTAGE⚡ Detector Circuit?! Can It Be?!
10:01
ElectroBOOM
Рет қаралды 2,7 МЛН
Hi Resolution Block Detector (Video #33)
16:48
IoTT
Рет қаралды 20 М.
Current Sensor Block Detectors (Video#38)
10:19
IoTT
Рет қаралды 6 М.
Cheap Block Detection for your Model Railway ?
17:43
Model Railroad Techniques
Рет қаралды 6 М.
Build Your Own Drone Tracking Radar:  Part 1
20:08
Jon Kraft
Рет қаралды 592 М.
LED Lights For Your DCC Locos (268)
26:01
Model Railroading
Рет қаралды 19 М.
DCC++EX: A Cheap DIY DCC System?!?! This is a Model Railroad Game Changer
17:54
DIY and Digital Railroad
Рет қаралды 89 М.
Easy Model Train Automation with an Arduino: Stopping and Starting a locomotive
15:13