1btn is a Battery Powered Open Source ESP8266 WiFi Button

If you have some WiFi power switch like Sonoff TH16 at home, you’d normally control them using a mobile app or a web interface. This is all good, but getting your phone, unlocking it, and launching the app to turn on or off an appliance is not the most efficient way to operate, and in some cases, some people in the household may not know how to use a smartphone. Physical WiFi buttons are the solution, but there aren’t so many for sale. We’ve seen previously it was possible to hack an Amazon Dash, but it’s not really that flexible, and 1btn could potentially be a better option, as it’s open source and based on Espressif ESP8266 WiSoC.

1btn specifications:

  • WiFi Module – ESP-12F based on Espressif ESP8266
  • MCU – Microchip Atmel ATmegaxx8 AVR MCU
  • Connectivity – 802.11 b/g/b WiFi up to ~50 meter range
  • USB – 1x USB port for charging and programming (via on-board USB to Serial chip)
  • Misc – User button, multi-color LED, power on/off switch
  • Expansion –
    • AVR MCU – 2x 8-pin headers with ADC, I2C, SPI, RESET, 3.3V, and GND signals
    • ESP8266 – 1x 8-pin header with GPIO, Tx/Rx signals, 3.3V and GND signals
  • Battery – Rechargeable 3.7V/500mAh battery
  • Dimensions – Around 60 mm side to side
  • Weight – ~50 grams

The hardware design files, mechanical design, and NodeMCU (Lua) based firmware can all be found on Github, releases under an MIT license. The button can be used to send an email, text message (via Twilio SMS), or a tweet, as well as invoke an URL action allowing to use all sort of APIs and services such as IFTTT.

The Atmel MCU is used to keep battery life under check, as the button will only connect to WiFi then you press the button. It takes about 5 to 7 seconds to wake up from sleep, and send the message, after which the button goes back to sleep. The battery will last around 300 presses before it needs to be recharged, or about 5 months if you use the button twice a day.

1btn sells on Tindie for $40 plus shipping. That’s a little more than expected, so tried to look for alternative beside Amazon Dash, and I found “ESP8266 IFTTT WiFI Button Dev Kit” – aka Abutton – on Aliexpress going for $13.43 shipped. The button can be re-programmed with custom firmware, and is based on Apixel  ESP8266 dev board with an ESP8266, but no MCU, so it has to rely on ESP8266 low power mode, meaning battery life is likely to be quite lower than 1btn. Talking about batteries, there are none, and instead there’s a compartment for 2 AA batteries. The Arduino or NodeMCU source code for Abutton can also be found on Github.

Click to Enlarge

WiFi is not exactly the ideal wireless solution for this, that’s why Bluetooth buttons are much more common, and quite cheaper, so maybe having a ESP32 wireless power switch with WiFi and Bluetooth, plus a BT button would be both a better and cheaper solution. The only problem is that AFAIK ESP32 wireless switches don’t exist right now, except in board form factor, and not in a neatly packaged product like the Sonoff switch.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus

17 Replies to “1btn is a Battery Powered Open Source ESP8266 WiFi Button”

  1. 433mhz devices are much better suited for this purpose. I currently use an arduino based device programmed with the rflink firmware (http://www.nemcon.nl/blog2/). EV1527 remote controls don’t consume any power at all until they are pressed, so batteries should last longer still.

    Itead has a rflink device just out (I am waiting for one), there are details on their wiki already (https://www.itead.cc/wiki/Sonoff_RF_Bridge_433). I reckon this will be an ideal already built solution. I am looking forward to hacking the firmware on it. Should be easy too with programming headers and good documentation.

  2. @cnxsoft

    This is true. I guess your level of paranoia would vary though with the application. For non critical tasks rf I think is absolutely fine. You would need an attacker to be nearby, aware of the use of RF and have an understanding of what effect the RF signal was having (i.e. feedback). Even then, how much do you care if someone operates your lights?

    If you were using the RF to enable a lock or something of that ilk, perhaps you should look at something more secure.

  3. Don’t forget rf is fire and forget. There is no confirmation that the signal you sent has actually been received. Big disadvantage over protocols like WiFi(MQTT) or Zwave.
    Just my .02$

  4. > I guess your level of paranoia would vary though with the application.

    Dude, R U nutz? Heard something about recent worldwide ransomware waves? Next step is your 433MHz house which will flash your lights, flush your toilet, play imperial march on your window curtains and ask for some “donation”.

  5. A small soldering and push button will do
    And will work even with out internet.
    This solution will not work with out internet.

  6. Great. But if you are remotely interested in security, latency, range, data transfer and battery life then read on.

    I’d like to have my house setup with sensors and buttons. The current solutions are quite impractical. The only real contender I’ve found is Bluetooth 5.

    Power hungry, good range, encrypted, authentication. Generally a bad idea if you wifi pass code sits on garden sensor for example, or door bell. An attacker could take these and have access to your network. Advances have been made in battery life but its still not that great. Possible full access to WAN (Do you want your Chinese IoT device access to your network and WAN?).

    433 devices:
    No security, no encryption, no authentication. Good range. Battery life is okay. But an attacker could easily mess around with all your devices using a few off the shelf items costing $8. Data transfer sucks. Restricted number of devices. No standard of communication between devices. Communication is normally unidirectional (one way).

    Has authentication. Has encryption. Good range with BLE 5. Data transfer is brilliant for all for IoT. Restrict access to WAN per device if needed. Tokenized authentication means you can revoke per device if it gets stolen. Battery life? Look at BLE, months of battery life. No access to your network. BLE 5 supports many devices. Bidirectional comms.

    Bluetooth is the clear winner and is an off the shelf solution available today. We need BLE 5 IoT not WiFi for consumer applications.

  7. anon :
    > I guess your level of paranoia would vary though with the application.
    Dude, R U nutz? Heard something about recent worldwide ransomware waves? Next step is your 433MHz house which will flash your lights, flush your toilet, play imperial march on your window curtains and ask for some “donation”.

    would invite people to watch that and ask for entrance fees

  8. Ha ha ha.. For a little more than $13.43 ($17-21) I might as well order an Android Box, with accessories included, on sale !

    Btw, Monday 9pm- Tue July 11 is Amazon Prime Day. If you get lucky as with the previous Prime Days, you might land a $0.99 Dash button. It is still hackable with BT included.

  9. I use Alexa Voice control from my firestick to control various sonoff’s.

    Can’t get any simpler than saying light on/off

  10. What I really want is a similar device, but AC powered.
    Imagine a device the size of the socket it is plugged in with a push button on top of it.
    I really wonder why nobody ever made such a device.
    The pricing is also quite offensive.
    This thing shouldn’t cost a cent over 20$.
    In fact I am getting so desperate that I started to think to make it myself.
    Get some kind of a gang switch, a simple development board with gpio, and a simple, small usb power adapter.

  11. @prob_dude
    A good alternative is Zigbee.
    You can buy a xiaomi gateway (26€) and buttons (6€), all your parameters are here : security, latency, range, data transfer and battery life then read on.

    A french guy has hacked the protocol and he is about to make an universal gateway for all Zigbee devices.
    More info on his website (google translate will be probably usefull for you 😉 )

  12. Very peculiar. There’s a button. It has to be pressed before any action occurs …so you use a P-channel MOSFET (something like the AO3415) to switch on the power to the ESP8266 only when the button is pressed. The ESP latches the MOSFET on when it starts up. It does whatever it is you want it to do and then turns the MOSFET off when it’s finished. No power used at all until the button is actually pressed. The battery life is limited only by how many presses per week/day/hour you get. They’re already using a MOSFET in the battery control circuitry, so they’re not scared of using extra hardware.

  13. @PuceBaboon

    All of the commercial buttons use the MOSFET scheme. TI make a special chip that is even better, it has leakage in the picoamps. Amazon buttons are rated for something like 1,000 presses, not number of years.

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC