simple latching and reset circuit - Page 1
Forum section: electronics / beginners

author: dummykid
author_rank: Newbie
timestamp: August 28, 2025, 03:23:20 pm
content: Hi guys.Its been some 30yrs since using electronics with my job in engineering control panels etc. Still have my breadboard from experimenting days with transistors/diodes etc switching relays etc.I am currently building a model railway for my grandson.Wanting to build a 'points position indicator'.This basically using a DPDT, (On)-Off-(On) spring return switch. The switch energises the points solenoid switching the points.Wanting to use the switch to illuminate and latch a red led showing the position of the points.When changing the direction of the points with the switch. this unlatches the red led and latches a green led.I have some 10 points around the layout and the 10 switches being mounted on a control panel at position on a layout plan along with 3mm dia led's red/green at each point.A 'Points Position Indicators' could be purchased for a price, but wishing to build my own.Appreciate any help of a circuit and parts needed from todays availability.

author: ledtester
author_rank: Super Contributor
timestamp: August 28, 2025, 03:51:01 pm
content: These days most digital logic that used to be implemented with logic ICs is done with a microcontroller.I found this page which has (low resolution) pics of commercial point indicator systems:https://www.heathcote-electronics.co.uk/point_indicator.htmland there is this video:See how your Points are Set -- Heathcote Electronicshttps://youtu.be/FdfYuyOye3EThe board in the video (which is also the first board on the product page) only consists of two ICs - the yellow chips are resistor arrays. Moreover, it says it has a "memory" which remembers the state of the switches when the power is off. I heavily suspect that one of the chips is a small microcontroller.Update: I also found this... I think it's just a latching relay:https://modellingelectronics.co.uk/products/single-points-position-indicator-module/

author: themadhippy
author_rank: Super Contributor
timestamp: August 28, 2025, 03:57:15 pm
content: my over complicated method would to use a 2 input OR gate (2 diodes) a D type counter and an inverter, something likeshttps://tinyurl.com/29zl5ofb

author: ledtester
author_rank: Super Contributor
timestamp: August 28, 2025, 04:09:26 pm
content: This one uses a PIC microcontroller:https://www.microminiatures.co.uk/product/points-position-indicator-with-3mm-bi-coloured-red-green-leds-resistors/

author: Uunoctium
author_rank: Frequent Contributor
timestamp: August 28, 2025, 04:12:51 pm
content: a minor disadvantage of the flop solution is - at every powercycle the last state is lost. I would recommend an bistable relay w two coils.

author: PGPG
author_rank: Frequent Contributor
timestamp: August 28, 2025, 04:28:59 pm
content: Quote from: themadhippy on August 28, 2025, 03:57:15 pmWhat for inverter if you have Q and notQ outputs?

author: themadhippy
author_rank: Super Contributor
timestamp: August 28, 2025, 04:36:00 pm
content: QuoteDohActually i thinks were all over complicating things,a simple switch controlled by the point motor for examplehttps://derails.co.uk/peco-pl13-accessory-switch

author: dummykid
author_rank: Newbie
timestamp: August 28, 2025, 04:37:19 pm
content: Thanks,I am aware of these 'Points Position Indicators' and other commercial products.As said I want to build my own as a project with my grandson involved.thanks again

author: pqass
author_rank: Super Contributor
timestamp: August 28, 2025, 05:16:08 pm
content: I'm not a RR guy. But I think this what you mean...A momentary DPDT (back to center) pulses one of two mutually exclusive solenoids and also triggers the position indicator which remembers the last triggered.Solution:Just use an RS latch with LEDs on Q and /Q outputs.- can use any NAND or NOR pair of gates whichever is more appropriate for the input signal polarity. See below (simulationhere).- can make one with two transistors and some passives (shown below).- can also just use cheaper momentary SPDT (back to center) but you'll have to add protection from the higher voltage solenoid power and the spikes it generates (not shown).EDIT:See below for a transistorized schematic (simulationhere); both PNP or NPN versions depending on how you wired your solenoids (may need to play with the 100K resistors).The advantage is that you can tailor it to your solenoid supply voltage (not deal with TTL or ICs).If you go with SPDT vs DPDT switches (as shown), you'll need diodes into the transistor bases to prevent voltage back-fed from the solenoid common rail.

author: David Hess
author_rank: Super Contributor
timestamp: August 28, 2025, 06:56:33 pm
content: pqass posted what I was thinking of, a set-reset latch or flip-flop.With some cleverness using a CMOS set-reset latch or flip-flop and small power MOSFETs to drive the LEDs, a 3 volt lithium cell can backup the CMOS logic so state is not lost when power is removed. The CMOS logic by itself will draw less than the leakage current of the battery.

author: dummykid
author_rank: Newbie
timestamp: August 28, 2025, 08:36:41 pm
content: Forgot to mention if of any help with my post.The point motors are switched using a 'Capacitor Discharge Unit' from one side of the DPDT and intended the otherside of the switch for led operation.Also in theory, I saw the latching and resetting etc. being done by when changing the points direction via the switch.Rummaging through my box electronics bits, got loads of resistors and 8/16 pin ic sockets.

author: Zero999
author_rank: Super Contributor
timestamp: August 28, 2025, 09:23:30 pm
content: Quote from: David Hess on August 28, 2025, 06:56:33 pmA latch can even be made with discrete components and battery backup provided by a diode and bias resistors. It isn't as low power as an IC but it should still be acceptable. If low enough threshold MOSFETs are used, change D3 to Schottky, say BAT54 and use a 1.5V AAA alkaline cell.

author: pqass
author_rank: Super Contributor
timestamp: August 28, 2025, 10:43:52 pm
content: I was wondering what a "capacitor discharge unit" was and found the attached. Basically, it pulses the solenoids with just enough energy to slam the lever one way or the other without drawing a constant high load on the supply.The down-side to the method proposed so far (SR latch/FF) is that the LED indicators will go out-of-sync with the solenoid position after a power-up (occasionally even with battery backup if the lever is moved manually). But this can be mitigated with an exercise of all switches after power-up (ie. part of a user startup procedure).The only truly bullet-proof way to keep the LEDs consistent with the position of the lever is, if possible, to use a micro-switch physically attached to the lever (should it be moved manually). See attached but with a better switch. There's no need to make the overall solution complicated.I've been assuming that the LEDs are placed at track-level near the solenoids.

author: PGPG
author_rank: Frequent Contributor
timestamp: August 29, 2025, 07:28:46 am
content: Quote from: pqass on August 28, 2025, 10:43:52 pmThere exists very small micro switches. For example (4x6mm):https://industrial.panasonic.com/cdbs/www-data/pdf/ATB0000/ATB0000C12.pdfI think it can be used (practically invisible at rails) to detect point position being pushed by any moving part.Of course you can use some bigger one, probably being more robust in this application.

author: pqass
author_rank: Super Contributor
timestamp: August 29, 2025, 01:45:44 pm
content: You don't have to buy a super small micro-switch. Any cheap one will do.Just flip the switch on its side and use a sliding block (glued to the rod) to engage it. See attached.It will provide minimal resistance to the solenoids.Both the green bracket and yellow sliding block can be made of hardwood.

author: xvr
author_rank: Frequent Contributor
timestamp: August 29, 2025, 02:14:00 pm
content: 4 RS latches in one IC - 74HC279

author: Zero999
author_rank: Super Contributor
timestamp: August 29, 2025, 02:29:52 pm
content: I wondered whether the latch with battery backup could be implemented with two BJTs and a single alkaline cell. The answer is yes, but it requires more components, because the transistors' bases need a lot of current so extra diodes are needed to switch between two sets of resistors: four when the power is on and another four for back-up. It isn't as good, because the LED won't completely turn off as the base current for the other transistor passes through it. That could be solved with another resistor in parallel with the LEDs but it's more parts.

author: xvr
author_rank: Frequent Contributor
timestamp: August 29, 2025, 04:26:36 pm
content: Latching 2 coil relay will be the best solution. Simple, with memory and without any extra circuitry.https://www.mouser.ie/c/electromechanical/relays-contactors-solenoids/general-purpose-relays/?coil%20type=Dual%20Coil%20Latching&relay%20contact%20form=1%20Form%20C~~1%20Form%20C%20%28SPDT-NO%2C%20NC%29&instock=y&rp=electromechanical%2Frelays-contactors-solenoids%2Fgeneral-purpose-relays%7C~Relay%20Contact%20Form&sort=pricinghttps://www.lcsc.com/product-detail/C190458.html?s_z=s_Relays%257CMagnetic%2520Latching%2520Relays

author: Ian.M
author_rank: Super Contributor
timestamp: August 29, 2025, 04:38:33 pm
content: I beg to differ. Any memory scheme that does not sense the physical point lever position risks the indicator getting out of sync with the points position. If position sensors are not fitted, surely it would be preferable *NOT* to illuminate either indicator LED until the operator has initially set the points position, and thereafter indicate its position?

author: SteveThackery
author_rank: Super Contributor
timestamp: August 29, 2025, 04:47:13 pm
content: I disagree with almost all of the responses so far. Why? Becausethey don't detect the actual position of the points. S-R flip-flops lose their memory after a powerdown. Latching relays can only remember (and report) their own state. That might differ from the state of the points.If - for any reason - the points stick or otherwise fail to operate correctly, the LED will report the wrong state.I'm not familiar with model railway stuff, but the only way to do this properly is toread the actual state of the points. Not an intermediate flip-flop or relay.@dummykid: I think the most interesting (and properly engineered) solution is for you and the grandson to examine a set of points and together come up with a way to monitor their position. Perhaps a micro-micro-switch, as already mentioned, or some other mechanism. It will be a fascinating little project.EDIT: Ah, I see Ian.M has posted the same thing - just beat me to it!

author: Zero999
author_rank: Super Contributor
timestamp: August 29, 2025, 05:00:06 pm
content: Quote from: SteveThackery on August 29, 2025, 04:47:13 pmI agree. I just wanted to have fun posting a simple bistable with battery backup.There might be a way to monitor the position of points without an additional switches or sensors. If the points consist of two coils with an armature which is pulled into a coil, when energised, then that coil will have a higher inductance, and therefore AC impedance, than the other one.

author: David Hess
author_rank: Super Contributor
timestamp: August 30, 2025, 12:59:08 am
content: The old O-gauge switches from Lionel automatically switched for incoming trains to prevent derailing and indicated current switch status, but this relied on having 3 rail track.

author: Analog Kid
author_rank: Super Contributor
timestamp: August 30, 2025, 02:11:30 am
content: I'm a wannabe model railroader; have never actually built any trackwork, but have read up on it.Don't most switch machines include electrical switch contacts that give the current position of the turnout?