It's not easy to say but people seem to have begun building ant farms in the mid nineteenth century. Until the mid 1800's, glass had been a fairly expensive commodity and certainly not something one would ?waste? on a child's toy. Until the development of the float glass process, most window glass had been produced by the cylinder method, invented by Sir Henry Bessemer in 1848. Nolten glass was formed into big cylinders which were slit open to make a flat (or flattish) sheet; no wonder it was expensive.
We don't have a name for the first person to layer some sand between sheets of glass to make an ant habitat but it was probably one of the gentleman naturalists of the Victorian period. These were of the sons of wealthy industrialist, who didn't want to follow their father's footsteps and would often spend their days studying nature or exploring. We have a lot to thank them for, as the undoubtedly contributed much to our understanding of nature. The first ant farms were call formicaries and were typically beautiful examples of Victorian workmanship. They were used for study in universities and museums.
In the mid-1950s the Pilkington company of England at last perfected the float glass method of manufacture that flat sheets of glass at last became available for building purposes and to the public at large. This enabled ant farms to be built from waste glass quite easily.
Simultaneously, a toy company based in Hollywood of all places, Uncle Milton Industries, began to market plastic ant habitats with great success. They gave the toy the name of 'Ant Farm' and protected the name by registering it. Half a century later the formicary has evolved into hundreds of ant farm models of many different types and sizes. Even NASA has got in on the act by developing an ant farm where the burrowing medium is not sand but a transparent nutrient gel. These are now widely available too. From the early formicaria of the gentleman naturalists to the space-age gel versions of today, the ant farm is as popular now as it ever was and the amazing activities of ants still hold us in thrall just as they did all those years ago.