【DigiKey Creative Competition】Smart Home Control System
[Copy link]
This post was last edited by beyond_笑谈 on 2024-1-18 13:57
Smart home control system
1. Introduction
Design name: Touch-controlled intelligent home control system design
Project description: The home appliances are turned on and off through the touch screen and external switches, and the current working status of the home appliances is displayed accordingly. PIC32-MAXI-WEB demo (MCU: PIC32MX795F512L, PIC microcontrollers are often used in industrial control and home appliances due to their high reliability and excellent anti-interference performance) is used as the main control board, and external expansion switches and LED boards are used to replace switches and lights in the home control system.
The work is shown below:
2. System Block Diagram
The system application diagram is as follows:
As shown in the system application diagram, the entire design scheme is implemented using demo and external expansion modules.
3. Functional description of each part
As shown in the circled area below, a dip switch is used to replace the commonly used skipping switch at home, and an external 3V battery is used for power supply. IN1 is the switch detection signal, and the MCU can collect the switch status through the level detection function.
As shown in the circled area in the figure below, LED is used instead of lighting. When the controller outputs a control signal and turns on the switch side of the isolation relay S1, the LED lights up. The switch, control board, and LED all use different power supplies and voltage signals to simulate the isolated power supply of each load in an actual home control system.
4. Source Code
The main source code of the test is as follows. The signal status is read and the output control signal is output in the test program.
void vTaskTest( void * pvParameters )
{
xSemaphoreTake(xSemaphorePrint, portMAX_DELAY);
while(1); {
xSemaphoreTake(xSemaphorePrint, portMAX_DELAY);
switch(ProdTestType) {
case PROD_TEST_NONE:
break;
case PROD_TEST_EXTCON:
vTaskSuspend(pxTaskIO);
ExtConTestAll();
UserPeriphInit();
vTaskResume(pxTaskIO);
break;
case PROD_TEST_USBOTG:
break;
case PROD_TEST_CAN:
StatLEDSet(1, FALSE);
StatLEDSet(2, FALSE);
StatLEDSet(3, FALSE);
{
int counter = 4000;
char ch;
CANtesting(1);
while(counter--) {
CANtesting(0);
if( UartCommRead(&ch, 1) ) {
UartCommWrite(&ch, 1);
ch = '*';
UartCommWrite(&ch, 1);
}
vTaskDelay(5);
}
}
StatLEDSet(1, FALSE);
StatLEDSet(2, FALSE);
StatLEDSet(3, TRUE);
break;
}
ProdTestType = PROD_TEST_NONE;
}
}
Source code link: https://download.eeworld.com.cn/detail/beyond_%E7%AC%91%E8%B0%88/630634
5. Demonstration video of the work’s functions
The demonstration video mainly simulates the usage in home control and demonstrates the actual operation.
Video link: https://training.eeworld.com.cn/video/38917
6. Project Summary
Project summary: The switch control of the home control system is realized by means of a touch screen and a mechanical switch, and the icons and LEDs on the touch screen are used to display the status of the controlled home appliances, thereby realizing the conceptual design of a smart home control system.
Note: This post is mainly to organize the content of previous posts (posts posted within the specified time, link: https://en.eeworld.com/bbs/thread-1268635-1-1.html ) for easy reading, thank you.
|