否则,您必须在电路中使用外部10K上拉电阻。以下是示例电路: ! Arduino代码 - 读取干簧管数据 这是一个基于上述电路的非常基本的Arduino草图,当您将磁铁靠近开关时,它将点亮内置LED(连接到引脚13),当您将其移开时熄灭。 登录后复制constintREED_PIN =2;// Pin connected to reed switchconstintLED_PIN =13;/...
在代码中,我们必须先定义Reed开关和LED连接到Arduino的引脚。干簧管连接到Arduino的数字引脚4,LED通过限流电阻连接到Arduino的数字引脚7。变量“reed_status”用于保存干簧的状态。 int LED = 7; int reed_switch = 4; int reed_status; 复制代码 在setup()函数中,我们需要设置LED和干簧管连接的引脚状态。引脚4...
Arduino and Raspberry Pi Sensor Projects for the Evil Genius by Robert Chin. McGraw Hill, 2017. Several of the projects in this book involve hooking up reed switches to Arduinos and Pis (there are complete instructions for a reed-switch door buzzer alarm). MAKE: Electronics by Charles Platt...
Part 2-The sketch using Arduino IDE for Esp8266 Nodemcu and transmission to ThingSpeak. See the video to know the final solution. How to build your own Anemometer using Hall Effect Sensor and Reed Switches Project description The anemometer is a device capable of measuring the wind speed and i...
The trick was in creating a door mechanism with a blacklist of sorts rather than a whitelist. As the cat didn’t like to push the door open itself, the solution needed to have the pet door open by default. A magnet on Riley’s collar would trip a sensor attached to an Arduino that...
Continue reading“Laser-Cut Lamp With Magic Switch”→ Triple Sensor Mailbox Alert Really Delivers November 7, 2014byKristina Panos22 Comments Messing with the U.S. Mail is not something we generally recommend. But if youbuild your own mailbox like [Bob] did, you stand a much better chance...
Torxgewindechanged the titleConnection of pir sensorDec 27, 2022 Owner TorxgewindecommentedJan 7, 2023 To read the Reed-switch and light the LED accordingly: const int ReedPin = 4; const int ledPin = 2; void setup() { pinMode(ledPin, OUTPUT); pinMode(ReedPin, INPUT_PULLUP); } void...
Connect Grove - Dry-Reed Relay to port D2 of Grove - Base Shield and plug it into Arduino/Seeeduino. Upload the below code. int Relay = 2; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. ...
ESPHome Garage Door Sensor Opener Download:free Website:Thingiverse add to list order this print TagsMicro switch Download:free Website:Thingiverse add to list order this print Particle Argon and Xenon case for Garage Door Ope... Download:free ...