-adafruit powerboost 500C
-350 mAh 1s lipo
-TSR 1-2433 DC to DC converter
-BSS 52 NPN transistor hfe 2000
-a capacitor for the esp8266 supply
-a self stirring mug
I use an esp8266 powered by the tsr 1-2433 that convert into 3.3V the output of the powerboost wich is 5V.
The gpio2 of the esp8266 is driving the NPN transistor wich is driving the motor under 5V
That was a little tricky to set up the good resistors to drive the NPN transistor, because when the esp8266 start, the gpio2 have to be set at high level to boot in normal mod, if it is set to low, esp8266 start in flash mod.
Software side :
I use NodeMCU 0.9.6-dev_20150704 firmware
The init.lua is setting up the gpio pin to outpout mode and set it to low, set up the wifi configuration, and launch the main program
The main program call DS18b20 nodemcu module, and establish a connection on e web socket
There is 3 case, if the client send a "GET / HTTP/1.1" or "Temperature" or "STOP" in the request.
If "GET / HTTP/1.1" then esp8266 send the web page stored in the memory
if "Temperature" then esp8266 send the temperature to the web page and change speed according to the other argument sent after "Temperature"
if "STOP" Then esp8266 stops the motor
I want to add an automatic function as we set a goal temperature, the mug will activate the motor until the temperature it reach.
But to do that last function, i have to use LUA coroutines, and i don't know, now how to use it right.