How can I make an empty cart make scheduled stops without changing elevation?

I made this simple Redstone circuit that allows a Minecart to go around the track while making a simple stop. Sadly, it needs to change elevation so the Powered Rail knows where to send the Minecart after activating it.

How can I do the same thing without changing the elevation of the track?

enter image description here enter image description here


Solution 1:

I've managed to design a "through" station, basing on a fairly simple slimeblock contraption:

enter image description here

This substitutes a segment of rail behind the powered rail with a solid block. Add power to the powered rail, and off you go. Don't forget to inlay the area around the slime blocks with non-sticky blocks (obsidian, droppers/furnaces, or glazed terracotta.)

enter image description here enter image description here

Solution 2:

This should do what you want:

enter image description here

The main track is shown as powered rails here. It could also be straight, but by putting the circuit at a corner, the wiring gets neater for the screenshot.

When the minecart drives onto the intersection rail piece, it goes straight onto the circuit. When it drives over the detector rail, it switches the intersection, but that doesn't matter, and it starts the timer for the powered rail. It then stops at the powered rail.
When the timer arrives at the powered rail, the minecart starts again. It drives over the detector rail, which starts the timer for the powered rail again, but that doesn't matter*, and flips the intersection, causing it to continue to the right.

*It might be a problem if another minecart can go there again soon, then you should put a "flip-flop" element and a pulse shortener into your circuit so that the rail only gets powered on every second signal. Alternatively you can use a pulse divider (archive), I don't know which way is easier. I would guess that something like inverting the signal, putting redstone above two hoppers facing each other with one item inside and taking a comparator output from that is enough, but I have not tested that.

Depending on how the rail connects by default, you might need a redstone torch to invert the signal.
You can also turn the input into the intersection on permanently (or off, if it inverted) to let the minecart usually go around without stopping, and only unpower (or power) it whenever you actually want to stop.

Disclaimer: I used Java edition to make this circuit. The timings are probably a bit different in MCBE, but then you just need to lengthen or remove the first repeater.