This low range sensor is widely used on robotics. The datasheet of CNY70 can be found on the Vishay website.
Hier I show how to connect a CNY70 sensor in order to obtain an analog otput proportional to the observed colour.
Nowadays almost all the H-bridges are based on MOSFETs, but some time ago it was not always like that. Here some about old school electronics with relays.