Why I Made This:
library:
Read more- So as COVID-19 is going on that's why we need to take some precautions Use mask, Hand sanitizer, Zero contact with anybody.
- So I made this to avoid to touch the doorknob and open it( I'm a lazy person )
- As I have the core kit of M5Stack there is no imu in it. so that's why I added an MPU6T050 in it. to get all data I need.
- I use some female headers to connect it
and connected it to M5Stack.
VCC ---- 3.3v
GND ---- GND
SCL ---- SCL
SDA ---- SDA
M5Stack(client):- M5Stack will work as a remote control for the robot.
- with MPU6050 we are calculating "ROLL".
WEB CLIENT:
- so here we are working as a client for the server.
- so it's similar to web server, where we give commands from our devices to the board,
- so I'm using the sketch that comes with the M5Stack library.
- I'm modifying the sketch as per my need.
- so we begin a server that reads what client print.
- so as I gave the example up there that if server reads led then it will open or close or do as per commands.
- to ensure that it's working you can also connect to the server with your phone and type "ope" to check everything is working or not.
- so let's talk about the connection.
- I'm using here a relay to control solenoid.
- D1 ---- SERVO(data)
- GND ---- GND
- VCC ---- VCC
- you will find the M5Stack library here.
- you will need servo.h that is pre-installed.
if(roll >= 40){
M5.Lcd.print("[HTTP] begin...\n");
http.begin("http://192.168.4.1/ope");
M5.Lcd.fillScreen(Green);
int httpCode = http.GET();
http.end();
So
when you tilt your hand right then the Oval of the sensor goes up to 40 then it will write ope(it's just a code to say, Hey open the door to NodeMCU).- the screen color of M5STACK will change "RED" to "GREEN" when the door is opened.
- so I'm using this type of wrist band for M5STACK.
void ope(){
myservo.write(90);
delay(10000);
myservo.write(0);
- if the client writes "ope" Nodemcu will follow this void ope and open the door.
- if you have any problem with it then do let me know in the comment section.
Comments