24v继电器:如何使用Arduino激活24V电锁

关于24v继电器的问题,在arduino 24v中经常遇到, 好!我有一个电路,其中我将 Arduino 连接到 NFC Shield,它是一个协议板。我的目标是激活一个适用于 10-24V AC 和 DC 的电锁,为此我放置了一个晶体管 2N2222 和 330 欧姆的电阻。当我将板协议板连接到锁上时,我遇到的问题是,LED 打开,但锁是不可移动的。

好!我有一个电路,其中我将 Arduino 连接到 NFC Shield,它是一个协议板。我的目标是激活一个适用于 10-24V AC 和 DC 的电锁,为此我放置了一个晶体管 2N2222 和 330 欧姆的电阻。当我将板协议板连接到锁上时,我遇到的问题是,LED 打开,但锁是不可移动的。

这是我自己组装所有东西的计划。

scheme

这是我如何武装的图像:

mounting

最后我有我使用的代码:

#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);
}
1

it doesn't happends because your supply in +5v (from USB) and can not change state of +24v equipment. you should connect a +12v supply to the collector of your transistor. do like this : enter image description here

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(566)
C语言怎么求最小公倍数:最小公倍数 (LCM)-Python
上一篇
Python安装basemap:未安装 Basemap
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(36条)