need suggestion for wireless connection...

Go To Last Post
32 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Till today, I used wired connections (USART, USB, I2C, SPI,...). I want to use wireless connection in my next project.

I have some devices with some controls on them. If user changed state of a device using its controls, other devices should be informed about it. And if user is using a controller, all devices should listen to that controller. Devices aren't going to be further than 50m (150ft) of each other. Usage environment may not have much noise.

 

Currently, I've searched about Bluetooth, Wi-Fi, RF and Zigbee.

  • Wi-Fi is too complex and I don't need its features in this project.
  • Bluetooth looks good and if I use it, I can even make an Android app to use phone as controller. However, it looks more complex than RF and Zigbee.
  • Zigbee is more oriented towards remote control and automation. So it is another good option.
  • RF looks simple, cheap and fun. However, if I use RF or Zigbee, I should build a separate device as controller or build a USB module to connect it to phone to use it as controller.

Any advice?

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Do not overlook LoRa. Everything you listed is RF. So is LoRa.

 

Choice depends on many things that you have not given: 

 

Is cost an issue?

What about licensing in your area?

Is this for yourself, only, or is it something you are going to sell?

What is the needed range (distance)?

What is the allowable latency or response time? That is, how much delay can be tolerated between the control activation and the response?

How large are the messages between the control end and the destination?

Is there only one control device and only one destination in this system?

What is the consequence of noise? That is, how well can you tolerate an error in the received message?

Is this communication one way, only, or is it two way?

Have you ever used wireless, before?

What data through-put rate is needed? Beware that throughput is typically a  LOT lower than  the baud rate.

 

And probably several more that I have not yet thought of.

 

Jim

 

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Thu. Oct 22, 2020 - 06:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why do you say WiFi is complex?   ESP8266 is popular and cheap in your country - there are many examples on the interwebs.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

Why do you say WiFi is complex?   ESP8266 is popular and cheap in your country - there are many examples on the interwebs.

 

 

And if you use ESP8266 or ESP32, you can use ESP-NOW for comms. Wifi but peer-to-peer using MAC addresses, so no external wifi infrastructure or TCP/IP complexity required. ESP-MESH builds on top of this. However, it is only available for ESP devices, and not others you might use as a gateway, e.g. RPi, PC, etc.

 

To ka7ehk's list I would add

(a) congestion. The ISM bands (esp 2.4GHz) are very congested in many places.

(b) power. Does this need to run off batteries ?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

  1. Do not overlook LoRa.
  2. Is cost an issue?
  3. What about licensing in your area?
  4. Is this for yourself, only, or is it something you are going to sell?
  5. What is the needed range (distance)?
  6. What is the allowable latency or response time? That is, how much delay can be tolerated between the control activation and the response?
  7. How large are the messages between the control end and the destination?
  8. Is there only one control device and only one destination in this system?
  9. What is the consequence of noise? That is, how well can you tolerate an error in the received message?
  10. Is this communication one way, only, or is it two way?
  11. Have you ever used wireless, before?
  12. What data through-put rate is needed? Beware that throughput is typically a  LOT lower than  the baud rate.

  1. Good suggestion. I'll search about it.
  2. Actually! Even a simple ATmega328P is expensive here! sad
  3. Huh?
  4. Probably I'm going to sell it.
  5. pajuhesh80 wrote:
    Devices aren't going to be further than 50m (150ft) of each other.
  6. Latency should be as low as possible.
  7. Small data packets. Probably less than 50 bytes.
  8. Not actually. As I said in #1, if there is no control device, devices should listen to each other. Any change on any device should be announced to all other devices. Something like a network. However, if user decided to use a controller device, all devices should listen to that controller.
  9. Received message must be flawless.
  10. Two way.
  11. pajuhesh80 wrote:
    Till today, I used wired connections (USART, USB, I2C, SPI,...).
    I forgot to say "...I only used...". smiley
  12. Not really high. Based on my knowledge, latency and speed are two different factors and As I'm going to transfer small data packets, there is no need to very high speed.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

obdevel wrote:

(a) congestion. The ISM bands (esp 2.4GHz) are very congested in many places.

(b) power. Does this need to run off batteries ?

(a) I know. What should I do?

(b) Main power source is adapter. Maybe I include a rechargeable battery also. However, some parts of device are going to be really high power consuming so power consumption of communication modules is negligible against total power consumption.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

pajuhesh80 wrote:
I've searched about Bluetooth, Wi-Fi, RF and Zigbee

As Jim said, they are all RF.

 

"RF" = Radio Frequency.

 

Probably the best-known non-RF wireless link is infrared (IR); but there are others ...

 

There are very many different RF technologies - and lots of websites that will give you an overview of their pros & cons and application areas

 

eg, https://www.google.com/search?q=compare+wireless+RF+technologies

 

Issues to consider include (most as Jim already said):

 

  • Range
  • Data rate & volume
  • Power consumption
  • Proprietary, or standardised 
  • Topology: point-to-point; star; mesh; etc
  • Licensed, or unlicensed (which largely boils down to: do you need to pay a subscription to a "service provider" to use some "infrastructure"?) 
  • Timing - latency, etc
  • One or two way?

 

Note that RF design is a specialist area, requiring specialist skills, experience, and equipment; so you should certainly  buy modules rather than try to "roll your own"

 

Kartman wrote:
Why do you say WiFi is complex?

Because it is! And so are Bluetooth (including BLE), Zigbee, LoRa, etc.

 

However, as you say, there are modules which will "hide" this complexity from you.

 

Some do it better than others - so be prepared to do some evaluations first to find something that you can "get on with".

 

EDIT

 

And, of course, on this site there is: https://community.atmel.com/internet-of-things - which covers wireless stuff

 

EDIT 2

 

If you look at the image results for the above Google search, you will find lots of diagrams like this - which show how many technologies compare on various metrics:

 

https://behrtech.com/blog/6-leading-types-of-iot-wireless-tech-and-their-best-use-cases/

 

 

https://www.semtech.com/lora/why-lora

 

 

Beware, of course, that some of these will be promoting their own particular brand/product/service ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Oct 22, 2020 - 09:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

ESP8266 is popular and cheap in your country...

Currently, nothing is cheap here! sad However, its price is less than some Bluetooth modules. I'll consider this one also. Thanks for suggestion.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Probably the best-known non-RF wireless link is infrared (IR); but there are others ...

IR isn't good for my project as the device may be used outdoor under sunlight.

 

awneil wrote:

Because it is! And so are Bluetooth (including BLE), Zigbee, LoRa, etc.

Are these even worse than USB?

Slow and Steady!

Last Edited: Thu. Oct 22, 2020 - 09:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Something important: Devices should be able to communicate even if there is a wall between them. Infrared will be totally useless here.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Infrared was given mostly just as an example of a wireless technology which is not RF.

 

It is a general thing (laws of physics, cap'n) that higher-frequencies are not so good for long range or going through walls.

 

This applies particularly to 2.4GHz.

 

Did you see #7 - I added some examples ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

Did you see #7 - I added some examples ...

Yes. Based on project specifications in #5, I think LoRa is best between these.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
Because it is [complicated] ! And so are Bluetooth (including BLE), Zigbee, LoRa, etc.

pajuhesh80 wrote:
Are these even worse than USB?

That's a good question!

 

It is rather subjective - it does rather depend on what you find "confusing" or "complicated".

 

I would suggest that BT/BLE and Zigbee probably are "worse", as they have similar complexities to USB and then add all the extra complications & complexities of RF on top of that!

 

But, again, most of that will be "hidden" from you in the modules,  so long as you buy good, well-supported modules - don't fall into the common trap of going for for the cheapest you can find on ebay: 

https://www.avrfreaks.net/commen...

https://www.avrfreaks.net/commen...

https://www.avrfreaks.net/commen...

 

But, as for USB, you will have to do some basic reading-up on the technology to understand its terminology & requirements.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Oct 22, 2020 - 10:05 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pajuhesh80 wrote:
I think LoRa is best between these

Note the distinction between "LoRa" - which is just the basic RF modulation technique (patented by Semtech) - and LoRaWAN - which builds that into a full network infrastructure.

 

If all you're doing is a simple point-to-point link, plain LoRa should be sufficient.

 

Microchip's offerings:

 

https://www.microchip.com/design-centers/wireless-connectivity/low-power-wide-area-networks/lora-technology

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

But, as for USB, you will have to do some basic reading-up on the technology to understand its terminology & requirements.

I've almost fully learned how does USB work. However, writing code for it and implementing class standards (HID, CDC, ...) is another story and I prefer to customize ready USB code examples rather than writing code from scratch.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

If all you're doing is a simple point-to-point link, plain LoRa should be sufficient.

yes

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2
  1. Received message must be flawless

 

What world do you live in? Every form of communication has flaws - your system needs to be able to cope with it.

 

With RF - the likelihood of errors is increased significantly.  

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pajuhesh80 wrote:
Probably I'm going to sell it.

In that case, you must consider security - including privacy, etc ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

What world do you live in? Every form of communication has flaws - your system needs to be able to cope with it.

You want it to be flawless, and it will have 1% error. You say "1% error is OK" and you will have 10% error. You say "10% error is OK" and your device doesn't work at all! laugh

By "no error" I mean something like USB. USB is really reliable and error proof.

 

awneil wrote:

In that case, you must consider security - including privacy, etc ...

But transferred data aren't that critical. I mean, even if someone hack these devices, they can't do anything that causes financial and personal losses.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pajuhesh80 wrote:
USB is really reliable and error proof.

That's because the protocol handles the flaws

 

Depending on which technology you choose, that might something that you'll have to manage yourself...

 

 

even if someone hack these devices, they can't do anything that causes financial and personal losses.

OK - so long as you have considered it.

 

But beware that apparently innocuous data can be (and has been) used to infer personal information.

 

A common example is that an eavesdropper might be able to deduce when the occupier of a property has gone away on holiday/vacation - and use  that to burgle the place...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go for nordic BLE modules...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BLE may not be good for the "through walls" requirement ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

awneil wrote:

BLE may not be good for the "through walls" requirement ...

 

True, but what kind of walls ? it depends on the materials of the walls

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

pajuhesh80 wrote:

You want it to be flawless, and it will have 1% error. You say "1% error is OK" and you will have 10% error. You say "10% error is OK" and your device doesn't work at all! laugh

By "no error" I mean something like USB. USB is really reliable and error proof.

 

 

Don't be silly!

 

USB is not very tolerant of interference. Your application needs to consider disconnects etc. With wireless there is another realm of potential issues you need to manage. If you don't believe me, wait until your widget gets out into the wild. What you thought was impossible becomes very real and the customer is angry!!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

obdevel wrote:
... so no external wifi infrastructure or TCP/IP complexity required. ESP-MESH builds on top of this.
Similar if one is willing on Wi-Fi infrastructure by mesh-capable Wi-Fi routers.

Some Bluetooth 4 have mesh and, IIRC, mesh is a part of Bluetooth 5; between Bluetooth and IP is a gateway router.

 

Mesh WiFi Routers: Get Strong & Extended WiFi | Linksys

Qualified Mesh Products | Bluetooth® Technology Website

one's preferred Bluetooth MCU may have mesh :

Bluetooth Mesh Solutions and Tools - Tech Talks - Silicon Labs

 

edit :

Mesh Networks | All Projects - PRISM Break

 

edit2 :

Best mesh Wi-Fi systems for the office and home: Netgear, Google, and more | ZDNet

...

The main router and the satellite nodes form their own 'mesh' Wi-Fi network, covering a wider area and delivering greater speed and reliability than a conventional Wi-Fi router, even with extra access points or range extenders.

...

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Thu. Oct 22, 2020 - 05:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I generally recommend that people attempting to learn a new AVR electronics topic to buy many different parts and keep experimenting with them until they get something that works.   However, seeing that you are in a small city in Iran and therefore subject to harsh economic sanctions on buying electronic parts from the outside world, I recommend that you learn on the cheapest and easiest-to-find parts that are currently available.    Do not assume that you will be able to get part to work simply because you have read its datasheet and that this part can do more than the other parts that you have studied.

   If you can get the ESP32 WROOM module boards at an affordable price: they would be the best option.  They have WiFi and Bluetooth, along with a 32-bit microcontroller that has many input-output pins available.  They sell on the Chinese electronics market website_alibaba dot com for about 3 - 4 Euros each.   They can be programmed with Arduino.  There are hundreds of people who can answer technical questions on the web about development problems.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
Some Bluetooth 4 have mesh and, IIRC, mesh is a part of Bluetooth 5

BLE Mesh was formalised by the Bluetooth SIG in BT 5 - but it uses only BT 4 features.

 

There are also proprietary meshing schemes based on BLE

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pajuhesh80 wrote:

  • Wi-Fi is too complex and I don't need its features in this project.
  • Bluetooth looks good and if I use it, I can even make an Android app to use phone as controller.

fyi, web app for WebSocket clients.

WebSocket is client-server which isn't a match for the devices to be peer-to-peer (an assumption due to the requirements); a WebSocket server could broker between WebSocket clients (the devices)

pajuhesh80 wrote:
RF looks simple, cheap and fun.
Inexpensive and Microchip has RF MCU and RF transceivers.

 


WebSocket server on a MCU, WebSocket client is a web browser (operator's interface) :

Efficient web server technology for resource-constrained microcontrollers - Embedded.com

 

MiWi Protocol | Microchip Technology

https://www.microchip.com/sitesearch/search/Application%20Notes/LightweightMesh?mns=Lightweight%20Mesh

Atmel Lightweight Mesh stack | AVR Freaks

[µracoli - The µController Radio Communication Library]

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can add some antenna gain to offset the loss due to a wall.

Wi-Fi and Bluetooth though Bluetooth is an order of magnitude less ERP than Wi-Fi (Bluetooth - coin cell, Wi-Fi - cylindrical cell)

Some Bluetooth modules have an RF power amplifier and can reach to 1km LoS.

 

2.4GHz Yagi in a Can - Instructables

by 

...

To test my antennas I use a test router 40 meters away with the signal going through three brick walls.

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

Don't be silly!

USB is not very tolerant of interference. Your application needs to consider disconnects etc...

Please be calm! Why do you get angry? You said "Every form of communication has flaws..." and I said you should set your goal to be flawless to get the least error. I understand wireless connection is much more error potential than wired ones. I just need the least possible error.

 

Simonetta wrote:

If you can get the ESP32 WROOM module boards at an affordable price: they would be the best option.

I found this one. Price isn't cheap (as usual!) but affordable considering its features.

Slow and Steady!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

peer-to-peer mesh networking by LoRa transceivers on ESP32 or nRF52; operators' interface is Android (iOS in-work), PC, or web app :

What is Meshtastic? | Meshtastic

via 337 #LoRa Mesh Communication without Infrastructure: The Meshtastic Project (ESP32, BLE, GPS) - YouTube (13m14s)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller