It has been running at low power consumption for 91 days, the equipment has been shut down and no longer transmits data, and has not reached the 135-day goal;
Figure 1: The housing is dirty and the spring gasket does not appear to be stainless steel. It has taken effect.
Figure 2: After unscrewing the four screws, the interior is clean and free of water stains
Figure 3: The internal circuit is intact and continues to work after replacing the battery
//———————————————————————————————
The device has a certain waterproof capability. During outdoor operation, there was occasional light to moderate rain, but it did not affect the device.
//———————————————————————————————
Material
Power supply: 1 18650 battery (2000mah)
Main control: N76E003 microcontroller
Sensors: BMP180 air pressure sensor, BH1750 light sensor
Wireless serial port module: LC12S (2.4G)
LDO:XC6204
Shell: 3D printed PLA
Development environment: KEIL4
Circuit
PPG and PPG1 are push-pull outputs, which are used to power the sensor and provide pull-up power to the IIC bus.
CS1 is the sleep control pin of the wireless serial port module, which is set to open-drain output. (See the figure below for its features)
For some commonly used peripherals, it is certainly not ideal to connect them directly to the microcontroller power supply circuit. Even if they are low-power devices, even if they have a sleep mode, the current consumption is very high. What should we do?
1. Separate power supply: For some high-power peripherals, such as wireless communication modules, a MOS switch can be used to control whether to power the peripherals. For some low-power devices, such as op amps and memories, the actual maximum current consumption can be combined to directly use the I/O port to output a high level to power the chip. The I/O port can generally output 6-20ma, PP mode. Of course, don't forget to connect a very small resistor in series, 10 ohms, and the decoupling capacitor of the peripheral cannot be too large. If one I/O is not enough, you can use two to supply it together.
Make the output voltage of the voltage regulator slightly higher than the battery voltage, so that the battery will not be consumed when powered by an external power supply
Operation Logic
As can be seen from the above picture, this DIY does not have any external power supply (originally wanted to use solar energy, but gave up because of some well-known problems), the purpose is to test the ability of the N76E003 microcontroller to run with low power consumption (it had been running for 8 days before, and the lithium battery voltage dropped by 0.04V).
This experiment still uses the timed wake-up function of the N76E003 microcontroller, waking up once every 50 seconds, turning on the peripherals once an hour, and waking up the wireless serial port module to send detection data. After the transmission is completed, all peripherals are turned off, the push-pull mode is set low, and the wireless serial port module enters sleep mode.
For information about N76E003 MCU low power processing, please see here N76E003 Low Power Consumption (Power-down Mode & Timed Wake-up)
Structural design
Assembly drawing (the shell is still being printed, which will take about eight hours, and the finished product drawing will be added later)
Base (all with M4 screw holes)
Top cover (the protrusions on both sides are vent baffles to prevent rainwater from pouring in directly; the top opening is for the BH1750 light sensor)
The picture below shows the actual picture of the completed assembly. The bottom is provided with suction by four NdFeB. It is currently installed on the air conditioner outdoor unit.
data analysis
They are temperature, pressure, and light intensity. Through the above data, we can roughly analyze the daily sunset and sunrise, as well as temperature changes.
Main program code
#include "N76E003.h"
#include "Common.h"
#include "Delay.h"
#include "SFR_Macro.h"
#include "Function_define.h"
#include "BMP180.h"
#include "BH1750.h"
#define uint unsigned int
#define uchar unsigned char
uchar abc[17]; //Serial port send buffer
uint WktCount=0;
bit WktFlag=0;
sbit CS1=P0^5; //CS sleep pin, open drain output
sbit PPG=P1^7; //power supply pin, push-pull output
sbit PPG1=P3^0; //same as above
int main (void)
{
int i;
Set_All_GPIO_Quasi_Mode;
P05_OpenDrain_Mode; //Set to open drain mode
P13_OpenDrain_Mode; //Set to open drain mode
P14_OpenDrain_Mode; //Set to open drain mode
P17_PushPull_Mode; //Push-pull output
P30_PushPull_Mode;
//----------I/O port layout----------------
CS1=1; //Wireless module sleep
PPG=0; //Turn off the power supply of peripheral devices
PPG1=0;
set_P06;
set_P07; //Initialize the serial port
//---------I/O port initialization------------
Init_BH1750(); //Initialize the light sensor
set_ES_1; // Enable serial port 1 interrupt
InitialUART0_Timer1(9600);
//----------Serial port 1, serial port 0 configuration----------------
WKCON = 0x07; //Pre-scaling configuration 2048
RWK =255-211; //Set to 50s timing - 72 for one hour
set_EWKT; //Enable timer wake-up interrupt
set_WKTR; //Run the timer wake-up function
//----------WKT configuration------------------------
EA = 1; // Enable general interrupt
while(1)
{
if(WktFlag) //Determine if overflow
{
WktCount++;
WktFlag=0;
if(WktCount>=72)//send once every 1h
{
PPG=1; //Push-pull output, power supply for peripheral devices
PPG1=1;
CS1=0; //Pull low, ground to wake up the wireless transparent transmission module
Timer3_Delay100ms(1);
Init_BMP085(); //Initialize the barometer
bmp085Convert();
Timer3_Delay100ms(1);
EC_BH1750(); //Convert light intensity
abc[0]=0x54; //T temperature
abc[1]=temperature/100+48;
abc[2]=temperature%100/10+48;
abc[3]=0x2e;
abc[4]=temperature%10+48;
abc[5]=0x50; //P pressure
abc[6]=pressure/10000+48;
abc[7]=pressure%10000/1000+48;
abc[8]=pressure%1000/100+48;
abc[9]=0x4c; //L light
abc[10]=(int)BH1750_temp/10000+48;
abc[11]=(int)BH1750_temp%10000/1000+48;
abc[12]=(int)BH1750_temp%1000/100+48;
abc[13]=(int)BH1750_temp%100/10+48;
abc[14]=(int)BH1750_temp%10+48;
for(i=0;i<15;i++)
{
Send_Data_To_UART0(abc[i]);
}
WktCount=0;
}
ADCCON1 = 0X00; // Turn off ADC
clr_BODEN; //Disable undervoltage detection
set_PD; // Enter power-down mode
PPG=0; //Turn off the power supply of peripheral devices
PPG1=0;
CS1=1; //Wireless module enters sleep mode
}
}
}
//---------Timed wake-up interrupt service routine--------------
void WakeUp_Timer_ISR (void) interrupt 17
{
WktFlag=1;
clr_WKTF; //Clear WKT overflow flag
}
Summarize
Looking back at the previous blogs (articles on driving various sensors), I can see that I initially wanted to add GP2Y1010 (dust detection), DHT11 (temperature and humidity), HMC5883 (electronic compass), photoelectric encoder, etc. to measure wind speed and direction (see the figure below). Later, I gave up one by one due to size and power supply issues. The second is the lack of a good host computer. In the next few days, I will focus on learning python and QT, hoping to enter a new world.
Previous article:N76E003 HMC5883
Next article:N76E003 Ultrasonic Distance Measurement
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Another technical solution for power-type plug-in hybrid: A brief discussion on Volvo T8 plug-in hybrid technology
- FAQ_About the pulse problem when the output port of BlueNRG-2 remains at a low level in low power mode
- There are still some problems with the PCB diagram drawn by a novice
- Description and programming of interrupt process of c6000
- Does anyone have any good vibration detector solutions to recommend?
- SparkRoad OV2640 FPGA evaluation board test
- SparkRoad Review (9) - Routine GAME Test
- Domestic Soul Core II A high-performance processor
- [Bluesun AB32VG1 RISC-V Evaluation Board] Problems encountered: USB and Bluetooth
- Can you share your experience of learning FPGA?
- Why are the added including paths empty after installing TI products? Is it an installation or configuration problem?