Components Required –
1. ESP32 Microcontroller
2. H-Bridge
3. Linear Actuator
4. 12V DC Power Adaptor
5. Jumper Cables
Arduino Code Here
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YOUR_WIFI_NAME_HERE";
char pass[] = "YOUR_WIFI_PASSWORD_HERE";
#define DATA_SIZE 45
char data_buffer[DATA_SIZE];
char *saveptr;
int actuatorw1 = 12;
int actuatorw2 = 14;
BlynkTimer timer;
void setup()
{
// Debug console
Serial.begin(115200);
pinMode(actuatorw1, OUTPUT);
pinMode(actuatorw2, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(actuatorw1, LOW);
digitalWrite(actuatorw2, LOW);
digitalWrite(LED_BUILTIN, LOW);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
Serialcheck();
timer.run();
}
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
if (pinValue == 1)
{
Door_Lock();
}
else if (pinValue == 0)
{
Door_Unlock();
}
}
void Door_Lock()
{
digitalWrite(actuatorw1, HIGH);
digitalWrite(actuatorw2, LOW);
timer.setTimeout(2000L, Actuatoroff); // after 2 seconds actuator will turn off
}
void Door_Unlock()
{
digitalWrite(actuatorw1, LOW);
digitalWrite(actuatorw2, HIGH);
timer.setTimeout(2000L, Actuatoroff); // after 2 seconds actuator will turn off
}
void Actuatoroff()
{
digitalWrite(actuatorw1, LOW);
digitalWrite(actuatorw2, LOW);
}
void Serialcheck()
{
memset(data_buffer, 0 , sizeof(data_buffer));
if (Serial.available() > 0)
{
Serial.readBytes(data_buffer, DATA_SIZE);
String command = strtok_r(data_buffer, ",", &saveptr);
if (command == "door")
{
char* errorCheck;
long DoorStatus = strtol(strtok_r(NULL, ",", &saveptr), &errorCheck, 10);
if (DoorStatus == 1)
{
Serial.println("LOCK");
Door_Lock();
digitalWrite(LED_BUILTIN, HIGH);
}
else if (DoorStatus == 0)
{
Serial.println("UNLOCK");
Door_Unlock();
digitalWrite(LED_BUILTIN, LOW);
}
}
else if (command == "reset")
{
ESP.restart();
}
}
}
I believe you have mentioned some very interesting details , appreciate it for the post.
Hello, you used to write fantastic, but the last several posts have been kinda boringK I miss your super writings. Past several posts are just a little out of track! come on!
I genuinely enjoy looking at on this internet site, it has great blog posts.
Thank you for sharing with us, I think this website truly stands out : D.
digoxin 250 mg pills lanoxin online buy order molnunat 200mg pills
acetazolamide cheap buy diamox online buy azathioprine pills
buy digoxin 250mg without prescription buy molnunat 200mg without prescription oral molnunat 200 mg
buy amoxil 250mg pills amoxicillin us buy stromectol for humans
you have a great blog here! would you like to make some invite posts on my blog?
buy carvedilol for sale purchase coreg pills amitriptyline 10mg oral
buy alendronate 70mg without prescription order fosamax 35mg online motrin 600mg pills
order indocin 75mg online order flomax 0.2mg online generic cenforce 50mg
buy nortriptyline 25 mg without prescription order paracetamol generic purchase paroxetine without prescription
order doxycycline 100mg sale methylprednisolone uk medrol usa
purchase pepcid generic remeron 30mg cost remeron uk
tadacip 20mg oral clopidogrel over the counter cheap amoxicillin 250mg
requip 1mg pills order requip online cheap trandate 100 mg price
esomeprazole pills clarithromycin price furosemide 100mg oral
purchase tricor buy tricor for sale order sildenafil 100mg sale
I have read your article carefully and I agree with you very much. This has provided a great help for my thesis writing, and I will seriously improve it. However, I don’t know much about a certain place. Can you help me?
minocin medication order minocycline 50mg generic buy terazosin 1mg pill
order tadalafil 40mg Low price cialis order sildenafil 100mg generic
order glycomet 500mg online tamoxifen 20mg usa buy generic nolvadex
buy tadalafil 5mg generic Buy cheap cialis erectile dysfunction drug
modafinil 200mg brand provigil oral phenergan over the counter
order generic clomiphene lipitor 20mg sale cheap generic prednisolone
deltasone 40mg sale generic amoxil 500mg amoxil 250mg drug
generic isotretinoin 40mg order prednisone for sale ampicillin order online
free samples of ed pills sildenafil 50mg for sale order propecia 5mg pills
ivermectin 0.1 uk order deltasone without prescription deltasone 20mg ca
buy accutane 10mg oral amoxil 1000mg zithromax medication
get allergy pills online buy generic augmentin 625mg augmentin 625mg price
purchase prednisolone pill furosemide order online order furosemide 40mg online
provigil 100mg cost lopressor 100mg for sale lopressor usa
buy avodart 0.5mg generic buy cephalexin 500mg sale xenical sale
ditropan 2.5mg usa trileptal 300mg pills order oxcarbazepine 600mg pill
omnicef pill pantoprazole 20mg ca pantoprazole 40mg oral
cheap simvastatin 20mg phenergan online order sildalis ca