INFRARED beams are to be used by ScotRail in an attempt to reduce overcrowding on trains.
The technology will be fitted to carriages to detect how full they are, so passengers can be diverted to empty seats elsewhere on the train. It will also enable the firm to add extra coaches to services when there is sudden high demand.
The devices will be installed above carriage doorways to count passengers as they cross the beams.
These can tell the difference between those boarding and alighting from trains, and also count the number of people moving between carriages.
The move comes as rail travel becomes increasingly popular, with ScotRail passengers rising by one third to 91 million a year in the last decade.
One in three of ScotRail’s trains are due to be fitted with the sensors within the next two years.
This will guide passengers to less-crowded carriagesSpokeswoman for ScotRail
Two fleets of trains being introduced by ScotRail’s new operator, Abellio, from 2017 will also have them.
Currently, some trains at busy times have carriages full to overflowing while others have plenty of spare seats.
The situation is made worse on longer, rush-hour trains, such as on the main Edinburgh-Glasgow line, because passengers cannot move from one half of the train to the other because they are formed of separate sets of carriages with no connecting corridor.
The new system would enable staff to more swiftly direct passengers to carriages with space before the trains depart.
Passenger numbers recorded by the beams will also be transmitted to ScotRail’s control room so staff can react quicker to surges in demand, adding additional carriages to later services.
A spokeswoman for ScotRail said: “The new passenger counting system will calculate how busy trains are.
“This will in turn help us guide passengers to less- crowded carriages where there’s more chance of getting a seat.”
The innovation was applauded by passenger watchdogs. Mike Hewitson, head of policy for Transport Focus, said: “Passengers welcome the introduction of new technology where it helps improve their journey experience.
“Being able to better match passenger demand with available carriages may help to reduce crowding.”
The move comes a decade after a previous ScotRail operator trialled using sensors which calculated how full trains were by measuring changes in air pressure.
The electronic equipment was attached to the carriages’ suspension.
Gateshead firm Petards, which installs infrared technology on trains, said “train occupancy and passenger distribution is a major issue” for operators.
It added: “The use of passenger counting data allows train operators to optimise their fleet deployment.
“Over and under-occupancy journeys can be avoided by setting timetables and routes that match the measured passenger demand.”
Petards will supply the devices for new trains on the east coast main line between Scotland and London from 2019.