Alarm Central

Post Reply
joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Alarm Central

Unread post by 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.
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 4022 times
Window Sensor Circuit Diagram.png
Window Sensor Circuit Diagram.png (17 KiB) Viewed 4022 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: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by 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 3786 times
DSC_0527.JPG
DSC_0527.JPG (330.58 KiB) Viewed 4017 times
DSC_0525.JPG
DSC_0525.JPG (372.01 KiB) Viewed 4017 times
DSC_0518.JPG
DSC_0518.JPG (367.04 KiB) Viewed 4017 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: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

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

joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by 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: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

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

Other components.

Comming next ...

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

Re: Alarm Central

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

Designing from ground up a full blown security system?

joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

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

Yes, it's my hobby.

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

Re: Alarm Central

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

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

User avatar
odroid
Site Admin
Posts: 32552
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 189 times
Been thanked: 352 times
Contact:

Re: Alarm Central

Unread post by 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?

joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by 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

User avatar
odroid
Site Admin
Posts: 32552
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 189 times
Been thanked: 352 times
Contact:

Re: Alarm Central

Unread post by 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?

joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by 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.

User avatar
odroid
Site Admin
Posts: 32552
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 189 times
Been thanked: 352 times
Contact:

Re: Alarm Central

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

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

joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by 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 2217 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 2217 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 2217 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.

User avatar
mad_ady
Posts: 6796
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 216 times
Been thanked: 166 times
Contact:

Re: Alarm Central

Unread post by 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... :)

joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by 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: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by joerg » Tue Oct 08, 2019 6:01 pm

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 574 times

User avatar
mad_ady
Posts: 6796
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 216 times
Been thanked: 166 times
Contact:

Re: Alarm Central

Unread post by mad_ady » Tue Oct 08, 2019 6:39 pm

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)

joerg
Posts: 908
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2
Location: Germany
Has thanked: 6 times
Been thanked: 21 times
Contact:

Re: Alarm Central

Unread post by joerg » Tue Oct 08, 2019 7:19 pm

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 563 times

User avatar
mad_ady
Posts: 6796
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 216 times
Been thanked: 166 times
Contact:

Re: Alarm Central

Unread post by mad_ady » Tue Oct 08, 2019 7:39 pm

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 7 guests