This is a fairly crude falling sand simulation. Could be made more realistic... it only simulates the one grain that is being dropped at any time - it doesn't simulate all the grains already in the pile and the avalanches that happen when the size is too large and the slope too steep. I wrote it as the first hack at writing a somewhat realistic sand timer...
Needs a simulated sand fall that matches the rate of accretion. It's better to fake this with clones than to draw each dropping grain, which would slow the simulation down considerably.