Abstract:The fact that during the rush hours people usually get on the subway trains from the boarding points near the stairs and escalators often results in uneven distribution of passengers to each subway carriage. In response to this issueꎬ a carriage selecting system is designed to monitor passenger flow in and out of the carriage each time with two pairs of infra ̄ red sensors and two pairs of ultrasonic sensors.STM32F103 single-chip processing system counts the number of people in each carriage and send the data to the USART HMI serial display screen at the boarding points for the waiting passengers to choose less crowded carriages. This system can avoid passengers′ randomicity when choosing boarding points of railway vehicles and alleviate imbalanced passenger distribution among carriages.