Help make my fast minecart unloader more compact

I made a fast minecart-with-hopper unloader, intended for high-efficiency, extensive farms.

The proof of concept works - it unloads the minecart at 35 items per second, and the "core" is beautifully compact and quite trivial - using a "buffer" minecart with hopper. Instead of unloading the minecart with hopper directly into a hopper, I unload it into another minecart with hopper - this process is incredibly fast, and so the stop can be very short, then the first minecart returns to making its rounds collecting goodies along the track, while a normal hopper unloads the "buffer minecart" into a chest or other destination.

enter image description here

Problems begin with the "easy" part: stop the minecart for a moment for unloading and then start it again. My solution with repeaters and piston is ugly and expensive. It adds only 1s delay (20 ticks), unloading exactly 35 items.

enter image description here

Since checking the minecart contents without unloading it fully is not so easy, a longer delay would be nice - but not as nice as making this smaller (narrower!) and cheaper - as this is to be used with high-efficiency farms, it should be as narrow as possible to be tileable over multiple "instances" - and cheap to implement these multiple instances.

Can you help me make this more compact and cheaper without losing the speed?


Okay, I got something built that works nicely, here's how I built it.

First start with this start

Then remove the block with the rail on it, and add the required blocks to get here

first image Note: the piston is temporary, and normal

Then fire the piston to push the slab into the minecart hopper, then remove it and add the rails. second image note: the detector rail must be on a slope, and can't be replaced with another type of rail

Add the required redstone, and you're done! final build Note: you can replace the redstone torch with a block of redstone under the rail, or a lever, and if you replace the redstone dust with a repeater they can be placed side-by-side

Just run a minecart with hopper (or chest) in through the powered rail, and it will unload into the hopper below