Alarm Central

Moderators: odroid, mdrjr

Alarm Central

Unread postby joerg » Mon Nov 21, 2016 2:59 am

Already in the Odroid Magazine published... Here is now the forum site of my project Alarm Central.

The window sensor.

Sensor and nRF24L01.jpg

Window Sensor pcb .png
Window Sensor pcb .png (15.81 KiB) Viewed 2237 times

Window Sensor Circuit Diagram.png
Window Sensor Circuit Diagram.png (17 KiB) Viewed 2237 times

The firmware is made on Attiny84 processor. A sensor takes about 17uA average current, and sends the state every 4s to the central.
The files are on Github: https://github.com/joerg65/rf24_window
The hardware files (KiCad) are also on Github:https://github.com/joerg65/rf24_window_hw
Last edited by joerg on Thu Apr 20, 2017 6:37 pm, edited 1 time in total.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby joerg » Mon Nov 21, 2016 3:00 am

The motion sensor.

nRF24 Motion Sensor Circuit Diagram.JPG
nRF24 Motion Sensor Circuit Diagram.JPG (269.02 KiB) Viewed 2001 times

DSC_0527.JPG
DSC_0527.JPG (330.58 KiB) Viewed 2232 times

DSC_0525.JPG
DSC_0525.JPG (372.01 KiB) Viewed 2232 times

DSC_0518.JPG
DSC_0518.JPG (367.04 KiB) Viewed 2232 times


The firmware is made on ATtiny84. The MCU communicates with the ultra low current motion controller E931.96. The connected sensor is a LHi968. If a motion is detected or every 4s the state of sensor and battery voltage is sent via nRF24. After sending, the cpu goes sleep. The current consumption is about 32uA average. Two lithium cells AA (3000mAh), should stay about 4 to 8 years. The lifetime depends on the amount of detected motion.

The firmware can be found here: https://github.com/joerg65/rf24_motion
And the KiCad project here: https://github.com/joerg65/rf24_motion_hw
Last edited by joerg on Sat Jun 10, 2017 3:05 pm, edited 2 times in total.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby joerg » Mon Nov 21, 2016 3:01 am

The Android App.

Comming next ...
Screenshot_2016-11-20-19-18-33.png
Screenshot_2016-11-20-19-18-33.png (55.29 KiB) Viewed 2001 times

Screenshot_2016-11-20-09-21-52.png
Screenshot_2016-11-20-09-21-52.png (42.37 KiB) Viewed 2001 times

Screenshot_2016-11-20-09-20-05.png
Screenshot_2016-11-20-09-20-05.png (46.33 KiB) Viewed 2001 times
Last edited by joerg on Sat Jun 10, 2017 3:10 pm, edited 3 times in total.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby joerg » Mon Nov 21, 2016 3:02 am

The Central (the Odroid C1+ and VU7+).

Comming next ...
DSC_0405.JPG
(92.35 KiB) Downloaded 698 times

DSC_0417.JPG
(150.88 KiB) Downloaded 698 times
Last edited by joerg on Mon Nov 21, 2016 3:30 am, edited 1 time in total.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby joerg » Mon Nov 21, 2016 3:03 am

Other components.

Comming next ...
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby rooted » Mon Nov 21, 2016 3:03 am

Designing from ground up a full blown security system?
User avatar
rooted
 
Posts: 5900
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Alarm Central

Unread postby joerg » Mon Nov 21, 2016 3:04 am

Yes, it's my hobby.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby rooted » Mon Nov 21, 2016 3:12 am

Very nice, I will definitely be following your progress :)
User avatar
rooted
 
Posts: 5900
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Alarm Central

Unread postby odroid » Mon Nov 21, 2016 11:01 am

I've read your article on November issue. Nice and useful item in the real world. :D

average 17uA is quite impressive.
How long time the Attiny MCU is alive to check the lead switch and transmitting the 20byte data via nRF24L01 ?
a few milliseconds?
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Alarm Central

Unread postby joerg » Tue Nov 22, 2016 4:46 am

@odroid
I checked again with oscilloscope. The Attiny wakes up every 4s, then a period of 2.6mA for 7ms and a rush of 23mA for 250us. During sleep it is 6uA.
The structure is:
- Wake up
- Read DI
- delay 2ms
- Read battery voltage 4 times
- Calculate a CRC
- Encode payload AES128
- Power up nRF24
- delay 3ms
- Transmit payload
- Go to sleep
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby odroid » Tue Nov 22, 2016 10:05 am

Thank you for the detail explanation.
It is really helpful to build an extremely low power RF things.
I want to make a similar item with our Weather board via bit-banging software driven I2C host on Attiny84. :)
3~4 years of running time will be amazing !

One more question.
What is average normal distance of RF communication in open space?
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Alarm Central

Unread postby joerg » Tue Nov 22, 2016 6:27 pm

I was able to receive signals within 15 meters in open space, maybe more is possible. It depends also on the direction of the antenna, the one on the sensor and the one on the C1.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby odroid » Wed Nov 23, 2016 10:19 am

Okay. 10~20 meters should be fine for my application.
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Alarm Central

Unread postby joerg » Thu Nov 01, 2018 11:46 pm

The app is discontinued. I decided to not follow this way anymore. The reason is that it never worked as stable as I wanted.

By inspiration of @mad_ady, I ported already a lot of stuff to Home Assistant. I am now testing how stable it works.
The nRF24 library for my sensors I ported to run on Ubuntu. One Odroid C1 is running in the living room to receive the states of the sensors and sends mqtt messages to another Odroid C1 that is integrated in the electric central acting as Home Assistant server.
The sensor card is a custom card I made for the Lovelace UI:
Bildschirmfoto vom 2018-11-01 14-42-47.png
Bildschirmfoto vom 2018-11-01 14-42-47.png (53.93 KiB) Viewed 432 times

For the covers I made a command line prog that manage the covers time controlled. None of the build in covers of Home Assistant has fulfilled my demand. Home Assistant sends an init message and the prog creates a cover with specified time for open and close. The prog sends back position from 0 to 100%.
Bildschirmfoto vom 2018-11-01 15-20-41.png
Bildschirmfoto vom 2018-11-01 15-20-41.png (85.27 KiB) Viewed 432 times

For the inputs and outputs that are connected via i2c I made a prog that communicate via wiringPi and sends states of the inputs by mqtt messages. And of course receives mqtt messages to control the outputs.
Bildschirmfoto vom 2018-11-01 15-21-21.png
Bildschirmfoto vom 2018-11-01 15-21-21.png (70.62 KiB) Viewed 432 times

The automation part is running now stable for some weeks. Before I tested the Home Assistant on a Pi B, but it was terrible slow. There was a dead time of about 500ms, when I pressed a button, with the C1 there is practical no dead time.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2

Re: Alarm Central

Unread postby mad_ady » Fri Nov 02, 2018 12:30 am

"To err is human, but to really foul things up you need a computer."

Even with Home Assistant running beautifully, there may be some corner cases that are hard to anticipate and that can give you a hard time. A couple of weeks ago I managed to DDoS my mqtt broker with lots of messages from a faulty pir sensor that was causing me to be unable to turn off the gas heater via the thermostat. Try explaining to the missus why the kids were sweating at 07:00... :)
User avatar
mad_ady
 
Posts: 4921
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Alarm Central

Unread postby joerg » Fri Nov 02, 2018 12:40 am

Ha, yes I know. It was hard time to learn to integrate things to HA. Also a reason I was as mute as a fish here last months.
joerg
 
Posts: 808
Joined: Tue Apr 01, 2014 2:14 am
Location: Germany
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2


Return to Projects

Who is online

Users browsing this forum: No registered users and 0 guests