I have a circuit where I connect an Arduino to an NFC Shield and this one to a breadboard. My goal is to activate an electric lock that works with 10-24V AC and DC, for this I have placed a 2N2222 transistor and a resistance of 330 Ohms.
The problem I have is that when I connect the protoboard to the lock, the LED lights, but the lock is immobile.
This is the scheme on which I have based myself to assemble everything.
And this is the image of how I have it armed:
And finally I have the code that I am using:
#include <PN532.h>
#include <SPI.h>
/*Chip select pin can be connected to D10 or D9 which is hareware optional*/
/*if you the version of NFC Shield from SeeedStudio is v2.0.*/
#define PN532_CS 10
PN532 nfc(PN532_CS);
#define NFC_DEMO_DEBUG 1
const int control = 7 ;
const int speed = 200;
void setup(void) {
pinMode(control, OUTPUT) ;}
void loop(void) {
digitalWrite(control, HIGH);
delay(2000);
digitalWrite(control, LOW);
delay(1000);
}
Thanks in advance, Greetings.