In response to the current increasing demand for vehicle refueling, an intelligent refueling system is developed based on STM32 development technology and sensor technology. The intelligent refueling system should have the functions of fuel quantity control, pricing based on fuel costs, and refueling environment detection. The system can simulate the entire process of car refueling and has the function of remote control.
This graduation project is the design and implementation of an intelligent refueling system. The modules included in the design mainly include OLED display circuit, solenoid valve drive circuit, combustible gas sensor module, ds18b20 digital temperature sensor, buzzer alarm module, WIFI module, and button circuit. modules and power modules. The intelligent refueling system is realized through the cooperation between modules. Once there is an abnormal temperature or the concentration of combustible gas exceeds the standard, a warning will be issued to the management personnel through the wifi module.
The stm32f103c8t6 collects the temperature from the ds18b20 temperature sensor in real time. If the temperature is lower or higher than the specified threshold, the buzzer will sound an alarm , and the solenoid valve will be closed at the same time. No refueling will be performed, and the temperature information will be uploaded to the background through the WIFI module to remind the background work personnel handle it in a timely manner.
0.96-inch OLED display : It uses a 0.96- inch OLED 128x64 pixel yellow and blue two-color display. The internal driver chip is SSD1315 and uses SPI two-line communication. It is mainly used to display the current oil price, refueling amount and refueling volume, etc.
A 0.1uF filter capacitor is added to the power supply.
Solenoid valve drive circuit : When the base level of the 8050 transistor is high, the transistor is in a saturated state, and the field effect transistor IRF9530 acts as an electronic switch. The IRF9530 adds a driving voltage, the drain obtains an amplified current, and the solenoid valve is closed; when the P0_1 output is low Normally, the base voltage of the transistor is 0, which makes the transistor in a cut-off state. The field effect transistor does not meet the conduction conditions and is also in a cut-off state, and the solenoid valve is disconnected.
Since IRF9530 is a PMOS tube and a voltage-controlled device, R9 and R10 can be proportional, and there is no need to follow the resistance values exactly as shown in the picture.
Temperature sensor : DS18B20 temperature sensor is used , which uses a single bus interface to connect to the microprocessor. Only one port line is needed to achieve two-way communication between the microprocessor and DS18B20. The single bus has good economy, strong anti-interference ability, and is suitable for on-site temperature measurement in harsh environments.
It is best to connect the signal terminal to a pull-up resistor when using it.
Combustible gas sensor : Using MQ-9 combustible gas sensor module, it has DO switch signal (TTL) output and AO analog signal output; the TTL output effective signal is low level. Analog signal output voltage, the higher the concentration, the higher the voltage.
The purchase was wrong. The MQ-6 liquefied gas sensor module should be used, which can be a perfect replacement without changing the circuit diagram and code. In this project, only the DO signal is used, and the ADC is not used to collect the AO signal.
WIFI module : ESP12F series modules are a series of low-power UART-WiFi chip modules based on Espressif ESP8266 developed by Shenzhen Anxinke Technology Co., Ltd., which can easily carry out secondary development, access cloud services, and realize mobile phone 3 /4G global control anytime and anywhere to accelerate product prototype design. The module core processor ESP8266 integrates the industry-leading Tensilica L106 ultra-low power consumption 32-bit micro MCU in a smaller size package, with 16-bit reduced mode, main frequency supports 80 MHz and 160 MHz, supports RTOS, and integrates Wi-Fi MAC/ BB/RF/PA/LNA, onboard antenna. Supports standard IEEE802.11 b/g/n protocol and complete TCP/IP protocol stack. Users can use this module to add networking capabilities to existing devices or build independent network controllers. This system uses this module to upload data, which can upload data to the backend server in real time for data storage and big data processing.
Only the rx and tx interfaces of esp8266 are used, controlled through AT commands.
Power supply module : The power supply adopts a two-level voltage dividing module, and the power supply voltage is 12V6A power supply, which is used for solenoid valves and water pumps. The 12V is then stabilized to 5V through the 7805 module for use by the combustible gas sensor module, and then through AMS1117-3.3. 5V is divided to 3.3V for use by other peripheral devices such as microcontrollers, ds18b20 temperature sensors, OLED displays, and LED lights.
Main control module: STM32F103C8T6 (STM32F103C6T6 is also available) is a 32-bit microcontroller based on the ARM Cortex-M core STM32 series . The program memory capacity is 64KB and requires a voltage of 2V~3.6V. This system uses stm32f103c8t6 as the main control module. , collect the infrared sensor to obtain the temperature in real time. If the temperature is lower or higher than the specified threshold, operate the TFT display to display the temperature abnormality and the voice module to broadcast, and at the same time control the servo to close, simulate the gate closing state, and transmit the temperature information through the wifi module Upload to the background to remind the background staff to report and process.
In the smallest system of stm32, filter capacitors should be added to the VDD pins of the chip. I was too lazy to add a [manual dog head]. I hope everyone will not follow my [manual dog head], but the impact will not be big [manual dog head] .
PCB size is 100mm*55mm.
The TFT screen supporting copper pillars are M2*14mm copper pillars.
The diameter of the through holes at the four corners of the board is M2.
7805 is in SOT252 package, and IRF9530 and 7805 are both SMD ones. I hope you don’t accidentally buy direct plug-in ones like me...
For DS18B20, you can choose the one with wires or the one with direct plug-in. Just be careful not to solder it backwards.
There is something wrong with the packaging and shape of the OLED screen. It may not match the copper pillar holes of the OLED screen you bought. You can adjust it yourself if necessary.
The program is generated through STM32CubeMx, a lazy artifact. The main code is as follows: please see the attachment for the detailed code.
if(interface == 0){ //如果是在加油界面
yj92 = youjia92*100;
yj95 = youjia95*100;
yj98 = youjia98*100;
OLED_ShowNum(56,line3,yj92 / 100 ,2,8); //显示92油价
OLED_ShowNum(80,line3,yj92 % 100 ,2,8);
OLED_ShowNum(56,line5,yj95 / 100 ,2,8); //显示95油价
OLED_ShowNum(80,line5,yj95 % 100 ,2,8);
OLED_ShowNum(56,line7,yj98 / 100 ,2,8); //显示98油价
OLED_ShowNum(80,line7,yj98 % 100 ,2,8);
if(line_checked){
line_checked = 0;
OLED_Clear_Check();
OLED_ShowCHinese(112,line,17);
}
}else if(interface == 1){
switch(line){
case 2:
flow = money / youjia92;
yj92 = youjia92*100;
OLED_ShowNum(40,line3,yj92 / 100 ,2,8); //显示92油价
OLED_ShowNum(64,line3,yj92 % 100 ,2,8);
break;
case 4:
flow = money / youjia95;
yj95 = youjia95*100;
OLED_ShowNum(40,line3,yj95 / 100 ,2,8); //显示95油价
OLED_ShowNum(64,line3,yj95 % 100 ,2,8);
break;
case 6:
flow = money / youjia98;
yj98 = youjia98*100;
OLED_ShowNum(40,line3,yj98 / 100 ,2,8); //显示98油价
OLED_ShowNum(64,line3,yj98 % 100 ,2,8);
break;
}
flows = flow * 100;
OLED_ShowNum(72,line5,money,3,8); //显示加油金额
OLED_ShowNum(56,line7,flows/100,2,8); //显示加油量
OLED_ShowNum(80,line7,flows%100,2,8); //显示加油量
}
if(jiayou_flag == 1){
jiayou_flag = 0;
OLED_Clear();
OLED_ShowCHinese(0,line4,29); //正
OLED_ShowCHinese(16,line4,30); //在
OLED_ShowCHinese(32,line4,24); //加
OLED_ShowCHinese(48,line4,14); //油
OLED_ShowChar(64,line4,'.',8); //.
OLED_ShowChar(72,line4,'.',8); //.
OLED_ShowChar(80,line4,'.',8); //.
OLED_ShowChar(88,line4,'.',8); //.
OLED_ShowChar(96,line4,'.',8); //.
jiayou(time);
OLED_Clear();
OLED_ShowCHinese(32,line4,24); //加
OLED_ShowCHinese(48,line4,14); //油
OLED_ShowCHinese(64,line4,31); //完
OLED_ShowCHinese(80,line4,32); //成
HAL_Delay(1000);
display_init(); //返回油价界面
}
Main control module: stm32f103c8t6/stm32f103c6t6.
LCD: 0.96-inch OLED screen (new version, GND is on the front, don’t buy the wrong one). Link: https://m.tb.cn/h.fMdZN35?tk=M5A6251pot3
Temperature sensor: ds18b20, plug-in or wired, both are acceptable.
WIFI module: ESP12F, one is free at Lichuang Mall for over 200 yuan, and a certain treasure is more than ten yuan (some fish disassembled parts cost a few yuan each).
Power module: LM1117-3.3/AMS1117-3.3, 7805.12V5A and above. Link: https://m.tb.cn/h.foWL21O?tk=7B5b251qMri
Solenoid valve: 12V solenoid valve is enough. Link: https://m.tb.cn/h.foWLLdM?tk=UNu1251JVdH
Water pump: 12V water pump is sufficient. Link: https://m.tb.cn/h.fn3aQQt?tk=AU6j251JsJ3
You need to connect the lines of the water pump and the solenoid valve together, and then connect them to the J3 port. The solenoid valve is not divided into positive and negative, but the water pump is divided into positive and negative, so do not connect them reversely (although it will not be damaged if they are connected reversely, but the water supply Blowing bubbles in it is of no use).
If there are any shortcomings, please correct me.
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