Low-cost sensors and gateways