
{"id":8291,"date":"2020-08-26T06:26:44","date_gmt":"2020-08-26T06:26:44","guid":{"rendered":"http:\/\/szendreigabor.hu\/blog\/?p=8291"},"modified":"2020-08-26T07:18:18","modified_gmt":"2020-08-26T07:18:18","slug":"centralized-smart-house-controller-with-alarm-system","status":"publish","type":"post","link":"https:\/\/szendreigabor.hu\/blog\/2020\/08\/26\/centralized-smart-house-controller-with-alarm-system\/","title":{"rendered":"Centralized smart house controller with alarm system"},"content":{"rendered":"<p>2020.08.26. Centralized smart house controller with alarm system<\/p>\n<p>My father has a small weekend house, but he dreamed a very complicated system. The house has only three rooms (hall with kitchen, bathroom and bedroom), garage, cellar and garden.<br \/>\nThe wires, switches, plugs doors\/windows sensors and motion detectors were installed earlier by my father. The switches modified to push button. These send only impulses to the controller.<\/p>\n<p><a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_photo_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8342\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_photo_szendreigabor-580x384.jpg\" alt=\"Smart house controller - szendreigabor.hu\" width=\"580\" height=\"384\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_photo_szendreigabor-580x384.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_photo_szendreigabor-768x509.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_photo_szendreigabor-940x623.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_photo_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>In this city where this house is we are operating an monitored home security system via LoRa radio. We installed to our flats\/houses this alarm system. It&#8217;s decentralized. All devices can send alarm signal, receiving and processing other station signals.<br \/>\nIt has three main signals: Alarm (detect burglary), Water (detect flooding) and Fire (detect smoke and fire).<br \/>\nI had a good idea the house controller be able to communicate the alarm system.<\/p>\n<p>We counted inputs, outputs and we also formed reserves. The result is 32 inputs(12V), 16 outputs(12V) and 16 outputs(230V). Than I started to design the controller.<\/p>\n<p>I used: PIC24FJ64GA004 microcontroller, MCP23017 16-Bit I\/O Expander with I2C interfaces, MCP9808 temperature sensor, 24LC512 I2C Serial EEPROM, MOC3083 Zero-Cross optoisolator triac driver, BT136S-800 TRIAC, SUD50P06 FET, SI4421, RHF76-052, LoRa610 and some little components.<\/p>\n<p>I designed schematic and I drew PCB in EasyEDA designer.<\/p>\n<p>Microcontroller block<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_microcontroller_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8309\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_microcontroller_szendreigabor-580x545.jpg\" alt=\"Smart house controller - szendreigabor.hu\" width=\"580\" height=\"545\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_microcontroller_szendreigabor-580x545.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_microcontroller_szendreigabor-768x721.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_microcontroller_szendreigabor-940x883.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_microcontroller_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Radios, memory, temperature sensor block<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_radios_memory_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8311\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_radios_memory_szendreigabor-580x632.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"632\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_radios_memory_szendreigabor-580x632.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_radios_memory_szendreigabor-768x836.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_radios_memory_szendreigabor.jpg 940w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Input block (a part of it)<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_inputs_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8307\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_inputs_szendreigabor-580x356.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"356\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_inputs_szendreigabor-580x356.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_inputs_szendreigabor-768x472.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_inputs_szendreigabor-940x577.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_inputs_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>12V output block (a part of it)<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_230V_outputs_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8306\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_230V_outputs_szendreigabor-580x291.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"291\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_230V_outputs_szendreigabor-580x291.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_230V_outputs_szendreigabor-768x385.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_230V_outputs_szendreigabor-940x472.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_230V_outputs_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>230V output block (a part of it)<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_12V_outputs_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8305\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_12V_outputs_szendreigabor-580x278.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"278\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_12V_outputs_szendreigabor-580x278.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_12V_outputs_szendreigabor-768x368.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_12V_outputs_szendreigabor-940x450.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_12V_outputs_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>After I finished and checked the design I ordered the PCB.<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_pcb_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8310\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_pcb_szendreigabor-580x383.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"383\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_pcb_szendreigabor-580x383.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_pcb_szendreigabor-768x508.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_pcb_szendreigabor-940x621.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_pcb_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>When the PCB-s arrived I started to plant the components. In the first days I used for the tests an auxiliary PCB with a PIC microcontroller and connect via I2C bus to the main PCB.<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing1_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8313\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing1_szendreigabor-580x327.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"327\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing1_szendreigabor-580x327.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing1_szendreigabor-768x433.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing1_szendreigabor-940x530.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing1_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>When I finished a part of PCB I tested this area how to work.<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing2_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8314\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing2_szendreigabor-580x327.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"327\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing2_szendreigabor-580x327.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing2_szendreigabor-768x433.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing2_szendreigabor-940x530.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing2_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>First time to connected to display.<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing3_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8315\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing3_szendreigabor-580x327.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"327\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing3_szendreigabor-580x327.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing3_szendreigabor-768x433.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing3_szendreigabor-940x530.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing3_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Finally I wrote the program in C code. It&#8217;s an interesting fact that the firmware consists of two parts.<br \/>\nOne of the parts the alarm system and other is the house controller. I added the new house controller program (about 1000 lines) to the exist alarm system program (about 3000 lines) to in a different file.<br \/>\nIf I upgrade the alarm system or house controller, fortunately I don&#8217;t need to write two different program only need modify some lines.<\/p>\n<p>We were fully testing the PCB and firmware.<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing4_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8316\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing4_szendreigabor-580x327.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"327\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing4_szendreigabor-580x327.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing4_szendreigabor-768x433.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing4_szendreigabor-940x530.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_testing4_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>We installed the smart house controller into the wall.<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_installed_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8308\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_installed_szendreigabor-580x387.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"387\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_installed_szendreigabor-580x387.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_installed_szendreigabor-768x512.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_installed_szendreigabor-940x627.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_installed_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>A little bit later I made a new component to the house controller. It was the remote controller. It located about 4m from the main PCB. The remote controller included the display and buttons.<br \/>\nThe remote controller communicate with main PCB via I2C bus. Two PIC24FJ64GA004 microcontroller keep contact together.<br \/>\n<a href=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_remote_szendreigabor.jpg\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-8312\" title=\"Smart house controller with alarm system - designed by Gabor Szendrei\" src=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_remote_szendreigabor-580x387.jpg\" alt=\"smart house controller - szendreigabor.hu\" width=\"580\" height=\"387\" srcset=\"https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_remote_szendreigabor-580x387.jpg 580w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_remote_szendreigabor-768x512.jpg 768w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_remote_szendreigabor-940x627.jpg 940w, https:\/\/szendreigabor.hu\/blog\/wp-content\/uploads\/2020\/08\/smart_house_controller_remote_szendreigabor.jpg 1024w\" sizes=\"(max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>We installed the controller in January of 2020 and the remote controller was installed in march of 2020.<\/p>\n<p>It has been working well ever since too.<\/p>\n<p>Thank you for reading!<\/p>\n<p>Please don&#8217;t forget to like my page ;)<br \/>\n<a href=\"https:\/\/www.facebook.com\/szendreiblog\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.facebook.com\/szendreiblog\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2020.08.26. Centralized smart house controller with alarm system My father has a small weekend house, but he dreamed a very complicated system. The house has only three rooms (hall with kitchen, bathroom and bedroom), garage, cellar and garden. The wires, switches, plugs doors\/windows sensors and motion detectors were installed earlier by my father. The switches [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,82],"tags":[84,85,86,88,87],"class_list":["post-8291","post","type-post","status-publish","format-standard","hentry","category-elektronika","category-microcontroller","tag-c-code","tag-embedded-c","tag-embedded-hardware","tag-pic-microcontroller","tag-smart-house"],"_links":{"self":[{"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/posts\/8291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/comments?post=8291"}],"version-history":[{"count":36,"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/posts\/8291\/revisions"}],"predecessor-version":[{"id":8346,"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/posts\/8291\/revisions\/8346"}],"wp:attachment":[{"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/media?parent=8291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/categories?post=8291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/szendreigabor.hu\/blog\/wp-json\/wp\/v2\/tags?post=8291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}