HANDING a farmer a fistful of magic beans with the promise that they will improve his business might sound like something out of a fairy-tale. But, as Arthur C. Clarke put it, any sufficiently advanced technology is indistinguishable from magic. The sensor-filled “beans” developed by Andrew Holland, an electronics engineer from Swaffham Bulbeck, near Cambridge, England, are not only advanced technology. They could also, Mr Holland says, provide an answer to many a farmer’s prayers.

Mixed into the contents of a granary, his beans would report continuously on the temperature and humidity, both of which encourage rotting if they are too high, and on carbon-dioxide levels, which reflect the amount of insect breath exhaled, and thus the level of infestation. At the moment these things have to be measured (if they are measured at all) using hand-held instruments that are plunged into the grain pile at regular intervals by farmhands.

The beans themselves are plastic shells 45mm long and 18mm wide, manufactured by 3D printing. This process is used to encapsulate within each bean a diminutive circuit board containing a low-power Bluetooth radio and sensors that can measure motion, temperature, humidity, air pressure and the concentrations of several gases, including carbon dioxide and carbon monoxide. A bean also contains an electronic compass and a tiny gyroscope that, acting together, sense its orientation. All of these devices are powered by a wirelessly rechargeable battery.

Mr Holland sees potential for his device beyond the monitoring of stored crops. Placed discreetly in a living room or office, he suggests, it could register intruders via the trembles of its motion sensor. A change in air pressure brought about by blowing on it might let it work as a switch for a room’s lights. The gyroscope would permit it to act as the remote control for a television or hi-fi: swiping a bean through the air could turn the device on, while spinning it in a circle could step the volume up or down, depending on whether the spin were clockwise or anticlockwise. For the elderly, a bean carried in a pocket could register a fall and then call for help via its owner’s phone. For the suspicious, it could record whether a parcel had been mistreated in transit by being heated up or crushed.

That beans would be better than existing ways of doing these things is not always obvious. But they will be programmable via a phone app, so owners will be able to devise other uses as they see fit.

Grain-monitoring, though, is likely to be the first use. Once placed in and around a heap of grain, a collection of the beans will connect together wirelessly, becoming nodes in a network that gives a clear, three-dimensional picture of what is going on inside that heap. Mr Holland’s company, RFMOD, has just started testing beans for this purpose, and he hopes they will be commercially deployed within two years.

One problem is recovering the beans when the granary is emptied. If they became a routine technology this could, no doubt, be done by “pinging” them when a shipment was sorted at the wholesaler, and pulling them out automatically as the grain left a hopper. In the meantime, RFMOD is experimenting with putting them in the plastic insect-trapping containers that farmers already deploy in grain-piles to keep infestations under control.

If the beans do well at monitoring grain, Mr Holland hopes their other applications will make them an important part of the much-discussed “internet of things” which some prophets believe will, in the future, link many objects not currently connected electronically. If his own wildest dreams are fulfilled, that would make RFMOD a large and successful company. It might also suggest that Swaffham Bulbeck, a tiny village, has its own brand of magic to confer, for it was also once home to another startup, Advanced RISC Machines Ltd. ARM Holdings, as that firm is now known, has grown into one of the world’s biggest designers of microprocessors. In Silicon Valley, they do it in garages. In the English fens, it seems, old barns are just as good.