RFID and Blynk


i am new here.I have this sketch.I want that i can see, when the Relais is HIGH/Low on Blynk and want to turn the Relais(2) LOW/HIGH by a button on the app for 30 seconds.
I have a Mkr1000. Is it possible that i can use a Hotspot of an iPhone?

Thanks a lot for your help.

#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 7
#define RST_PIN 6
MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup()
pinMode (2, OUTPUT); 

void loop()
if ( ! mfrc522.PICC_IsNewCardPresent())

if ( ! mfrc522.PICC_ReadCardSerial())

long code=0;

for (byte i = 0; i < mfrc522.uid.size; i++)

if (code==431740) // 


digitalWrite (2, HIGH);

if (code== 1737550)

{ /

digitalWrite (2, LOW);



Your title mentions RFID, your question talks about Relay, timed actions and Hotspots… and I had to properly
format your posted code as you used only one backtick at the top… so much, and yet so little detail…

RFID - Umm, yep, sure, whataboutit?

Time relay action - Yes, use a timer, more specifically a timeout timer. Search this forum for more info

Hotspot - Sure, why not?.

Posting code in this forum -


Thank for your reply.The sketch uses RFID,and i want that i can see in the app, if it is HIGH/LOW.

OK, well, we do not teach programming, or write code for you… but we can help guide you through the forum and Documentation to learn about Blynk.

Start with searching this forum for keywords like RFID and start reading what others have done… please keep any questions in your own topic here instead of reopening old topics, thanks.

I do this before writing here, but all solution are in Russian.May you can say me how i can make a if/else in the app.Which module need i?is there a german community?

First, I use Google Translate if necessary.

Second, RFID is not Blynk specific… in fact is has nothing to do with Blynk. Blynk is an IoT based user interface, not a magic do all solution (yet :stuck_out_tongue_winking_eye: ). Google for a good RFID sketch, learn how it works and then add in the Blynk library and formatting to view the results in the App.

Third, there are lots of non Russian topics referencing RFID in this forum- https://community.blynk.cc/search?q=RFID

The problem you have is that the code you are using isn’t really compatible with Blynk, as it does all of its processing in the void loop.
You need to find a way to move this out of the void loop and call it with a (very frequent) timer, or preferably find a library that allows your RFID reader to operate on an interrupt-driven basis.
Maybe like this example:

Once you can trigger an interrupt when an RFID fob is detected then you can process the result in a way that’s compatible with Blynk.
If you want to then operate the relay via a Blynk button widget rather than an RFID tag this can be done with a BLYNK_WRITE(virtual pin of the widget button) command.

You also need to be careful that the RFID reader logic levels are compatible with your 3.3v board. I use a Wiegand reader that requires a 12v supply and which outputs data at 5v logic levels. In theory, the Wemos D1 Mini that I use should be tolerant of 5v logic levels, even though it’s a 3.3v device. In practice, it can’t read the data from the RFID reader unless it’s converted to 3.3v logic levels using a level shifter.


I want to check it if it works, but there no Toke-Place?

I have absolutely no idea what that means.


merry Christmas.

The problem change a little bit, so i explain what i want.

I have a Relay and a RFID-reader.When the RFID-tag is right,the relay is HIGH.
In the Blynk-app i want two Buttons, one Button turns the Relay LOW/HIGH.The other turns the Relay LOW/HIGH for 30 seconds.I have the code without Blynk finish.

Was this a belated letter to @FatherChristmas? :santa::santa::santa:
If so, I think he might be taking a well-earned rest for a while :grinning:

If not, then what is it that you need advice with from the Blynk community?



1 Like

I want to get in touch with cute Anna :thinking:

1 Like

Keep dreaming :sleeping: