2020-4-27 10:41:08 [显示全部楼层]
12024浏览
查看: 12024|回复: 13

[项目] 面对新冠,用arduino制作无接触式挤洗手液器

[复制链接]

创意说明:当前正值新冠疫情背景下的个别地方的防疫,公共场所洗手是个大问题。一方面,大家赶时间,且多半还是手动接触开关。为避免人员扎堆,免去交叉感染的风险,本装置试图用基本的开源硬件支持下,以解决洗手问题。这类创客项目很多,但是实际会发现一个大问题是普通伺服电机无法按动洗手液按压头,这里的伺服用的是df的18kg的特殊伺服。从伺服摆臂上加一段铁丝并绑在

面对新冠,用arduino制作无接触式挤洗手液器图1


面对新冠,用arduino制作无接触式挤洗手液器图9

面对新冠,用arduino制作无接触式挤洗手液器图2

原理:本装置有免洗消毒液正面挂开源电子套件(伺服、MP3模块),当超声波传感器测得3M内有障碍(人),即启动MP3模块播放防疫知识,进而启动伺服电机,压下洗手液。当障碍(人)移开,mp3模块关闭,伺服也停止工作。直到下一次的触发。

硬件清单免洗消毒液Arduino主板一块、arduino sensor board、充电电源、微波运动传感器一个、杜邦线若干、DF的MP3模块一个

硬件图片如下

面对新冠,用arduino制作无接触式挤洗手液器图3

arduino sensor module

面对新冠,用arduino制作无接触式挤洗手液器图4

DF mp3模块

面对新冠,用arduino制作无接触式挤洗手液器图5

微波运动传感器

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伺服电机

面对新冠,用arduino制作无接触式挤洗手液器图7

DF15MG舵机 升级版 实超15KG

https://www.dfrobot.com.cn/goods-222.html

====================

下面是连线图

面对新冠,用arduino制作无接触式挤洗手液器图6

===================

微波模块非常灵敏,需要调整它的灵敏度以适应实际使用场合

面对新冠,用arduino制作无接触式挤洗手液器图8

微波运动传感器上有个旋钮可以调整灵敏度。

=====================

下面是代码

[mw_shl_code=applescript,false]/*
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[4] = {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[6] = {0xAA,0x07,0x02,0x00,Track,Track+0xB3};
Serial1.write(play,6);
}

void volume( unsigned char vol)
{
unsigned char volume[5] = {0xAA,0x13,0x01,vol,vol+0xBE};
Serial1.write(volume,5);
}[/mw_shl_code]




77  管理员

发表于 2020-4-27 10:51:13

没有文字的介绍有点看不懂呢
回复

使用道具 举报

txm派瑞深山锹  高级技师

发表于 2020-4-27 11:05:59

厉害厉害!!
回复

使用道具 举报

Vibranium  高级技师

发表于 2020-4-27 11:08:00

膜拜大佬,谢谢分享
回复

使用道具 举报

hnyzcj  版主

发表于 2020-4-27 11:25:47

77 发表于 2020-4-27 10:51
没有文字的介绍有点看不懂呢

我看懂了
回复

使用道具 举报

gada888  版主
 楼主|

发表于 2020-4-27 12:07:25

77 发表于 2020-4-27 10:51
没有文字的介绍有点看不懂呢

刚才添加了些内容,今后会注意改进的
回复

使用道具 举报

Roboxes  见习技师

发表于 2020-4-27 12:51:11

膜拜大佬
回复

使用道具 举报

云天  初级技神

发表于 2020-4-27 16:31:06

个人认为,只用铁丝,18kg舵机处理这个也有可能一定问题。力量和角度……
回复

使用道具 举报

帅猫  高级技师

发表于 2020-4-27 22:20:31

为什么不用红外接近传感器呢?
我认为用推杆电机比舵机更省时省力
回复

使用道具 举报

gada888  版主
 楼主|

发表于 2020-4-28 08:17:23

云天 发表于 2020-4-27 16:31
个人认为,只用铁丝,18kg舵机处理这个也有可能一定问题。力量和角度……

改进了。在洗手液瓶按压处打了个孔,铁丝从那里穿过,可以拉动。当然不是很完美的办法
回复

使用道具 举报

gada888  版主
 楼主|

发表于 2020-4-28 08:18:33

帅猫 发表于 2020-4-27 22:20
为什么不用红外接近传感器呢?
我认为用推杆电机比舵机更省时省力

这个方案也很好。个人认为可以有很多方案实现这个效果。从经济角度看。我的这个成本不低。
回复

使用道具 举报

 初级技匠

发表于 2022-4-20 10:12:49

代码要整理一下
回复

使用道具 举报

 初级技匠

发表于 2022-4-20 10:14:11

@RRoy 的帖子很像呢
回复

使用道具 举报

RRoy  超级版主

发表于 2022-4-29 09:56:13

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4 备案 沪公网安备31011502402448

© 2013-2025 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail