Notifications
Clear all

Help building a project please

4 Posts
2 Users
0 Likes
2,035 Views
(@garnold)
Member
Joined: 5 years ago
Posts: 81
Topic starter  

I'm looking to build my own AWS IoT Button. The functionality of this project is super simple and should do the following.

  • User pushes button
  • Button closes a circuit that will power the ESP8288
  • When the ESP8266 receives power it will trigger a transistor that will keep the unit on when button is released
  • Code will connect to WiFi
  • Code will connect to MQTT server
  • Code will publish a message to MQTT server
  • Code would disconnect power to transistor that will power off ESP8266

I'm looking to take this approach after reading a few posts (that I will link below) so I can simply post a message to an MQTT server and have the device last on a battery for a very long time. I'll add a few LED's into the project for UI notification allowing the user to understand what is going on but I can figure that out.

Right now I have the basic code working but I need to add in the transistor part and not sure which one to get. If you check out this link http://www.zolalab.com.br/eletronica_projetos/auto_shutdown_enus.php it shows a IRF520 but there are a couple to pick from and I'm not sure which one. I'm also not sure if this one or if I could get a smaller one.

I plan to use a Wemos Mini D1 with the lipo power and charger shield so it can take care of power regulation since I'm really not sure how to handle this with electronics and building it on my own right now.

Could I please get some help on the electronics here on what transistor I should get and also some suggestions for the code? Is the code in that example I linked good enough to handle the power on and off part of the Wemos? I'll add in the other code from my working example little by little.

Links I have used to help with this idea

http://www.zolalab.com.br/eletronica_projetos/auto_shutdown_enus.php

 

Thank you all so very much for the support!

Gene


   
Quote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

not really answering your question, but if I was doing something similar I would look to put the wemos into deep sleep, have it wake on button press (a pin goes high) and while awake one of the mqtt messages would inform about battery level.   


   
ReplyQuote
(@garnold)
Member
Joined: 5 years ago
Posts: 81
Topic starter  

@byron

I'm going to take that direction for my first try because I won't have to build a circuit to make it work. Still, that method would be draining the battery when the Wemos is in deep sleep and I was hoping to avoid that. Using the method I posted would technically keep the Wemos disconnected completely so that battery would only loose power from it's normal shelf life.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
 

@garnold

It's good you are going to try both deep sleep and completely off as it would be interesting to see what difference it does make.  Do please let me know of the outcome.

I have a simple suggestion for your push button circuit.  

Use two relays.  

One relay is normally open (off). It is connected to the battery and will switch two contacts on at the same time when a push button is pushed.  On this relay one contact switches on the wemos and the other contact switches on a circuit that will in effect bypass the toggle switch so that the relay is now held on when the push button is released.

The other relay is normally closed (on) but is wired to the wemos which can send power the the relay to switch it off thus breaking the whole circuit and switching off relay 1 and wemos.  

As you may gather with this probably crude suggestion I'm just a dabbler in electronics and there will surely be a better way to do this but I think it should work.   Of course your wemos may be in peril. ? 


   
ReplyQuote