How to connect bolt with RFID


#1

what are the necessary connection to connect with bolt and RFID card reader


#2

It depends on the specifications of your RFID. Does it have UART? Bolt offers interfacing via UART, Digital GPIOs and Analoug GPIOs.


#3

i want to make an autonomous door using RFID and servo motor.


#4

Hi,

For that particular application only an arduino would suffice as no internet control or monitoring is required in your problem statment [quote=“tanyajain1112, post:3, topic:646, full:true”]
i want to make an autonomous door using RFID and servo motor.
[/quote]


#5

When I interface Bolt with an RFID reader, do I need to use an Arduino in between? Or I could do it directly? Let me know the most optimum way of interfacing Bolt with an RFID reader. : Posting on behalf of another user.


#6

@ppv: Yes, you would need to use an Arduino or some other controller to translate the data coming from the RFID reader, to a data stream that the Bolt can process.

The optimum was of interfacing the Bolt with an RFID reader, would be to use an Arduino.

You can use the following library to interface the Arduino with the Bolt

You can modify the code in the following project to interface the Arduino with an RFID reader and Bolt.

My suggestion would be to use the software serial method of the Boltiot-Arduino-Helper library, for the quickest development.


#7

Thank you for the quick response yesterday. PPV was posting on my behalf. I hope to give your recommendations a try this weekend.


#8

Please forgive my beginner technical abilities when it comes to code and IOT.

Below is the code that I currently have running on the Arduino. I’ve installed the BOLTIOT-Arduino-Helper library, and I believe that I have included the code in the sketch to get started, but I have no idea how to send the user ID of a card to the cloud. What commands would I use in the Arduino sketch, and what would the hardware configuration and code be on the BOLT Cloud?

To get started, I would like to see how to send the card’s ID to a Google Sheet using Integromat.

#define API_KEY     "***********"
#define DEVICE_ID   "BOLT269171"

  /*
 * 
 * All the resources for this project: https://www.hackster.io/Aritro
 * Modified by Aritro Mukherjee
 * 
 * 
 */
 
#include <SPI.h>
#include <MFRC522.h>
//#include <BoltDeviceCredentials.h>
#include <BoltIoT-Arduino-Helper.h>
 
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

int motorRelay=8;
int allowLED=7;
int denyLED=6;
int powerLED=5;
 
void setup() 
{
  Serial.begin(9600);   // Initiate a serial communication
  SPI.begin();      // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  Serial.println("Approximate your card to the reader...");
  Serial.println();
  pinMode(motorRelay,OUTPUT);
  pinMode(allowLED, OUTPUT);
  pinMode(denyLED, OUTPUT);
  pinMode(powerLED, OUTPUT);
  boltiot.begin(3,4);
}
void loop() 
{
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent()) 
  {
    return;
  }
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) 
  {
    return;
  }
  //Show UID on serial monitor
  Serial.print("UID tag :");
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++) 
  {
     Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
     Serial.print(mfrc522.uid.uidByte[i], HEX);
     content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
  if (content.substring(1) == "96 3E 8C AB") //change here the UID of the card/cards that you want to give access
  {
    Serial.println("Authorized access");
    Serial.println();
    digitalWrite (motorRelay, HIGH);
    digitalWrite (allowLED, HIGH);
    delay(3000);
    digitalWrite (motorRelay, LOW);   
    digitalWrite (allowLED, LOW); 
  }
 
 else   {
    Serial.println(" Access denied");
    digitalWrite (denyLED, HIGH);
    delay(3000);
    digitalWrite (denyLED, LOW);
  }
}

#9

Hi,

You can implement the system in the following manner.

First you have to create a global variable, which stores the ID of the RFID card which was stored. Since you already have mfrc522 as your global variable, with which you can access the ID of the card, you don’t need a separate variable.

Next create a function, which will be triggered by Integromat to read the ID of the card.

String read_id(String *data){
       String RF_ID;
       /* Some logic to pull RFID card's ID from mfrc522 and convert it into a single string*/
       return RF_ID;
}

Next, you tell the ‘boltiot’ variable that, this function has to be called, whenever the Bolt sends it a specific command. This part of the code goes into the setup function.

boltiot.setCommandString("ReadID",read_id);

In the loop function, you have to tell the ‘boltiot’ variable to look through all the commands received from the Bolt and accordingly do the required function.

boltiot.handleCommand();

Remember, you need to modify your Arduino code to make sure that the handleCommand function is called every second.

Next, you have to create an Integromat scenario, to poll for and read the data from the Arduino.
For this, you can go through the following blog.

The blog gives you a blueprint for the scenario, you will have to tweak it to send the ‘ReadID’ command instead of the ‘GetDistance’ command, and you will have to add google sheets editing logic to it.

I hope this works for you as nicely as I expect it to.

Do reply here, if you face any issues.