Transfer a sensor's signal to a longer distance - Page 1
Forum section: electronics / general

author: panoss
author_rank: Frequent Contributor
timestamp: December 17, 2018, 03:37:45 pm
content: I 've built a thermometer (ESP8266+DS18B20) which reads the temperature of the air on the top of my building and connects to my router (using WiFi) 2 floors down.If I increase the distance by 1 floor, it cannot connect to my router. (I use Wemos D1 mini pro with it's external antenna for increased range)So I was thinking instead of WiFi to use BlueTooth, a module likeAT-09.Will it increase the range in which I will be able to send my data?I want to be able to sent it as far as 6 floors, does bluetooth have this capability?Or should I go to a HC-12 module? Or LoRa module?

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 17, 2018, 04:13:52 pm
content: Wi-Fi has a longer range than Bluetooth and the anemic PCB antenna this module has is not going to help much.What's your communication speed requirement?I suggest looking at LoRa modules.

author: panoss
author_rank: Frequent Contributor
timestamp: December 17, 2018, 04:24:43 pm
content: Quote from: SiliconWizard on December 17, 2018, 04:13:52 pmI don't know about this, nowhere in my code I set the speed of the connection with the router.And which of all the LoRas? There seem to exist a lot!How about LoRa SX1278? Or LoRa RFM95? Would any of them be sufficient for my case?(bear in mind that power consumption must be kept LOW)

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 17, 2018, 08:23:40 pm
content: Just pick a module that will be the easiest to integrate for you.LoRa has certainly enough data throughput to send temperature measurements.Power consumption will be probably lower than WiFi unless you program the maximum output power (it's programmable).Be aware that integrating LoRa will be more work than WiFi (but you'll learn something!)Also careful with the version you buy. The frequency band depends on the region you live in.The PC side will need some kind of LoRa adapter. There are some USB dongles out there to start with, or you could use a LoRa module which has an UART port and an USB-UART adapter.Example:https://www.mikroe.com/lora-2-clickWith LoRa and proper antennas, you will be able to transmit over pretty long distances.If all you need is to transmit inside a building, sticking to WiFi and deploying a WiFi repeater/extender will probably be the simplest option.

author: Ian.M
author_rank: Super Contributor
timestamp: December 17, 2018, 08:58:23 pm
content: It may be worth simply extending the 1Wire bus to the sensor so the ESP8266 can be inside the building (e.g just inside the roof access), so the WiFi signal doesn't have to punch through the roof structure, which may be attenuating it significantly, + using a directional antennae (e.g. a carefully constructed cantenna) on the controller, aimed at the router.

author: panoss
author_rank: Frequent Contributor
timestamp: December 17, 2018, 09:05:39 pm
content: Quote from: Ian.M on December 17, 2018, 08:58:23 pmThis is what I 've done. But if there are more than 2 floors between ESP and router there is no communication between them. I 'd rather not use a repeater.Quote from: Ian.M on December 17, 2018, 08:58:23 pmThis sounds interesting, could you give some more info?

author: panoss
author_rank: Frequent Contributor
timestamp: December 17, 2018, 09:14:31 pm
content: Quote from: SiliconWizard on December 17, 2018, 08:23:40 pmI have no idea which will be the easiest!Quote from: SiliconWizard on December 17, 2018, 08:23:40 pmAnd how can I find which one suits my region?Quote from: SiliconWizard on December 17, 2018, 08:23:40 pmWhy would I connect LoRa to the PC? I thought it only has to connect to my MCU.Quote from: SiliconWizard on December 17, 2018, 08:23:40 pmI 'd rather avoid repeaters.

author: L1L1
author_rank: Regular Contributor
timestamp: December 17, 2018, 09:23:38 pm
content: Quote from: panoss on December 17, 2018, 03:37:45 pmHave you considered going "wired" , with something like this:https://www.omzlo.com/articles/the-nocan-platform(Disclosure: I'm the main author of that project)

author: Nusa
author_rank: Super Contributor
timestamp: December 17, 2018, 11:32:33 pm
content: If the sensor end has access to power, you might consider a pair of ethernet powerline adapters. Viability will depend on how the building electrical system is set up, but odds are decent it will work. Then you won't need wireless at all.

author: ebclr
author_rank: Super Contributor
timestamp: December 17, 2018, 11:36:17 pm
content: One external antenna makes a Big diferencehttps://www.banggood.com/pt/WeMos-D1-Mini-Pro-16-Module-ESP8266-Series-WiFi-Wireless-Antenna-p-1144951.html?gmcCountry=BR&currency=BRL&createTmp=1&utm_source=googleshopping&utm_medium=cpc_elc&utm_content=frank&utm_campaign=pla-elc2-rm-mail-br-pc-1102&gclid=Cj0KCQiAr93gBRDSARIsADvHiOo9B--uOqFzVeIJuhBdDTvVq9ZV94n17fQr7CdkMK6qzflzu6O1Mh0aAkIhEALw_wcB&cur_warehouse=CN

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 18, 2018, 12:05:35 am
content: Quote from: panoss on December 17, 2018, 09:14:31 pmDepends on the interfaces that are available to you (SPI, UART, I2C...) and what you are ready to do (soldering, making a PCB, ...)The MikroE board I linked above has an UART link and seems like an easy option to start with LoRa. (But it's not cheap.)I think Microchip also has dev. boards for LoRa, but the MikroE board uses a Microchip module and is probably cheaper than the Microchip dev. kits.You could of course use the bare Microchip module but it would require to design a proper PCB IMO (or have a mess of flying wires).The other LoRa modules are all good (Semtech has great devices) but will probably take more time to understand and get working.This page could get you started as it uses the same MCU as you do:https://things4u.github.io/HardwareGuide/ESP8266/ESP-Sensor/esp-lora-node.htmlQuote from: panoss on December 17, 2018, 09:14:31 pmYou can see there:https://lpwanmarket.com/global-frequencies/In the EU you can basically use either 433MHz or 868MHz modules. That's different in other parts of the world.Quote from: panoss on December 17, 2018, 09:14:31 pmIs there a PC involved at some point? Are you getting the temperature data on a PC or mobile phone? If so, you'll need a LoRa adapter. LoRa is not supported by default on those as opposed to WiFi and Bluetooth which many do support without any extra hardware.If no PC or mobile is involved, then it's not needed (but then I don't know exactly how you're going to use the sensor data?)Quote from: panoss on December 17, 2018, 09:14:31 pmAny specific reason? Maybe you're crossing floors which don't all belong to you?I also like the wired approaches given above (nice change, getting tired of all this wireless frenzy), but I realize they may not be practical if again, you have to cross floors that belong to other people.

author: Ian.M
author_rank: Super Contributor
timestamp: December 18, 2018, 12:15:39 am
content: If you are staying with WiFi, a directional antenna like a cantenna could easily offer 10 to 12 dB gain over an omnidirectional antenna. As the sensor controller and router locations are fixed, there's no reason not to use a directional antenna at the controller end. However most directional antennae are relatively large compared to omnidirectional antennae and most home-built designs are somewhat fugly.

author: panoss
author_rank: Frequent Contributor
timestamp: December 18, 2018, 08:27:29 am
content: @L1L1 andd @Nusa: I want to avoid the wired. It 's gonna become a commercial product (hopefully) so I want things to be as simpleas possible for the end user. To not have to install wires or anything.@ebclr: as I mention in my first post this is what I used too: Wemos D1 mini Pro with external antenna. I see no big difference. (and yes, I have modified the 0Ohms resistor used as a jumper for the external antenna)@SiliconWizard I will make a PCB and I will solder.To answer if the PC is involved let me describe the whole project:1. Transmiter: MSP430+DS18B20+LoRa. Reads sensor, sends it 's value through LoRa.2. Reciever: ESP8266+LoRa. Recieves value through LoRa. Displays it on a small LCD screen and transmits the value (through ESP8266) to the internet, to thingspeak.3. PC: we read the temperature at thingspeak.I want to avoid repeaters because I want to avoid complexity for the end user.@Ian.M: a directional antenna would make the device 'huge'. The end user would dislike this for sure.The sensor and the router location are fixed, ok, but it does happen some time to change the router 's position.I have ended up for a pair of LoRa Ra-01 SX1278 433M.What do you think?Problem is I can't find any example for MSP430+LoRa SX1278 (not with LoRaWan, I 'm not gonna use LoRaWan, I don't think I need it)

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 18, 2018, 03:58:00 pm
content: Quote from: panoss on December 18, 2018, 08:27:29 amThose are good modules and the pricing is right.As for source code, as long as you use C, you should have the same code base for the MSP430 and ESP8266 IMO. The only difference will be the access to SPI and GPIOs.So any example you find in C for those modules should be relatively easy to factor for both platforms.

author: technix
author_rank: Super Contributor
timestamp: December 18, 2018, 04:50:11 pm
content: Just throw it out here, since this solution has almost the best range with reasonable power consumption: cellular.If the module lives in an awkward location but has good access to a source of energy (e.g. solar if it is outdoors) you can use your local cellular carrier for that. Especially helpful if your plan allows for multiple SIM cards sharing the data plan like my China Unicom one that comes with unlimited data and up to five SIM cards sharing it.If you use cellular you need to either text it to another SIM card (can be your phone, can be a cellular modem plugged to a Raspberry Pi or something) or send it over a data plan to a public facing server (you can set up dynamic DNS for it to connect to your home server, or rent a cloud server on DigitalOcean or AWS or something.)

author: panoss
author_rank: Frequent Contributor
timestamp: December 18, 2018, 08:07:39 pm
content: Quote from: SiliconWizard on December 18, 2018, 03:58:00 pmThe main problem is that in the examples I find, they use libraries like RH_RF95.h inthis project.I didn't find respective libraries for MSP430 platform.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 18, 2018, 11:43:54 pm
content: You can take a look at this project:https://github.com/wdomski/SX1278Shouldn't be too hard to port the code.