B4R Question Wemos Lolin32 & RFID-RC522

sorex

Expert
Licensed User
Longtime User
Hello,

I have a Wemos Lolin32 (or clone) board that I would like to operate with an RC522 RFID reader.

Just to make sure everything was operational I tried the blinking led example which works fine. (compile, flash & run)

Now I was trying to follow Erel's lib example (https://www.b4x.com/android/forum/threads/mfrc522-rfid-reader-writer.67160/#content) and noticed that pin 3 or 3D does not even exist on this board.

Anyone having any idea how things should be connected and what the init line should look like?

Close up pictures of the pin holes can be seen here

 

f0raster0

Well-Known Member
Licensed User
Longtime User
pin RST RFID-RC522 can be connected to your Wemos Lolin Lite pin GPIO
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
indeed, the question is which one :)

on the none lite version it has these mosi & miso things printed on the pcb.
the lite one doesn't so it's guessing or should I just pick the same port numbers?
But I think I was missing a match.

And are these ports somehow hardcoded besides the ones you define in the initialize?
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
pinout in picture attached (I haven't used that modules)
if you got the WemosLolin Lite from Aliexpress ask them for the datasheet or pinout, they usually send it if asked
Lolin32_pinout03-1.png

edit:
At lest you can see SCL, MISO, MOSI, SCK, SS
 
Last edited:
Upvote 0

sorex

Expert
Licensed User
Longtime User
I got it to read out the rfid tags.
When you look at the board it's all the right pins in order exept for the GND pin on the bottom left.

B4X:
RFID-RC522 > LOLIN32 Lite

SDA  > 5
SCK  > 18
MOSI > 23
MISO > 19
IRQ  > not connected
GND  > G
RST  > 22
3.3V > 3.3V

rfid.Initialize(5,22, "rfid_CardPresent")

the only weirness I see is that the hex value is a reversed version of the int value I see in the other software.
I get E591EA64 while it should be 64EA91E5 but it's something that can be corrected with this code

B4X:
    Dim b() As Long
    b=bc.longsFromBytes(UID)
    Log(b(0))
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
A general help about the esp32 boards can be found here in this video:

 
Upvote 0

nookie

New Member
Define it in your sketch to GPIO you desire.

B4X:
#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN    9
#define SS_PIN     10

MFRC522 mfrc522(SS_PIN, RST_PIN);
MFRC522: : MIFARE_KEY;
 
Upvote 0
Top