Do need to use sonar sensors or can you just you IR sensors? 22, why so many?
That many sensors will require either a shift register(s) or an arduino mega. And even then you won't be able to run all the sensors at once, so your probably better off using 1 or 2 and point the sensor into the bin. If you point the sensor inwards, you can take a reading of how close the objects are to the sensor.
Empty bin = larger number
Full bin = very small number.
How far apart are they? I'd be a bit worried about long cable runs picking up noise.
You might decentralize a bit by having groups of (say) 10 sensors hooked up to an Arduino, and using serial comms to send the results to somewhere else.
We have about 22 grain bins were I would like to do a level sensing, 8 bins are within 40' of each other, 14 are in a cluster about 150' from the plc control system.
My thought was to read each bin perhaps only once every 2 or 3 minutes (i don't know if it is possible to increase sensing time when the reading changes) and have the board go to call each sensor for data?
Is this possible, who can write a program to do this? I am willing to pay!
These sonar sensors don't use a serial protocol or any kind of addressing. Just a high pulse on one pin and a return pulse on the other. If you want to use multiples, you'll need a pair of pins for each sensor, or a driver board for each sensor that will let you use a serial protocol.