I am curious how the machine knows how much you put on the
funnel where you throw the coins to open the toll gate...my guess is a load cell...or something like dimension detection.?..
They do a number of things...similar to how a payphone works....first, most machines run the coins through a magnetic field (to pull metal slugs out). Then they are tested for weight and size...
And some machines check the image on the coin too. To prevent using Canadian or Mexican coins for example. There are more tests but magnetism, size, and density are the most common.