current sense chip: will it work? - Page 1
Forum section: electronics / beginners

author: skeeterweazel
author_rank: Newbie
timestamp: September 18, 2024, 02:07:44 am
content: Hello. Newbie here. Have some questions i'm hoping you can help me with.And feel free to suggest better ways to do this.I'm helping some retired guys who are building a big outdoor railroad. My current project is figuring out how to sense when a train is in a certain section of track or "block". These are large trains. We expect them to draw about 10 amps and 32 volts. I'm hoping i can sense the first amp as my "trigger."I want to try and go the route of using a shunt and a comparator ( or 2 or 3). I've come across mentions of a Texas Instruments chip that sounded good, then stumbled across another that sounds better.I'm looking at the ina250. Biggest plus i'm seeing is that it has a built-in shunt. But i don't understand the datasheet enough to know if it will work for me; things like offset voltage.https://www.ti.com/product/INA250I've never played with a comparator or op-amp. I'm of the understanding that the output is either high or low, that it can be used as a trigger, in this case i want to connect it to an arduino to trigger signal lights.The INA303 has more functions, like alerts, but i don't know if i need those. And it doesn't have a built-in shunt.So, that's where i'm at. Hoping someone that is knowledgeable can check out the data sheet and let me know if it will/will not work.Thanks for any info you can send my way.Marty

author: ataradov
author_rank: Super Contributor
timestamp: September 18, 2024, 03:18:57 am
content: If you just need to sense the presence of the current / train, then you don't need to worry about offset voltages, it will be fine. You need to worry about them if you plan to digitize that voltage and need an accurate absolute current measurement.Those INAxxx current sense amplifiers are great. I have not used the integrated ones, but just the amplifiers are hard to beat.

author: PGPG
author_rank: Frequent Contributor
timestamp: September 18, 2024, 11:56:33 am
content: Your solution has no isolation. You in theory have voltage not exceeding INA250 range. But it is outdoor.When lightning strikes few km (or closer) from your installation you should expect up to 50V voltage difference between several grounding points inside the same building and several kV difference between grounding system of different buildings (or anything being outdoor).Because of this I would certainly opt for isolation.I would start from trying if Hall-effect sensor touched to 10A wire will give me enough signal.There are lot of them (in TO-92). Probably some are linear and some have a field threshold set.This with field threshold can have this threshold too high to notice 10A wire, but there are probably lot with different thresholds.Linear are probably classified by sensitivity and I would expect that such with high sensitivity would give me enough signal. May be the wire isolation need be taken off (but we still have isolation) to allow for smaller distance between wire and sensor.There are also sensors (like SO8 with piece of metal seen) that have sensor internally touched to high current wire. It still gives you isolation.There are also sensors with ferrite round core integrated so you just pass your wire through the hole in the core. This are certainly more sensitive.If I would fail with Hall-effect sensors (or found that very expensive one is needed) I would then check how many 10A wire coils on reed switch is needed to activate it (I expect 2..4 coils). This solution will also give me isolation not inserting in wire extra resistance.

author: MarkF
author_rank: Super Contributor
timestamp: September 18, 2024, 01:04:28 pm
content: I'll offer you my solution for block-detection on my HO model railroad. It works with a combination of either PWM or constant DC power depending on slow or fast speeds. PWM for slow speed responsiveness. I used a diode to detect the current instead of a shunt because of the lower (and reduced variation) voltage drop for a diode.If your track power is AC (has a negative component) this is NOT going to work for you.

author: ledtester
author_rank: Super Contributor
timestamp: September 18, 2024, 01:06:47 pm
content: This video starting at 15:29 discusses some Hall-effect current sensors that are frequently used by hobbyists:460 Seven Sensors tested: Measuring Current with Microcontrollers (Arduino, ESP32, ESP8266) -- Andreas Spiesshttps://youtu.be/Cg-4GjLeeAI?t=15m29s

author: zapta
author_rank: Super Contributor
timestamp: September 18, 2024, 02:15:33 pm
content: +1 for isolated current sensor as others said. There are many to choose from.https://www.digikey.com/en/products/filter/current-sensors/525?s=N4IgjCBcpgnAHLKoDGUBmBDANgZwKYA0IA9lANogAMIAugL7EC0E0IakWeRpFIAbACYaDZgFZk7DDgLEykSoLqMQTJGw4AXAE4BXHvMoQGKpQva7t2-ADtNAAgI2CdYv0kBLACZRVYKhDEAA6aviDEmgCeQfi%2BmLho9PRAA

author: skeeterweazel
author_rank: Newbie
timestamp: September 18, 2024, 06:10:39 pm
content: I looked through the data sheets on a couple of the isolated current sensors via the link. I didn't see, or missed, the capability to set the "trigger" amperage, and if they output a High/low logic voltage.Thx for your replies.Marty

author: BeBuLamar
author_rank: Super Contributor
timestamp: September 18, 2024, 10:29:20 pm
content: Quote from: skeeterweazel on September 18, 2024, 02:07:44 amI am not sure what you want to do. You want to measure current in the rail at different section?

author: ledtester
author_rank: Super Contributor
timestamp: September 18, 2024, 11:28:20 pm
content: Quote from: skeeterweazel on September 18, 2024, 06:10:39 pmMost output a voltage representing the current. You would have to add a comparator or sample the voltage with an ADC (like with a microcontroller).This is not a bad intro to comparators (or op-amps used as a comparator):Comparator tutorial & clapper circuit -- Afrotechmodshttps://youtu.be/y0Q0ERSP24A

author: langwadt
author_rank: Super Contributor
timestamp: September 18, 2024, 11:46:44 pm
content: Quote from: ledtester on September 18, 2024, 11:28:20 pmnot very breadboard friendly but, ..https://www.lcsc.com/product-detail/Current-Sense-Amplifiers_Texas-Instruments-INA381A2IDSGR_C2155688.html

author: skeeterweazel
author_rank: Newbie
timestamp: September 18, 2024, 11:58:17 pm
content: BeBuLamar : basically, i guess that's what i'm doing. When a train comes into a block it will draw current. I need a way to sense when current is used so i can turn on/off signal lights.ledTester: that link doesn't work.Thx.Marty

author: ledtester
author_rank: Super Contributor
timestamp: September 19, 2024, 01:41:33 am
content: Quote from: skeeterweazel on September 18, 2024, 02:07:44 amHow big are your trains?Have you considered other detection mechanisms, such as optical proximity sensors or inductive sensors?For instance, here is an idea for sensing a model train:https://www.iascaled.com/store/CKT-IRSENSEFor instance, a current sensor will detect if the train is on a particular section of track AND it is moving. Another thing to consider is that proximity sensors can be placed anywhere on the track without regard to how the track is divided into circuits.

author: BeBuLamar
author_rank: Super Contributor
timestamp: September 19, 2024, 10:43:00 am
content: Quote from: skeeterweazel on September 18, 2024, 11:58:17 pmSo you mean each section of the track is electrically isolated from eachother? You mean you have to have wires to each section separately and not just to the whole rails? I am asking because I am not familiar with model train.Any way the chip is an ampifier designed to amplify the very small voltage produced by the current shunt.

author: MarkF
author_rank: Super Contributor
timestamp: September 19, 2024, 12:47:21 pm
content: Quote from: BeBuLamar on September 19, 2024, 10:43:00 amIt depends...Most new layouts use some version of DCC. In which each locomotive has a decoder inside and is individually selected from the hand throttle. In a DCC layout the whole track is connected together (as in one big data bus) where power and data is transmitted down the rails. People have multiple connects to the track in order to reduce power loss. Locomotive speed is determined by a command from the hand controller and not its position on the track. More realistic operation. Locomotive can also be combined into a consist and operate together (ie two, three or more locomotives at the from of the train).'Old school' layouts divide the track into blocks and each block is powered independently. There is no decoder in the locomotives and the speed of each locomotive depends on its location on the track and the voltage in that block. If you want to operate multiple locomotives, you must keep each locomotive separated into a different block. If two locomotives are in the same block, you don't have independent control of each one. This is how I operate my layout. The layout is currently divided into 15 isolated blocks/track sections.

author: zapta
author_rank: Super Contributor
timestamp: September 19, 2024, 04:00:25 pm
content: Here is a circuit idea. The current sensor is not pass through so you don't need to deal with the high currents through your PCB. Insteead attach it to a high current wire in the proper orientation with cables ties or something similar. The board has three wires, two for supply (3.3V or 5V) and one for digital output (high when active). I didn't not include bypass capacitors on the power rails.The operation of a comparator is very simple. Its output is VDD when the positive input is higher than the negative (even a little bit) and GND otherwise. The circuit includes a low pass filter that is recommended in the datasheet and a feedback resistor for some hysteresis.

author: ledtester
author_rank: Super Contributor
timestamp: September 19, 2024, 04:54:56 pm
content: Just saw this...Quote from: skeeterweazel on September 18, 2024, 11:58:17 pmHere is a fixed link:Comparator tutorial & clapper circuit -- Afrotechmodshttps://youtu.be/y0Q0ERSP24A

author: skeeterweazel
author_rank: Newbie
timestamp: September 23, 2024, 06:17:24 am
content: Quote from: zapta on September 19, 2024, 04:00:25 pmI'm liking this the more i look at it. Could you point me in the direction of an explanation of the circuit?Can the sensing chips be "over powered" with too many amps? I'm looking to only sense the first amp, but wire may have more than 10 amps at times. Does that hurt the chip?Thx.Marty

author: Ian.M
author_rank: Super Contributor
timestamp: September 23, 2024, 07:11:11 am
content: I cant help thinking you all are over-thinking and over-engineering this.What about a current sensing relay consisting of a large (38mm x 5mm body) reed switch with several turns of the track section supply wire round it? Reed switches that pull-in roughly in the 10 to 20 Ampere Turn range are readily available, and with a ten turn coil round them that would pull in at an amp or two in either direction. If the track supply is PWMed, it would be advisable to 'slug' the relay by having a conductive sleeve round the reed relay under the coil, to sustain the magnetic field through the PWM off time to avoid fatiguing the reed contacts. This could be a copper or aluminum tube as a coil former or a turn of copper tape directly on the reed switch body, with the seam soldered.For a DCC layout this simple setup is less attractive as the relatively high frequency (at least in terms of electromechanical stuff) AC supply makes it difficult to get a good sustained field round the reed switch. It could be worked around by using a bridge rectifier to effectively feed the coil DC, but that adds two diode drops in the track feed so other methods are more appropriate, such as one of the many Hall effect current sensors others have suggested.

author: PGPG
author_rank: Frequent Contributor
timestamp: September 23, 2024, 08:37:31 am
content: Quote from: Ian.M on September 23, 2024, 07:11:11 amThis solution was already mentioned in my first post:Quote from: PGPG on September 18, 2024, 11:56:33 am

author: Ian.M
author_rank: Super Contributor
timestamp: September 23, 2024, 11:54:35 am
content: I missed that. However my first preference would be reed switches (assuming no future plans for DCC) vs it being your last resort . . .

author: PGPG
author_rank: Frequent Contributor
timestamp: September 23, 2024, 12:36:13 pm
content: Quote from: Ian.M on September 23, 2024, 11:54:35 amI prefer to avoid any mechanical contacts even working in such perfect conditions as reed switch has inside.I also assumed that gluing Hall-effect sensor to the wire isolation (I hoped that for 10A it may be enough to notice this current) is simpler than making a coil on reed-switch that probably has to be made with different wire that is normally used so the wire will have to be cut and connected to coil.