Anyone interested in discussing building DIY Home Automation software and hardware?

Thanks NeverDie for the update. I assume your packet size is relatively small and you have a delay somewhere, if not then 230ms for a round trip at 250kbps would be about 3K of data if there are no other source of delays (3KB * 10 bits per byte sent * 2 hops / 230ms = approx. 250kbps) if my math is correct.
 
Do let us know how your NRF experiments go.
 
After fixing some things and tweaking the radio by adjusting the packet size to exactly fit the data payload, I re-ran the Ciseco test.  Now I'm getting a roundtrip time of 9.8ms, and a packet loss of 0.73%.  These are closer to the numbers I was expecting.  There's a bit more tweaking I could do, but this is likely near the point of diminishing returns.
 
So, now I'll try it with the NRF24L01+.
 
FYI, I just noticed the JeeLabs is back alive and doing interesting things:
DSC_4892-Version-2.jpg

http://jeelabs.org/book/1501a/
 
The last time I checked Jeelabs (I guess it must have been quite a while ago), the guy running it had thrown in the towel and it was static.  Not anymore.
 
Jeelabs seems like a good resource for the DIY wireless aspects of DIY home automation.
 
deandob said:
Thanks NeverDie for the update. I assume your packet size is relatively small and you have a delay somewhere, if not then 230ms for a round trip at 250kbps would be about 3K of data if there are no other source of delays (3KB * 10 bits per byte sent * 2 hops / 230ms = approx. 250kbps) if my math is correct.
 
Do let us know how your NRF experiments go.
 
It turns out the two types of  NRF24L01+ modules that I currently have are using Nordic chips that are bogus counterfeits.  What a waste of time!  I just now posted my findings here:
http://forum.mysensors.org/topic/1664/which-are-the-best-nrf24l01-modules
 
Here's a photo I took of the modules:
1436978544939-nrf24.jpg

 
You can click through the photo to see more detail.
 
Bloody Hell!  I paid good money for these modules.  Where can I buy modules that aren't fake?
 
So, to finish this up: I re-ran the Ciseco test, but this time using a pair of "NRF" epoxy blob modules set at 1mbps because they can't do 250kbps like a real NRF24L01+ could.  I sent through over a half million packets, and guess what?  It wins!  Average packet loss was 0.12% and average round trip time was 2.1ms.  Wow.  I'm very surprised by the results, as all it has for an antenna is a PCB trace.
 
The Addicore module definitely lost the bake-off.  I reported its times in the mysensors link I posted above.
 
Hmm. Thanks for the link, didn't know about fake NRF chips. Looks like I have the fakes (although performance has been fine).
 
Thanks for the link - looks popular in Europe especially.
Code doesn't appear to be available. Looks like it would be easy to setup - has anyone on this forum evaluated or used it?
All HA systems should have this level of history graphing - statistics and history are an important dimension of HA.
 
NeverDie said:
FYI, I just noticed the JeeLabs is back alive and doing interesting things:
DSC_4892-Version-2.jpg

http://jeelabs.org/book/1501a/
 
The last time I checked Jeelabs (I guess it must have been quite a while ago), the guy running it had thrown in the towel and it was static.  Not anymore.
 
Jeelabs seems like a good resource for the DIY wireless aspects of DIY home automation.
 
 
 
Jeelabs is awesome! He inspired me in part to build my own home automation system. He's a big AVR Atmel fan but I'd suggest that anybody who's serious a out DIY home automation not use Atmel as they're quite energy hungry and relatively expensive.
 
I recommend EFM32 range of microcontrollers from SiLabs for power management. You can't beat them!
 
Hi Trev (& fellow Aussie).
 
Thanks for the link. I really like what you are doing, especially doing it from first principles and designing and making it all yourself - Bravo! I assume you are in the electronics business as some of the parts you designed (eg. RF radios) are not for beginners, if you don't have formal electronic qualifications then even more kudos. I'm interested in the mesh protocol you designed - or did you use something like 6loWPAN? Do post more details. In the previous version of my HA system I designed and implemented a RS485 protocol from scratch & its very satisfying to see the circuits and protocol from first principles working.
 
I wrote up a similar thread in the introductions section but it didn't get any responses until I moved it over to this forum - you may want to do the same and create your own thread (although you are welcome on this one of course).
 
Hi DeanDob
 
Nice to meet you (better still that you're a fellow Aussie) and congrats on implementing the 485 protocol, impedance matched balanced pairs I presume? I agree that it's so satisfying to see it all work and come together. It's another thing to commercialise ideas but that I think is ultimately where us DIY'ers want to be at some point. Where in Aus are you based? I generally visit Sydney and Canberra when in Aus.
 
I'm not in the electronics business at all nor am I associated with any home automation company or technology company. I would dearly love to be in evolved though :). Having missed the boat earlier in my career, I'm trying to make up for lost time I think. Also, my kid is really interested in this stuff so that has compelled me to do more.
 
Ok, the mesh protocol - It's really just a massive state machine with timers and latency built in. My mesh can handle 65535 nodes (theoretical limit) and is peer to peer so that it doesn't rely on a controller or the cloud to function. My swipe power switch communicates with the lights over the mesh in real-time to dim the lights and that requires some tricky coding. It's written in C and is based on a few academic papers I found that discussed ways to optimise routes and reduce packet storms. It was tricky to implement and debug but it worked but it still has a few bugs that I hope will be sorted soon. The mesh is one thing but efficient message and packet communication is really really important so I've managed to solve that one too thanks to google technology.
 
The trick with automation is low power and reliability... easy to say but tricky to implement. I think I've cracked it though with my modules because I get high reliability (almost guaranteed message delivery over long distances) and low power. 2.4 ghz is not low power and neither is 6loWPAN but using my gateway, the nodes appear as IPv6 devices, uniquely addressable, in the cloud through some tricky address manipulation.
 
The thread initiative is in my opinion poorly considered in so many ways. One issue is the minimum packet size for 6loWPAN is over 1k per message and that's definitely not low energy nor will it be effective in larger homes where range is important. In practice, sensors and  actuators do not need to pass volumes of high bandwidth data (unless it's video or audio) so such high energy consumption is really a waste and will drain those batteries very quickly! The trick is to keep packet sizes really small to optimise range, reduce packet collisions, reduce energy consumption and to reduce errors.
 
I tried to attache an image but the over-protective forum won't let me because I'm new so I'll describe it. 1.5cm x 2.5cm in size. Frequency and power output are 915mhz with +17dbm and it's range has been tested to be 1-4km, easy at 120 milliamps per packet. It's a 4 layer board with optimised impedance on the output stages so as to maximise transmission distances, increase reception sensitivity and overall performance. It uses a Semtech SX1232 device coupled with a tuned output stage. It can be much smaller but I couldn't assemble it without machines to pick and place the components. This one was assembled by hand under a USB microscope.
 
I'm new to this forum so will start a thread like yours but for now I'm happy to just chat, learn and share ideas with people like you. I don't want to hijack your thread either with irrelevant information so if you think that it's getting that way, send me  PM.
 
Regards
Trevor
 
Hi Trevor, no problems chatting in this thread but do start another so we can have a more focused discussion about your system. It sounds very impressive and you should spend some time detailing how you went about the design and implementation like I have tried in this thread. The fact you have done so much without an electronics background shows your passion and ability to learn - congrats. I have a formal electronics engineering degree but went straight into a career in IT designing, managing and developing systems in the oil/gas and banking sectors so my software/IT skills are more developed than the electronics side. I enjoy this hobby as electronics is still a passion and I can use my IT and electronics skills together - most people specialize in one or the other but having a good understanding of the hardware and software systems can really take things to the next level.
 
Regarding the mesh protocol, that would have taken a bit of work to get right as it involves dynamic routing, keep-alive/hop counters and a number of other protocol semantics that aren't easy to implement. You should share your code on github if you are OK with open source. You are spot on about needing an efficient protocol to get range and power efficiency. Have you looked into the LoRa long range protocol? The Semtech SX1272 chip has LoRa support which would help reduce the development time but isn't as much fun as designing from first principles.
 
There is a lot of talk about the cheap wifi modules available now (eg. ESP2866) but these aren't a great fit for low power/decent range sensors as you have pointed out. If you think you have developed something unique and marketable with your efficient mesh radio, why not try launching something on kickstarter? I have some rather unique ideas / implementation with my system and have considered kickstarter - however am under no illusion of the amount of effort and hassle for a rather small return on investment, and won't get near replacing what I do (& paid) in my day job so will be keeping it as a hobby for the time being. It is really hard to stand out and build critical mass with a product in the HA industry, small businesses are sprouting up chasing the IoT promise of $$ (and most not making it) and even for seasoned guys like Dean Roddey (who posts on this forum) after putting in the hard yards with a robust product almost gave up not so long ago.
 
Re: RS485, it is a physical and electrical standard (balanced lines multi-drop) and you add the serial protocol on top. My protocol supports 64 nodes on a multi-drop line with C (for PIC microchip) and .NET (for PC) implementations and also relies on state machines but isn't anywhere nearly as complex as what you would have to implement for a proper mesh routing network. I have switched over to IP now as I use power over Ethernet for wired sensors.
 
Did you use the SX1232 reference design for the output stage? Building effective HF radio solutions is hard without access to RF testing equipment (even the layout of the PCB will impact efficiency). Your hello post mentioned you work on 0204 (0402??) series SMD packages which are seriously small, I prefer 0603 or 0805 as they are easier to maneuver when soldering and are still much smaller than through hole components.
 
Also, where did you get the 4 layer board made? I use SeedStudio for prototyping, $10 per run (get 10 boards) for small boards and quality is very good means no more mucking around with home made PCBs although posting can take time.
 
Hi DeanDob
 
Thanks for the complements. I agree that you can take things in the HA space to the next level in this space with both software design and electronics under your belt so I'm really interested in your HTML5 widgets as a front end to my system. They look really cool and I'd like a way to visually represent information and time series data through an interface like yours. I'm re-reading the source code posted in this thread as it's really clear and easy to understand. The future I think will be more about physical devices interacting with IT systems so you're in a great position to enjoy the ride.
 
With your work, where do you recommend I start reading? Do yo have a range of dedicated widgets for data visualisation? I would like to visualise historical power consumption like you have done along with  temperature readings so is there anything COTS that will do this for me?
 
The mesh protocol took a bit of work but not as much as it would seem. I've kept it really simple without anything fancy but it does cover the main use cases for routing tables, duplicate packet control and route discovery. Mesh networks don't like it when nodes move around. I've solved this by adding a decay factor to the routing table entries (not my idea actually - lifted from another academic paper). If you're thinking through how this would work, receiver signal strength (RSSI) is a key factor so any radio you implement needs to have this available. Without RSSI or some form of signal quality indicator, it's impossible to deterministically optimise routing paths. Also, the RSSI needs to be considered by the sender and receiver so discovery needs to communicate RSSI from all participating nodes so that a decision can be taken about the optimal route.
 
Another radio factor to consider in a mesh network is adaptable signal strength. I've added this to conserve battery life. It works like this... the device detects it's RSSI relative to the nearest node and then 'scales back' it's transmission power so that batter life is preserved while maintaining acceptable signal quality. There is no need in my opinion to blast every transmitter at full strength. 
 
LoRA is insane!!! Amazing. It boasts a link budget of 157db which is just unbelievable!!! I think that LoRA is destined to be great in the world of connected devices but range isn't everything and the star topology (promoted by Semtech) instead of mesh has problems scaling as every packet needs to be channeled through a controller. Very cool (and expensive) relative to other radio technologies.
 
SX1232 - I copied the output stage from the reference design and tweaked the PI filters to suit my PCB topology. I'm fortunate to have a really good spectrum analyser in my garage so used that to filter out harmonics, optimise performance and to confirm signal strength and integrity. 
 
PCB manufacture - if you're building RF stages or high frequency SDRAM interfaces then you'll need to move beyond SeedStudio to a PCB manufacturer who can make impedance controlled circuits. If everything is low speed ( SPI or I2C type integration) then Seed is great and so is OSHPark. I found a couple of Chinese companies who for around $250 can manufacture PCBs to spec with excellent results. Before them I tried OSHPark with poor results and eurocircuits for top quality but are expensive. My gateway device has high speed dedicated SDRAM interfaces so it, like the RF devices, is impedance controlled so that bus signal integrity between the CPU and SDRAM is maintained.
 
Regards
Trev
 
Back
Top