Alarm Central

Post Reply
User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Alarm Central

Post by joerg »

Already in the Odroid Magazine published... Here is now the forum site of my project Alarm Central.
Part#1 https://magazine.odroid.com/wp-content/ ... df#page=17
Part#2 https://magazine.odroid.com/wp-content/ ... df#page=27

The window sensor.
Sensor and nRF24L01.jpg
Window Sensor pcb .png
Window Sensor pcb .png (15.81 KiB) Viewed 7820 times
Window Sensor Circuit Diagram.png
Window Sensor Circuit Diagram.png (17 KiB) Viewed 7820 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.

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

The motion sensor.
nRF24 Motion Sensor Circuit Diagram.JPG
nRF24 Motion Sensor Circuit Diagram.JPG (269.02 KiB) Viewed 7584 times
DSC_0527.JPG
DSC_0527.JPG (330.58 KiB) Viewed 7815 times
DSC_0525.JPG
DSC_0525.JPG (372.01 KiB) Viewed 7815 times
DSC_0518.JPG
DSC_0518.JPG (367.04 KiB) Viewed 7815 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.

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

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 7584 times
Screenshot_2016-11-20-09-21-52.png
Screenshot_2016-11-20-09-21-52.png (42.37 KiB) Viewed 7584 times
Screenshot_2016-11-20-09-20-05.png
Screenshot_2016-11-20-09-20-05.png (46.33 KiB) Viewed 7584 times
Last edited by joerg on Sat Jun 10, 2017 3:10 pm, edited 3 times in total.

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

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.

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

Other components.

Comming next ...

User avatar
rooted
Posts: 7985
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 724 times
Been thanked: 243 times
Contact:

Re: Alarm Central

Post by rooted »

Designing from ground up a full blown security system?

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

Yes, it's my hobby.

User avatar
rooted
Posts: 7985
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 724 times
Been thanked: 243 times
Contact:

Re: Alarm Central

Post by rooted »

Very nice, I will definitely be following your progress :)

User avatar
odroid
Site Admin
Posts: 35314
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 1090 times
Been thanked: 826 times
Contact:

Re: Alarm Central

Post by odroid »

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
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

@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

User avatar
odroid
Site Admin
Posts: 35314
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 1090 times
Been thanked: 826 times
Contact:

Re: Alarm Central

Post by odroid »

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
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

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.

User avatar
odroid
Site Admin
Posts: 35314
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 1090 times
Been thanked: 826 times
Contact:

Re: Alarm Central

Post by odroid »

Okay. 10~20 meters should be fine for my application.

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

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 6015 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 6015 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 6015 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.

mad_ady
Posts: 8466
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 578 times
Been thanked: 461 times
Contact:

Re: Alarm Central

Post by mad_ady »

"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
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

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.

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

At my door station I have to replace the so far used Tinker Board with a C2. My problem is, I need to remove the heatsink. There is because the slim design not enough place for the heatsink. But I wonder if it is safe to do that, or could it be to underclock the C2, lower than the 1536Mhz? I am running last Android M on the C2.
Background is that I need Bluetooth and Wifi at the same time. Years ago I had the idea that the TB has it onboard. When I tried it now with an new Danalock V3 doorlock the TB cutted always the Wifi when Danalock app was communicating by Bluetooth with the lock. That was on Android N. On Android M, the Bluetooth was not running at all. I setted up a new Odroid C2 with everything I need and it is running well.
Only the heatsink is disturbing to finish that.
IMG_20191008_104649.jpg
IMG_20191008_104649.jpg (596.89 KiB) Viewed 4372 times

mad_ady
Posts: 8466
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 578 times
Been thanked: 461 times
Contact:

Re: Alarm Central

Post by mad_ady »

Yes, you can remove the heatsink and run it at a lower frequency. You should be able to control top frequency from /sys (on boot), based on the governor you use. Should be writable in /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq.

Nice looking frame you have there for the VU7. Care to show us more of it? An article, perhaps?
These users thanked the author mad_ady for the post:
joerg (Tue Oct 08, 2019 6:53 pm)

User avatar
joerg
Posts: 1152
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 55 times
Been thanked: 128 times
Contact:

Re: Alarm Central

Post by joerg »

An article, perhaps?
Did you know that there are already ghost writers out there? :o
Bildschirmfoto vom 2019-10-08 12-08-20.png
Bildschirmfoto vom 2019-10-08 12-08-20.png (81.04 KiB) Viewed 4361 times

mad_ady
Posts: 8466
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 578 times
Been thanked: 461 times
Contact:

Re: Alarm Central

Post by mad_ady »

I was referring to documenting the physical build of the vu7 frame :D

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests