It is possible to control one relay using Blynk app and also using an atmega? To a better understanding think at a relay that will turn on a fan when you use the blynk app. but when you don;t have the phone around you, using a pushbutton, you can turn it on from there(the button will be connected to atmega)

void setup()



  pinMode(EspReadPin, INPUT);
void loop()
  if(digitalRead(EspReadPin == 1))
  else if(digitalRead(EspReadPin == 0))


Yes it is possible.

Use the Blynk example sketch to activate the pin of the esp8266. Read the pin of the esp8266 with the ATMega. Handle in ATmega sketch the esp8266 pin as a second button.

| improve this answer | |
  • i can't understand. Can you please to explain more detailed? – Iulian Chirvasa Jun 11 '19 at 14:51
  • can you please rewrite your question in more detail – Juraj Jun 11 '19 at 14:52
  • Of course ! basically what i want is to control one relay from two different locations. One will be in the house(a panel with buttons) - where will be also this button for the relay. and will be controlled by atmega(when it will be pressed - will turn on the relay). and another "location" will be from the phone. but for this part i will use blynk and esp. – Iulian Chirvasa Jun 11 '19 at 14:55
  • and you have the local part working and want to add the esp8266 with Blynk? – Juraj Jun 11 '19 at 14:56
  • i use the pin from atmega as output. and on the breadboard is connected to relay(as signal) but on the same line(on the breadboard) i put also the pin from the esp. and the problem appears that if i press the button - relay will turn on. but if i use the blynk app- nothing happens. – Iulian Chirvasa Jun 11 '19 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.