当前位置:网站首页>Esp32 - ULP coprocessor reading Hall sensor in low power mode
Esp32 - ULP coprocessor reading Hall sensor in low power mode
2022-07-01 06:37:00 【Morning breeze】
Chen Tuo 2022/05/26-2022/05/30
1. summary
stay 《ESP32 How is the deep sleep current lower than 10uA》
https://zhuanlan.zhihu.com/p/521640890
https://blog.csdn.net/chentuo2000/article/details/125033711?spm=1001.2014.3001.5502
In this article, we tested ESP32 stay deep sleep Only... Is used in mode RTC The current when , In this article, we will start again ULP Coprocessor , test RTC and ULP When opened deep sleep electric current .
about ESP32 The current under various working modes can be referred to 《 understand ESP32 Sleep mode and its power consumption 》 One article .
https://zhuanlan.zhihu.com/p/521885688
https://blog.csdn.net/chentuo2000/article/details/125042156?spm=1001.2014.3001.5502
- Hall sensor
According to the Hall effect , When the current passes perpendicular to the magnetic field N Type semiconductor , An additional electric field will be generated in the direction perpendicular to the current and magnetic field , Thus, a potential difference is formed at both ends of the semiconductor , The specific level is related to the intensity of the electromagnetic field and the size of the current . When a constant current passes through a magnetic field or a current exists in a constant magnetic field , Hall effect sensor can be used to measure magnetic field strength . Hall sensors are widely used , Including proximity detection 、 location 、 Speed measurement and current detection, etc .
- ESP32 There is a built-in Hall effect sensor , It can detect the change of the surrounding magnetic field .
In this paper, the experiment ESP32-ULP How the coprocessor reads chips in low power mode Hall sensor .
This example ULP Coprocessor every 3 Wake up once per second , After waking up, read the hall sensor value in low power consumption mode , adopt hall phase shift two , Read vp and vn Two values each, four values in total , Subtract the common mode part to get offset value , This value can be used to characterize the influence of the environment on the hall sensor .
2. Official documents
- Official routine
ULP The coprocessor reads the on-chip Hall sensor in low-power mode HALL SENSOR
https://github.com/espressif/esp-iot-solution/tree/release/v1.1/examples/ulp_examples/ulp_hall_sensor
You can see the official routine in esp-iot-solution In the library .
- ESP-IoT-Solution brief introduction
https://docs.espressif.com/projects/espressif-esp-iot-solution/zh_CN/latest/gettingstarted.html
- ESP-IoT-Solution edition
Different versions ESP-IoT-Solution The explanation is as follows :
- ESP-IoT-Solution Programming Guide
https://docs.espressif.com/projects/espressif-esp-iot-solution/zh_CN/latest/index.html
3. obtain ESP-IoT-Solution
- Get orders
If from the official of Lexin github Library Download is difficult , You can start with gitee Clone a library on , And then from gitee Upload and download . Here is the download from my cloned Library , My library is private , You need to clone one yourself .
- Official routine
Be careful , The hall sensor routine is v1.1 In the version .
- download esp-iot-solution v1.1
cd ~/esp
git clone -b release/v1.1 --recursive https://gitee.com/chentuo2000/esp-iot-solution.git
from gitee When downloading clone library , The subject is going well , Having trouble downloading submodules , You need to manually download the following sub modules :
Download manually according to the source and the corresponding installation path .
If you still can't download , You can download this from the link below 3 Sub module :
download Adafruit-GFX-Library.tar.gz
https://download.csdn.net/download/chentuo2000/85481416
download ugfx.tar.gz
https://download.csdn.net/download/chentuo2000/85481491
download lvgl.tar.gz
https://download.csdn.net/download/chentuo2000/85481538
4. development environment
《 Use Lexin domestic Gitee Image building ESP32 development environment 》
https://zhuanlan.zhihu.com/p/348106034
https://blog.csdn.net/chentuo2000/article/details/113424934?spm=1001.2014.3001.5501
5. Build the project
- Copy official routine
Copy the official example project to ESP-IDF Beyond development tools :
cd ~/esp
cp -r ~/esp/esp-iot-solution/examples/ulp_examples/ulp_hall_sensor ~/esp/
- Project tree
cd ulp_hall_sensor
- Refresh esp-idf Environmental Science
get_idf
Be careful : Each time you open the terminal, enter sdk Execute this command once
- Set the target chip
idf.py set-target esp32
- Clear previous builds
- Configuration items
idf.py menuconfig
1) Set up Flash The memory size is 4MB
2) ULP It is enabled by default
preservation , sign out .
- Compile the project
idf.py build
- Burn project
see USB Serial port COM slogan :
burning :
idf.py -p /dev/ttyS3 -b 115200 flash
- Enable monitor
idf.py monitor -p /dev/ttyS3
(Ctrl+] You can exit the monitor program )
6. Sample test
This example ULP Coprocessor every 3S Wake up once , After waking up, read the hall sensor value in low power consumption mode , adopt hall phase shift two , Read vp and vn Two values each, four values in total , Subtract the common mode part to get offset value , This value can be used to characterize the influence of the environment on the hall sensor . Pictured , The first printed value is the hall sensor value measured when there is no strong magnetic field around ; The value printed for the second time is using a neodymium iron boron magnet N Very close ESP32 The value obtained when ; The value printed for the third time is that of NdFeB magnet S Very close ESP32 The value obtained when , It can be seen that the value of Hall sensor has changed greatly .
- The system starts the serial port output
There is no strong magnetic field around
magnetic N Very close ESP32
magnetic S Very close ESP32
- deep sleep electric current
and 《ESP32 How is the deep sleep current lower than 10uA》 In this article, only RTC Comparison ,deep sleep The current is about 2uA, Still less than 10uA.
边栏推荐
- HW(OD)岗面试题
- [ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security
- Several ways of gson's @jsonadapter annotation
- Summary of wechat official account embedded program to jump to wechat
- 存储函数学习笔记
- [ITSM] what is ITSM and why does it department need ITSM
- 数据库对象:视图学习记录
- Notes on probability theory
- 嵌入式系统
- Database notes
猜你喜欢

Design of sales management system for C language course (big homework)

Methods of downloading Foreign Periodicals

C语言课设图书信息管理系统(大作业)

【微信小程序】一文解决button、input、image组件

关于变量是否线程安全的问题

NOC 设计的一些坑

Record MySQL troubleshooting caused by disk sector damage
![[unity shader custom material panel part II]](/img/d1/8632ae680299a27b7431b2d6e03fd3.png)
[unity shader custom material panel part II]

Async and await

mysql学习
随机推荐
C#如何打印输出原版数组
C language course is provided with employee information management system (large operation)
【Unity Shader 消融效果_案例分享】
Rotate the animation component around the circle, take it and use it directly
H5 web page determines whether an app is installed. If it is installed, it will jump to the summary of the scheme to download if it is not installed
mysql数据类型学习笔记
了解ESP32睡眠模式及其功耗
C language course set up library information management system (big homework)
软件工程领域的名词描述
MySQL constraint learning notes
ESP32在电池供电时用ULP监测电池电压
[unity shader custom material panel part I]
K8S搭建Redis集群
Forkjoin and stream flow test
[ManageEngine Zhuohao] the role of LAN monitoring
On whether variables are thread safe
PAT (Advanced Level) Practice 1057 Stack
【微信小程序低代码开发】二,在实操中化解小程序的代码组成
Student attendance system for C language course (big homework)
Methods of downloading Foreign Periodicals