Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've always wanted to try getting into iot and see if I can set up a small network of sensors each attached to one of these tiny low power boards and see if I could operate them using some sort of energy harvesting so they'd be mostly maintenance free.

If anyone more knowledgeable would like to share their insights or favourite ressources on the matter I'd be really interested.



MQTT is very good for this. I had a hairball of a raspberry pi setup driving a distillation process. I bought a ten pack of NodeMCUs (esp8266 but same basically) and moved all of the hardware off of the pi and distributed it across 4-5 of the little dudes. All comms were MQTT over WiFi and it worked great. (NodeRED was fantastic driving all of that, and i used Tasmota on the NodeMCUs, theres an ESP32 build for that.)

For low power you can obv turn off radio when youre not using it. Probably some simple way to sleep/shut it off completely as well.


BLE should draw less power. Wifi is too power hungry to run on batteries. I first bought two Shelly wifi sensors but then switched to Sonoff Zigbee enabled sensors because the wifi devices only send a couple of samples a day. BLE a better choice but unfortunately most consumer IoT BLE enabled sensors come with proprietary junk and encrypted protocols (Xiaomi, looking at you) most of them are not worth the hassle.


Most efficient & easy would probably be a nrf52840 (you can get the nrf52840dongle for $9, it has a wide voltage range and low power sleep modes and USB).

You can communicate over the 802.15.4 radio which is very low power compared to WiFi.

I'd use RIOT-OS, Zephyr has official support from Nordic, but that's what I'm familiar with: You can create a 6loWPAN network where each node gets an IPv6 address, they can communicate to the IPv6 world through a border router which would be another nRF52 Dongle where the USB serves as an USB-Ethernet Uplink that you plug into your router.

You could then use CoAP to send the data to a server somewhere (or just plain UDP) and sleep most of the time.


Do you know if similar modules working on sub-GHz bands exists ?


Dresden Elektronik and Embit have some sub Ghz modules, but Embit only supports Zigbee and different Atmel protocols, TIMAC and Wireless M-bus.

https://en.wikipedia.org/wiki/Comparison_of_802.15.4_radio_m...


There are single chip solutions like the SAM R30 but `samr30-xpro` is a bit more on the pricy side and I'm not aware of any cheap boards with the MCU.

You can use SPI Radios though (if you don't want to design a board yourself). CC1101 isn't IEEE 802.15.4 but if you don't want to talk to third party modules that shouldn't matter.

AT86RF215 is a dual-band chip with pretty good range, but besides the official (expensive) eval board, there is no ready-to-buy board. You could manufacture them yourself though. [0]

Of course there is also LoRa which would likely be enough for your use case. It just has a much lower frame size.

[0] https://github.com/maribu/at86rf215-breakout


I followed a project named parasite https://github.com/rbaron/w-parasite

I made a small MPPT solar harvester with a 0.47F supercap. This system reports soil moisture without using battery. It works even when weather is cloudy.

Hope this gives you some insight.


Would you mind sharing information about your MPPT system ?


The easiest way to go would probably be getting an ESP8266/ESP32 board and using ESPhome with it.


For low power communications I'd consider a 433 MHz module. Many places sell them. Here's one from Sparkfun [1].

To receive, you can buy corresponding modules but I wouldn't bother with that. Get an RTL-SDR dongle for whatever computer you want to process the data on (an RPi is great for this if you don't want to keep your desktop on all the time to do it), and use the program rtl_433.

The 433 MHz transmitter module simply sends a 433ish MHz continuous signal when its data input pin is high and does not send when the input pin is low. You encode your message into a series of pulses of the transmitter.

For example, for a project I'm doing using one of these transmitter modules I've currently got it on an Arduino for testing. Here's the Arduino code to send a message.

    #define CYCLE       1000
    #define W_0         600
    #define W_1         400

    #define INTRO_1     1500
    #define INTRO_0     1500

    void send_message(char * bp, int n)
    {
        digitalWrite(RADIO, HIGH);
        delayMicroseconds(INTRO_1);
        digitalWrite(RADIO, LOW);
        delayMicroseconds(INTRO_0);

        while (n-- > 0) {
            int b = *bp++ & 0xff;
            int m = 0x80;
            while (m != 0) {
                int w = (b & m) ? W_1 : W_0;
                digitalWrite(RADIO, HIGH);
                delayMicroseconds(w);
                digitalWrite(RADIO, LOW);
                delayMicroseconds(CYCLE-w);
                m >>= 1;
            }
        }
    }
That sends a message starting with a 1.5 ms pulse and a 1.5 ms gap, and then n bytes of data where a 1 is a 400 usec pulse followed by a 600 usec gap, and a 0 is a 600 usec pulse followed by a 400 usec gap, so 1000 bits per second after the 3 ms prefix. (The actual timing is a little longer, because of overhead).

My current test messages all start with "TZS", are 12 bytes long, and the last 2 bytes are a counter that simply increments every time I press a button. Adding this to an rtl_433 config file makes rtl_433 recognize those messages and print the count:

  decoder {
    name        = TEST,
    modulation  = OOK_PWM,
    short       = 424,
    long        = 624,
    reset       = 1500,
    sync        = 1528,
    bits        = 96,
    match       = {24}0x849083,
    get         = count:@80:{16},
  }
 
rtl_433 can then do a variety of things with the message, including saving to a file, sending to an MQTT server, sending to syslog, and sending to an Influx DB.

[1] https://www.sparkfun.com/products/10534




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: