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

Never
 
NeverDie said:
That was my first reaction as well.  Then what next blew me away was finding out  there are at least a dozen different known clones of it: http://www.testandmeasurementtips.com/embedded/pocketpico-p200-powermate/
plus who knows how many other clones out there  "in the wild" as it were.
 
The original motivation for that mysensors thread was me being disappointed in some NRF24L01+ modules that I had purchased...................   In the end it may turn out that the transmission current will help differentiate fakes from the genuine article, but the curious twist is that I may have found a cheap fake that I actually prefer!
 
LOL, I really enjoyed reading your story and could relate to it 100%. If you end up commercialising your ideas then I guess you can just re-visit your design or opt for the originals.
 
It's possible however that the range problem you experience with the original Nordic chips and other copies could be related to PCB design? When I designed my RF module, the first version had a horrible range because I didn't really consider the output stage impedance. With the second version, I made sure that the impedance was almost a perfect 50 Ohms and worked with the PCB manufacturer to ensure that all the parameters were correct. e.g. dielectric constant for the PCB epoxy, space between the track and ground plane and finally the actual track width/length. I must admit that I was a little annoyed with myself for not thinking the output stage through when I designed the first module but the results and range I got from the second version were excellent. Mental note... pay attention to the details, especially with RF.
 
Here's a module panel, unpopulated, manufactured through a Chinese company. They did a perfect job.
 
IMAG1744 (1).jpg
 
tattema said:
It's possible however that the range problem you experience with the original Nordic chips and other copies could be related to PCB design?
It could be that, and/or it could be cutting corners at the manufacturing stage and/or using junk components.  Consider:
 
1436978544939-nrf24.jpg

On first glance, the two PCB's look quite similar, except the one on the left (what I've been calling the blob module), appears to be missing components, which immediately looks suspect.  Yet, my own testing has convinced me that it easily outperforms the module on the right on range and packet loss.  If I look more closely at the module on the left, I see what might be test points as well as  through holes that really do go all the way through to the other side (if I hold them up to a light, there's unimpeded light coming through those holes.  I don't know what the function of those holes is (is it for proper registration of the bonding machine that wire bonded the chip-on-board), or is it there for some other reason.  Somebody or something went to the expense of making those holes exactly where they were, and doing that isn't free.  The board on the right doesn't have those features visible.  So, does that imply it wasn't tested?  Also, why was such a dark, opaque material chosen?  Is there something there that they don't want you to see, or possibly something missing that they don't want you to see is missing (like, maybe evidence of  a ground plane, for instance)?
 
Now compare the module on the right to the red module:
 
1438101337348-red1.jpg

 
1438101354267-red2.jpg

It's  NRF24L01+ chip has the same tracecode as the poor performing module on the right of the pair above it.  Yet, my testing has convinced me that the red module easily performs much better.  The board design is different.  It's also smaller.  The epoxy is also much more translucent, so you can see into it to have at least a slightly better idea what's there.  Coincidence?  Call me jaded, but I don't think so.  In my experience (with just about anything, not just with modules), the  more things get covered up without the opportunity to inspect, the higher the chance that something bogus has transpired.  After all, what's the worst thing that can happen if the unlikely event they're found out?  Firing squad (I wish!).  Jail?  Nope.  From their perspective, the worst that can happen is barely even a slap on the wrist: the transaction is unwound to where they get their modules back and you get your money back (probably minus return shipping charges and possibly legal fees, which could well overshadow everything).  There's just little to nothing holding them in check.  The trouble is, these types of differences probably aren't something most people would ever notice, unless they happen to have a different module from a different vendor to compare against right there in their hands, and most people just aren't going to have that, even if they thought to make a more careful examination.  And even if they did, how can they know what they're looking at?  Can you tell?  I can't.   It seems that very few people hold the key information, and I haven't seen any posts by them.
 
 
tattema said:
When I designed my RF module, the first version had a horrible range because I didn't really consider the output stage impedance. With the second version, I made sure that the impedance was almost a perfect 50 Ohms and worked with the PCB manufacturer to ensure that all the parameters were correct. e.g. dielectric constant for the PCB epoxy, space between the track and ground plane and finally the actual track width/length. I must admit that I was a little annoyed with myself for not thinking the output stage through when I designed the first module but the results and range I got from the second version were excellent. Mental note... pay attention to the details, especially with RF.
 
Here's a module panel, unpopulated, manufactured through a Chinese company. They did a perfect job.
 
attachicon.gif
IMAG1744 (1).jpg
I must say I'm quite impressed with your level of savvy.  What's the minimum equipment required to do a proper job of running that test?  I can also appreciate how you left space between the modules for breaking them apart.  In my recent sampling of modules, sometimes that separation step was ommitted--together with close to zero clearance between boards-- leaving the entire risk on me to snap them apart without destroying one or more in the process.  
 
Hi NeverDie
 
I look forward to seeing how 2.4GHz feeds into your HA setup and more specifically, battery life.
 
This conversation will be a bit technical so I hope that other Cocoontech readers see we're trying to improve RF reliability and transmission range i the 2.4ghz spectrum for HA nodes and devices :)
 
From the photos and your description, It appears that the 'blob' module is a multilayer board and the other is not. If you see holes it probably means that vias connect the inner ground layer to the upper ground fill for better frequency tuning. The fact that they've omitted inductors and capacitors (LC) so the device isn't bandwidth limited with high or low pass filters. Generally transmitters generate first, second, third... ninth order harmonics that resonate outside the main frequency so adding what's called a bandpass filter prevents those harmonics from being transmitted and messing with WiFi and other devices in the 2.4ghz band. What's required for FCC approval and for the device to play well is that it transmits within a given frequency and consumes no more than the specified bandwidth but doesn't transmit harmonics into other channels thereby messing with them. I'd be happy to put money on saying that the 'blob' device transmits nasty harmonics but for your home use, it might not be an issue. 
 
It's quite ironic actually that the blob board is multilayer, a more expensive manufacturing process, and they've omitted a bunch of components that would have justified it being 4 layer. Perhaps they ran out of money :) Perhaps it's not 4 layer at all and just has via connecting the top plane to the back plane.
 
It is clear to see that the red boards have the antenna exposed to the air without an internal ground plane... excellent! This is correct and how all track antennas should be designed. I can't see whether the blob board or the one on the right has a ground plane under the antenna but if the one on the right sits over a ground plane, even if it's on the other side, then that will impact the amount of energy transmitted because impedance will be introduced into the antenna circuitry.
 
If you end up designing your own RF boards, you'll find this calculator useful. It takes the guesswork out of impedance calculations. http://www.mantaro.com/resources/impedance_calculator.htm. Microstrip Impedance Calculator. The only factor that you're PCB manufacturer needs to confirm/supply is the dielectric constant for the resin they use (generally 3.5-4.5). Once you have that, you're set to go and can adjust the track width and inner ground plane distance to your desired parameters.
 
 
NeverDie said:
 
 What's the minimum equipment required to do a proper job of running that test?  I can also appreciate how you left space between the modules for breaking them apart.
 
It's difficult to test a device that has already been manufactured without expensive equipment, especially if you don't have the component values. You can perform a sweep to test frequency response using a spectrum analyser however the test needs to be performed just on the transmission lines and antenna circuitry which means disconnecting the chip so that an RF frequency can be introduced. For the blob, would that mean destroying a board?
 
I have a spectrum analyser with sweep function in my garage, nothing special, but good enough. Hz to 1.5 GHz. It's a RIGOL and is fantastic for my needs. As you're working at a higher frequency, expect to pay several thousand dollars for an entry level frequency analyser. :-(
 
https://www.youtube.com/watch?v=Wg3PNgGW_M4
 
I was able to see then nth order harmonics first hand on my first RF board by omitting those LC components. I can also visualise transmission frequency, dBm and bandwidth, all in realtime. I also use a smith-chart to help choose the correct output stage LC components. It looks intimidating, but it's not once understood. VSWR is key but it's quite technical so I won't go into it just now or I'm sure you'll lose the will the live :)
 
https://www.youtube.com/watch?v=hmqM8PnUkmo
 
Thanks for the tour, but for me it wouldn't be cost effective to go that route--even without the horror show side trip where I "lose the will to live."
 
What I was hoping for was more of an easy win, like perhaps what this guy did:
[sharedmedia=core:attachments:7164]
http://forum.mysensors.org/topic/1723/which-is-better-rfm69-or-nrf24l01/3
 
He took a $2 Arduino Mini Pro and wired it to a $4 RFM69.  The libraries to support that configuration already exist.  Bang.  Done.
 
NIcely compact, and with great range as well I would imagine.
 

Attachments

  • simpl.jpg
    simpl.jpg
    131.8 KB · Views: 14
NeverDie said:
I just stumbled across this website:  http://www.home-automation-community.com/
 
I'm finding the articles interesting and well written, and aligned with the spirit of this thread.
 
Thanks for the link. I'm really enjoying the site, specifically arduino hack article and the low power regulation discussion.
 
An approach I've been using successfully to manage peripheral circuitry current consumption for sensors is by using a FET high side switch. For my temperature and humidity sensor I turn off the flash memory, radio chip and the temperature sensor while the device is asleep and only turn them one when they're needed. Even though the radio is very low power while asleep, i like to keep it turned off for the sleep period rather than leave it turned on to preserve those precious uA's. This approach seems to work reasonably well. 
 
Another approach I like to use is to power sensors from the CPU IO pins but it's important to ensure that the pin can support the current. A while back I experimented powering a flash memory chip from the microcontroller IO pin and the approach worked when reading from the chip but failed when I tried to write. The reason was that the flash chip drew 5ma when reading and 17 when writing and the pin only supported 5ma as a default setting. Fortunately the pin had a high current mode (20ma) so turning this on this solved the write problem. 
 
Anyone tried a Cypress PSOC 4?
 
CY8CKit-049_full_img.jpg

 
 
or a PSOC 5L?
 
CY8CKIT-059.jpg

Mouser sells the PSOC 4's for $4/each and the PSOC 5L's for $9.38.  The PSOC 4's have a Cortex M0, and the PSOC 5L's have a Cortex M3.  The idea is to enable you to create your own custom SOC.  So, if you wanted to build it so that an opamp would amplify a voltage signal before feeding it into a data pin, you can (apparently) do that.  
 
Regardless, they do seem to pack quite a large bang per buck.  For the price, it's also nice how you can load your firmware and then just snap off the PCB USB connector and deploy!
 
Interesting mix of analog and digital - would be good for projects that needs a lot of analog processing. For example, doing audio processing for speech recognition.
 
Thanks for pointing these out, will keep in mind for future projects.
 
If you want to go a step further in this direction (where the CPU isn't the hub in a SoC), look at FPGA devices which effectively allow you to wire up the processing through firmware. These are excellent for complex digital systems where a CPU might not be as fast or flexible.
 
NeverDie said:
Anyone tried a Cypress PSOC 4?
 
 
or a PSOC 5L?
 
Not me but the dizzying array of options makes my head hurt. I decided quite some time ago to go with an architecture, for better or worse, and I've been quite happy.
 
The PSOC 4 is one of those extensible architectures, like the FPGA merged with an ARM M series CPU. Quite cool and very powerful. I can imagine current measurement or voltage measurement sensors would benefit from this through reduced external component count. A simple humidity sensor could work too where a capacitive sensor could be wired directly to the CPU without the need for external passives.
 
If you are drawn to extensible architectures and like the ESP8266, consider the Xtensa range of technologies found here: http://ip.cadence.com/ipportfolio/tensilica-ip/xtensa-customizable
 
Some background, the ESP8266 is based on the Xtensa technology which isn't ARM hence the lower price point. :)
 
I just read the PSOC 5L data sheet overview and it comes with 128kb of flash and 16kb of ram. Nice, but the ram could be a bit challenging if you want to do anything serious.
 
tattema said:
Some background, the ESP8266 is based on the Xtensa technology which isn't ARM hence the lower price point. :)
So that's where it came from.
 
Today I was  looking at low power mcu's, and the lowest power ARM (dubiously measured in uA/Mhz) seems to be from Atmel, which claims Atmel SAM L21 Cotex M0+ consumes 35uA/Mhz while in Active mode..  On the face of it, that would be an order of magnitude improvement over what the ATMEG328P used in the Arduino Uno consumes while active.  For something battery operated, it would be hugely appealing.  At mouser the L21 is priced at $4.23 in quantity  4000. in contrast to the ATMEGA328P-AU, which is $1.83 in quantity 2000+.  
 
I thought EFM32 would surely be close, but when I looked: 
energy-modes.png

https://www.silabs.com/products/mcu/lowpower/Pages/32-bit-microcontroller-technology.aspx
 
it currently seems to be at 150uA/Mhz, and it's first level of sleep is 45uA/Mhz.  That would mean it's consuming more power while in a light sleep than Atmel's MCU is while awake and active!   :rofl: Ouch.  
 
The comparison  for  the LPC810 isn't good either.  From page 33 of its datasheet,  ithe LPC810 consumes  1.4ma at its default 12Mhz 3.3V and 1.0ma when in "low current mode" (whatever that is), also at 12Mhz 3.3V.  So, that would be 117uA/Mhz in regular mode, and 83uA/Mhz in low current mode. Ouch again.   :nutz:
 
Those power consumption figures, if true, are quite impressive so you've peaked my interest. Such low power consumption figures are great for energy harvesting home automation technologies such as passive sensors but less useful for active devices that need to run constantly to route packets.
 
I'd like to explore energy harvesting from noise, vibration, AM signals and 2.4GHz signals in high density areas so such a device would help to make that possible.
 
I had a quick scan of the Atmel data sheet for the SAM L21 but couldn't find the 'Active' mode figures. I found higher current consumption per Mhz (but less than EFM32) but I couldn't find a demonstrable for 35 uA/MHz. Figures around 70-100 were found.
 
If you're going to build battery powered sensors then low power devices make sense provided that the peripheral circuitry is also optimised for energy consumption. If a sensor is passively measuring temperature and wakes up ever 30 seconds, takes a reading and then sends the data the incredibly long battery lifespans can be attained. If the sensor needs to act as a message router then power consumption becomes more complex to manage.
 
With my home sensor network, passive sensors do not route packets over the mesh but communication is bi-directional and this increases battery consumption.
 
From a development perspective, i wouldn't touch the ATMEGA328P-AU but would definitely consider the SAM L21. ATMEGA is based on an Atmel proprietary core and the technology is much older whereas the SAM and other ARM based CPUs are based on a common interface (CMSIS), a more modern approach, that makes porting applications between different chip manufacturers easier. Unfortunately the ARM costs appear to  be higher (Digikey) but I haven't approached chip manufacturers directly to quote device prices. I expect cheaper volume prices can be attained.
 
If power efficiency is the goal, what sensors and radio would be coupled as part of a total solution? What would the battery life expectations be? What radio technology is suitable? The answers to these questions are not universal and are very specific to the problem being solved.
 
tattema said:
I had a quick scan of the Atmel data sheet for the SAM L21 but couldn't find the 'Active' mode figures. I found higher current consumption per Mhz (but less than EFM32) but I couldn't find a demonstrable for 35 uA/MHz.
You can find it here on page 1107, Table 45-7.
 
NeverDie said:
You can find it here on page 1107, Table 45-7.
 
Thanks for pointing it out. I think the device is a very good find so well done as it's going to give the EFM32 a run for it's money.
 
I couldn't find availability for most of the parts on digikey or octoparts and the Atmel website shows 0 stock through distributors so I wonder what the final price will be.
 
One of the things that attracted me to the EFM32 was the presence of 3 internal resonators (1khz for deep sleep wakeup, 32khz for RTC and 28Mhz for programming and PLL) meaning that an external crystal is only required for timing critical applications. For my node I ended buying a external crystal anyway (extra BOM cost for a reasonable quality crystal) instead of using the internal oscillator because i was testing higher Sx1232 throughput and though it might make a difference. It didn't so I ended up wasting money on crystals.
 
Another cool feature supported by the L21 is the internal power regulation circuitry and the direct USB connection interface (for firmware upgrades, radio dongles and diagnostic messages). These features, especially the USB interface, can reduce the overall BOM cost. If you've looked at the price of the dedicated USB to COM chips these days, they're not cheap!!! I do find it annoying that they didn't provide internal 4.2V buck regulation so that devices can run directly from a fully charged LiPo battery (3.6 is the voltage and even that is short of the normal LiPo 3.7 volt level)
 
At the time that I wrote the above I thought the Atmel Sam L21 was more available than it apparently is, so I don't think I did a fair comparison by comparing what is readily available now to something that will be equally available only in the future.  In this case Atmel seemed more ahead than it really is because of its early announcement. Nonetheless, it probably isn't that far off (a year at the most, if that?), and it does illustrate the potential for a sudden downshift in energy consumption that's imminent.   In the meantime, I wouldn't be surprised if other manufacturers make announcements that leapfrog it.  The NRF52832 Cortex M0 variant (from yet another announcement) is breathing down its neck at about 39uA/Mhz  IIRC, it has a 12-bit ADC and can do 200Ksps (though probably not at 39uA/Mhz).  
 
tattema said:
Hi NeverDie
 
Thanks for showing me exactly where to find the info and it is quite impressive. I understand how they get "10uA average RX current" and it's through clever slight of hand. It works when the transmitter preamble length is longer than 1 second. The receiver radio wakes up every n ms intervals (1000ms) and listens for the preamble (1-10ms) and then goes back to sleep. Is this ideal because it means that a 1 second preamble is required when transmitting. That to me seems like a long time. When detected, an interrupt can wake up the CPU to download the packet.  Semtech follow the same approach for reasons that might not be immediately apparent.
 
Here's what I mean. All these chips appear to be designed by a the same company (German I think but I can't find the reference to this right now) and the designs are then licensed to companies like Semtech, Hope electronics, SiLabs and others. For example, the Hope chips are re-badged Semtech chips and the data-sheets are almost identical except for the header and footer!! The drivers available on the Semtech website work with the RFM69 hope boards and their LoRa equivalents (horrible manufacturing quality though).
 
Looking at the Si4468 data sheet I can see remarkable similarities in design between it and the Semtech silicone so it makes sense that a good design should be licensed and expanded upon by different manufacturers. Even the RF front end is identical in design and so are the LNA's.
 
With regards the Si4468.... it's truly impressive so thanks for sharing. I'm even inclined to buy a few modules for experimentation purposes. It's FSK so I presume that I can be made to work with my Semtech based boards with little hassle.
 
Regarding an abstraction layer, download and look at the Semtech drivers. You'll see that it's all plug and play with a single 'Radio' interface for Sx1232 and the LoRa series. All you need to implement is the HAL SPI interface and that's not difficult for anybody semi-experienced with microcontrollers.
 
Regarding JeeLabs and the drivers he wrote... i'd tread carefully because they're incomplete and not state machine driven which means that large packets over the internal buffer size (64 bytes) are not supported. In addition, buffers are emptied from within an interrupt which isn't ideal. The JeeLab drivers were then copied by Low Power Labs as part of their AVR to RFM69C implementation so they too are flawed.
 
The Semtech drivers are beautifully written and support variable length packet sizes up to 255 bytes so they should be used. I bring this up because if we really want low power from the Semtech radio silicon, similar to the Si4468 preamble sniff mode, then the Semtech drivers should be used as they support this out of the box too.
 
Regards
Trev
Thanks once again tattema for the good info.  FYI, from what I've been reading recently,  RFM69x is most similar to SX1231H. Also, I can confirm that the RFM69x library has incomplete coverage of the chip features, with the workaround being that you can set registers on your own.  For instance, the "Listen-mode" has no library coverage and fits that scenario.  So, if the library that you're referring to really is that much better, I'm at the point where now would be a good time to switchover to it.  Do you have a link to the one that you like, and will it easily work on the Arduino platform?
 
Back
Top