i need to connect my phone to the esp32 with BLE(Bluetooth Low Energy). But only when you are close to just 1 meters. So, how can i reduce the meters? And also if you go far away from 1 meter, it has to disconnect. I would be happy, if you answer...
Unfortunately this would be very challenging to implement because you have to rely on the RSSI to approximate the distance which is not always very reliable. Have a look at these links below for more information:-
Things you should know about Bluetooth range
Using BLE for indoor positioning
Fundamentals of beacon ranging
Connect if the RSSI more than 40 and keep updating the RSSI for 2 seconds, get the average if it's more than -30 then you're too close to the device.
Related
I'm reading so much propaganda about BLE beacons (Kontakt.io, in my case) being accurate to the centimetre, readable at 70 metres etc etc, but my experience has been nothing like that.
I have 3 beacons. If they're in the next room over (door open, around 6 or 7 metres), it'll detect maybe one or two, after around 20 seconds. Even then I often need to restart my app over and over to detect it.
Move them to the same room, and they're pretty much okay. Everything's default, scanMode is 'LOW_LATENCY', scanPeriod is 'RANGING', I'm not sure what else I can do.
Do these results sound way off, or are they just not that good?
A few tips about Bluetooth beacons in general, not specifically Kontakt beacons:
When you need to restart your app to detect beacons, that clearly means it is something on the phone, not the beacons themselves that are the issue. That issue may be the app, the SDK, the Bluetooth stack on the phone, or the phone's bluetooth hardware. Try an off the shelf detector app like BeaconLocate for iOS or Android and also test with a different phone.
The range of a beacon is dependent on its output transmitter power, typically measured at 1 meter. This output power is adjustable on many hardware beacons and is often set lower than the maximum to save battery on battery-powered models. For best detection results, set the output power to the maximum that configuration allows. An output power at one meter should be at least -59 dBm for best results. Less negative numbers mean more power. Because some phone models have poor sensitivity and measure RSSI inaccurately, you may want to measure with different models. In general iOS models are more predictable receivers.
The range of a beacon between rooms varies greatly depending on materials in walls, furnishings, and local geometry. A beacon with an output power of -59 dBm at one meter can be reliably detected by a phone with a sensitive receiver at 40 meters away, but only with clear line of sight conditions (typically outdoors). Intermittently, I have seen such beacons be detected outdoors at over 100 meters away. Intermittently means that 99% of packets are lost, a small percentage are successfully received.
Always be skeptical of marketing claims from companies trying to sell you something. The above points should tell you what is achievable from an independent engineering perspective.
I am trying to verify I have power and verify positive and negative wires from cyberpower plug. I can't get this led to light up. I am going to attach two pictures one of the breadboard setup and one of the power module. The power module has a sliding switch that I have set to 5 volts. The resistor is 680 ohm the power unit is up to 1300 mA.
The long leg of the led is plugged in next to the resistor. I have switched the black and red from positive to negative on the board.
I know this is probably a dumb question but we all have to start somewhere.
Thanks
Mark
Some breadboards have gaps in the middle of the power rails that need to be jumpered. Use a DMM to verify that this is the case on yours.
Well one multi - meter later I discovered that the 5 on the slider of the power supply must have been .5 because when set to 4.5 higher up the scale the multimeter shows 5 volts and everything works. I now have a esp8266 running from a nodemcu .9 devboard running an mqtt client working off the breadboard power subscribing and publishing. which was todays goal.
Thanks everyone.
I know this is not the right place to post and I truly apologize. If someone can send me in the right direction I would really appreciate it or maybe help me. I want to run POE over a distance of between 1 kilometer to 12 kilometer (I know this is very long). Would POE work for me or am I wasting my time researching this. What I want to do is have a single power and communication point to connect Arduino's every 100 meter on a single cable (CAT5 or similar) and communicate over I2C to a single master Arduino unit. I am stuck at this. Thanks again for hearing me out, pointing me in the right direction or answering my question for me. And sorry for my horrible english :-)
there is a dedicated Arduino forum, https://arduino.stackexchange.com/ which you may prefer.
Arduino uno draws around 45 mA. Cat5e is 0.188ohm/meter, so the cable has a resistance of 376 ohm (one kilometer power, one kilometer ground). Hm, this is not that impossible after all :) you lose like 17V on 1 km of cable.
However if you have an arduino at every 100 meter, that means 120 Arduino, a solid 5.4A current draw. Maximum allowed current per conductor is 0.577A on a cat5 cable, so this won't work on 5V.
POE can make this a little easier, as it runs at up to 48V. By increasing the voltage, it is possible to use thinner wires, since less current at higher voltage carries the same power. PoE can wire 60W of power over 100 meters (with serious losses due to the thin copper wires in the Cat5e cable). So I would say, although the idea is insane (no offense :)) but actually it is possible to make it working.
However you can't do I2C on such a long cable. You have to go for at least RS485, and use it at a very low speed, say, 300 BPS if you want to have 12km.
Is there a chance to learn the problem you're trying to solve? There could have been much better solutions than 12km of wire. That is a serious cost in copper, not to mention the cost of a good PoE adapters. For a 12km long wire, you have to have very serious overvoltage protection, too. Probably a radio link and a battery-operated device would be a better choice, no?
I am experimenting two low energy bluetooth 4. I am getting uuid, tx power level and rss values on the android app that I downloaded.
I noticed that one of these two is sending 0 for tx power level, but the other one is sending 4 for tx power level and see different RSSI values on the android app even though I put them in the same spot. It means that the distance is same between my android phone and these two bluetooth devices. If the difference is +/- 5, I understand, but the difference is +/- 15. Is is because of the tx power level?
And oo I need to take tx power level into consideration to calculate the proximity between the BLE 4 and my android app?
You cannot directly relate RSSI and absolute distance between BLE central and peripheral. Of course RSSI is affected by, but not only, distance. However there are other significant factors such as interference, transmittion medium, etc. If your two BLE peripherals are two different models, the values may even vary more.
RSSI fluctuating for around +-15 is very normal for BLE connections, and nearly impossible to eliminate in practical cases. So basically you cannot only rely on RSSI for calculating distance if you want the error to be less than several meters.
I understand that Bluetooth Low energy(BLE) client scan for BLE peripherals. I want to know, how far,in meters, a BLE client can scan/discover a BLE peripheral.
An iPhone 5 will detect a RadBeacon USB (BLE Beacon) set at maximum transmit power about 40 meters away. At greater distances of up to 50 meters, it might be intermittently detected, but detections are not reliable. Outdoors with clear line of sight, it can sometimes be detected at even greater distances of up to 100 meters, but again this is not reliable.
This is typical, but just an example. The specifics depend on the transmitting device, the receiving device, any physical obstructions, and how much radio noise is in the area.