Descripción del modelo 3D
This One Button Remote will send the Toggle command to a SONOFF Basic programmed with Tasmata.
Electronic Parts:
1 - Seeed Studio XIAO ESP32C3 SKU 113991054
1 - Adafruit IoT Button with NeoPixel BFF Add-On for QT Py and Xiao Product ID: 5666
2 - 220K 1/4w 1% Resistors (Used to get battery voltage)
1 - 15k 1/4w 1% Resistor
1 - 10k 1/4w 1% Resistor
1 - Adafruit Lithium Ion Polymer Battery - 3.7v 500mAh Product ID: 1578
1 - Pre-Crimped 2-pin JST-PH connector with silicon wire (Optional) (https://www.amazon.com/Connector-SIM-NAT-connectors-Inductrix/dp/B08SC3F658)
A couple pieces of solid 22 AWG wire for Board to Board connections.
*Construction Notes: *
- If you use the Pre-Crimped battery connector the wire length should be 35mm long not the whole length, just the wires.
- If you haven't noticed the Antenna is pushed down the side below the Insert the the XIAO is on. I found it is easier to do when inserting it into the case.
Then the antenna is just folded over to put on the lid. It can only go down as far as the solder connections on the antenna.
- If your PCB to PCB wires are a bit longer bow them outward so the boards fit in the Insert. Better a bit long than short as the spacing between the boards is fixed.
- The 10k and 15k resistors are used to detect if the USB is powering the XIAO ESP32C3 in the code.
Danger Warning
Lithium Ion Polymer Batteries can be dangerous. Do not short out the battery. If you get the Pre-Crimped cable for the battery make sure that the wires match the color on the battery. Just hold it together like your going to plug it in and check. Mine was not correct. The Pre-Crimped cable is great because you can switch the Red and Black wires in the connector if needed and you are not directly soldering the battery to the ESP32C3 which would be a bad idea anyway.
As with any battery and devices like many ESP32 and other boards that have a battery socket soldered to the board always check the polarity before plugging it in.
From Adafruit Website about this battery.
The included protection circuitry keeps the battery voltage from going too high (over-charging) or low (over-use) which means that the battery will cut out when completely dead at 3.0V. It will also protect against output shorts. However, even with this protection, it is very important that you only use a LiIon/LiPoly constant-voltage/constant-current charger to recharge them and at a rate of 500mA or less. We suggest our Micro Lipo charger, which has a 100mA default rate. You can also set the Micro Lipo to 500mA rate for a faster charge.
This is my first time actually making a project with code to share.
I did the project code using Visual Studio Code and PlatformIO.
The project code can be found here: https://github.com/jaseiffert/one-button-remote
Operation
After powering on the remote with the battery the LED will glow blue meaning it has WiFi connection.
After being Idle for 1 minute (unless you changed that) the remote will go to sleep and will wake up when the button is pushed.
After pushing the button the LED should go blue showing WiFi connection.
Pushing the button while the LED is blue will Toggle the device. It may go On or Off depending on what state the device is at. The LED will then turn Green if it turned the device On or Red if it turned the device Off. That will only show for a couple seconds before going back to the blue color.
No LED color means it's asleep.
It can take a few seconds to connect to WiFi after waking up.