面对新冠,用arduino制作无接触式挤洗手液器
创意说明:当前正值新冠疫情背景下的个别地方的防疫,公共场所洗手是个大问题。一方面,大家赶时间,且多半还是手动接触开关。为避免人员扎堆,免去交叉感染的风险,本装置试图用基本的开源硬件支持下,以解决洗手问题。这类创客项目很多,但是实际会发现一个大问题是普通伺服电机无法按动洗手液按压头,这里的伺服用的是df的18kg的特殊伺服。从伺服摆臂上加一段铁丝并绑在https://v.youku.com/v_show/id_XNDY1MDA0MDI0OA==.html?spm=a2hzp.8244740.0.0原理:本装置有免洗消毒液正面挂开源电子套件(伺服、MP3模块),当超声波传感器测得3M内有障碍(人),即启动MP3模块播放防疫知识,进而启动伺服电机,压下洗手液。当障碍(人)移开,mp3模块关闭,伺服也停止工作。直到下一次的触发。硬件清单:免洗消毒液、Arduino主板一块、arduino sensor board、充电电源、微波运动传感器一个、杜邦线若干、DF的MP3模块一个硬件图片如下arduino sensor moduleDF mp3模块微波运动传感器https://wiki.dfrobot.com.cn/index.php?title=(SKU:SEN0192)_Microwave_sensor%E5%BE%AE%E6%B3%A2%E4%BC%A0%E6%84%9F%E5%99%A8%E6%A8%A1%E5%9D%97
==============大功率5v伺服电机DF15MG舵机 升级版 实超15KGhttps://www.dfrobot.com.cn/goods-222.html====================下面是连线图===================微波模块非常灵敏,需要调整它的灵敏度以适应实际使用场合微波运动传感器上有个旋钮可以调整灵敏度。=====================下面是代码/*
This sketch is made by gada888
From Luoyang,China
2020-04-25
Happy Hacking
*/
#include <SoftwareSerial.h>
SoftwareSerial Serial1(10, 11);// RX, TX
unsigned char order = {0xAA,0x06,0x00,0xB0};
/////////////initialize servo///////////////
#include <Servo.h>
Servo myservo;
#include <MsTimer2.h> //Timer interrupt function
int pbIn = 0; // Define the interrupt PIN is 0, that is, digital pins 2
int ledOut = 13;
//int piezoPin = 8;
int count=0;
volatile int state = LOW; //Define ledOut, default is off
void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
volume(0x1E);
myservo.attach(9);
attachInterrupt(pbIn, stateChange, FALLING); // Sets the interrupt function, falling edge triggered interrupts.
MsTimer2::set(1000,process); // Set the timer interrupt time 1000ms
MsTimer2::start();//Timer interrupt start
}
void loop()
{
Serial.println(count); // Printing times of 1000ms suspension
delay(1);
if(state == HIGH)//When moving objects are detected later, 2s shut down automatically after the ledout light is convenient.
{
delay(2000);
state = LOW;
myservo.write(130);
play(0x01);
delay(1000);
}
}
void stateChange()//Interrupt function
{
count++;
}
void process() //Timer handler
{
if(count>1)//1000ms interrupt number greater than 1 is considered detected a moving object (this value can be adjusted according to the actual situation, equivalent to adjust the detection threshold of the speed of a moving object)
{
state = HIGH;
myservo.write(0);
count=0; //Count zero
}
else
count=0; //In 1000ms, interrupts does not reach set threshold value is considered not detect moving objects, interrupt the count number is cleared to zero.
}
void play(unsigned char Track)
{
unsigned char play = {0xAA,0x07,0x02,0x00,Track,Track+0xB3};
Serial1.write(play,6);
}
void volume( unsigned char vol)
{
unsigned char volume = {0xAA,0x13,0x01,vol,vol+0xBE};
Serial1.write(volume,5);
}
{:5_128:}没有文字的介绍有点看不懂呢 厉害厉害!! 膜拜大佬,谢谢分享 77 发表于 2020-4-27 10:51
没有文字的介绍有点看不懂呢
我看懂了 77 发表于 2020-4-27 10:51
没有文字的介绍有点看不懂呢
刚才添加了些内容,今后会注意改进的 膜拜大佬{:6_215:} 个人认为,只用铁丝,18kg舵机处理这个也有可能一定问题。力量和角度…… 为什么不用红外接近传感器呢?
我认为用推杆电机比舵机更省时省力
云天 发表于 2020-4-27 16:31
个人认为,只用铁丝,18kg舵机处理这个也有可能一定问题。力量和角度……
改进了。在洗手液瓶按压处打了个孔,铁丝从那里穿过,可以拉动。当然不是很完美的办法 帅猫 发表于 2020-4-27 22:20
为什么不用红外接近传感器呢?
我认为用推杆电机比舵机更省时省力
这个方案也很好。个人认为可以有很多方案实现这个效果。从经济角度看。我的这个成本不低。 代码要整理一下 和@RRoy 的帖子很像呢 诩 发表于 2022-4-20 10:14
和@RRoy 的帖子很像呢
https://mc.dfrobot.com.cn/thread-305073-1-1.html 哈哈
页:
[1]