本设计为一款应用于寝室的低功耗指纹锁,让普通宿舍门带有指纹解锁功能,也可以应用于自家的房门,免去我们在日常生活中忘记带钥匙,进不去寝室的烦恼。安全性还欠缺保障,但是并不会因为外部电路的短接之类的开门。
采用18650电池供电,低功耗设计,安装简单,板载充电接口,设备待机电流22uA,一节锂电池可以使用3-6个月,实测从2021年7月8日正式装上,电池充满电(2000Mah,冲至4.2V),每天开门至少10次以上(寝室6个人),到2021年9月5日止,当前电压为3.86V,使用40%左右电量,实际测试,低功耗达到了要求。
1. Add fingerprint
2. Set the steering gear stroke
低功耗设计不仅仅是体现在主控芯片,也包括了锂电池充电电路,舵机驱动电路,以及OLED显示屏和指纹模块等。
由于不涉及到大功率的外围设备,而且单片机IO直接驱动更方便,所以采用了PMOS管进行设备供电的管理,在不用到这些设备时能够切断它们的电源,这样就可以有效控制功耗。设备是通过指纹模块的触摸感应进行唤醒,指纹模块的触摸电路工作电流为5uA。
一般电压采集需要用到两个电阻进行分压,然后再计算实际电压,但是电阻是会产生功率消耗的,假设电源电压3.7V,采用两个10K的电阻分压,根据欧姆定律,电流就有惊人的1.85mA,一节2000Mah的锂电池,从4.2V放电到3.7V,按照80%电量计算只能待机1600/24/1.85=36天,还不包括开门时舵机损耗的电量,所以就需要换一种采集电压的方法。
因为STC15W408AS单片机可以通过测量内部的BandGap基准电压值(1.27V)左右,大致计算出输入的电源电压,从而得出电池电压,节省了一个IO口,还进一步节省了功耗。
用户实现自己的低压检测功能的实现方法:首先用户需要在VCC很精准的情况下(比如5.0V),测量出内部BandGap参考电压的ADC转换值(比如为BGV5),并将这个值保存到EEPROM中,然后在低压检测的代码中,在实际VCC变化后,测量出的内部BandGap参考电压的ADC转换值(比如为BGVx),最后通过计算公式: 实际VCC = 5.0V * BGV5 / BGVx,即可计算出实际的VCC电压值。
However, this solution has flaws. The BandGap voltage of each STC15 microcontroller is different. When downloading each microcontroller, you need to modify the code yourself for adaptation, which is very troublesome. So updated plan 2
使用STC15单片机自带的AD口测量3.3V稳压芯片输出的电压,读取AD值为V33,我们知道。STC15单片机AD口的最大测量电压就是电源电压,且最大AD值为256,则电源电压与V33就有如下关系:
VCC/256=3.3/V33
推导出:VCC=256*3.3/V33,从而就可以较准确得到电池电压。误差与LDO输出的3.3V稳压值有关。
代码包括OLED显示、AS608指纹通讯驱动、按键扫描、电压测量、蜂鸣器、eeprom掉电保存、舵机驱动,软件延时等;
STC15W408AS的程序存储空间只有8K;
最初整个代码写下来已经超过8K了;后面各种压缩代码,终于达到现在的6、7K;
最主要的就是不要进行浮点运算,超级占用内存。比如之前计算电池电压,正常步骤:VCC=256*3.3/V33,这样就会有浮点计算的代码;
而且我们根本用不到精确到小数后6位的电压值,只需要后2位就行。所以我们可以先把要计算的数放大100倍,最后计算结果取整就行比如:VCC=256*330/V33。
First published, a fingerprint lock was produced in 2019 (without low-power design, large in size), it has been on a few hot searches, has not won any awards, and has never participated in a school defense.
Source code, schematics, PCB, etc. are all open source. GPL 3.0 Agreement
See the project for details; Most components can be purchased in Lichuang Mall; The fingerprint module AS608 protocol is universal and currently supports FPC0.5 and sh1.0, both of which are undercover.
Use demonstration video: https://b23.tv/FoQWJQ Detailed introduction video: https://b23.tv/dYXHFc
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet