I'm doing a project which requires me to use a TinkerKit thermistor sensor to get the room temperature. After detection, the Arduino BT board must send serial data back to an Android phone via Bluetooth. And the temperature need to be display on the phone screen in Celcius.
I have already make the serial communication link work. But the reading from the thermistor seems weird. It reads at 173/174/175, but I'm not sure whether it read in Fahrenheit or Celsius (as I could not find any datasheet and details on the thermistor's reading unit).
Must I include any temperature convertor coding with the values?
The output values will be mapping # : outputValue = map(sensorValue, 0, 1023, 0, 255);
Are you sure there's no data sheet for reading the thermistor, or documentation for the kit explaining what it returns? I'd guess the value you're getting is an unsigned byte (or possibly more than one byte, based on the '1023' value in your map) indicating the 'percentage' of temperature between two ranges.
Like if it were a single unsigned byte between -40'C (0) and +40'C (255), 174 would be 14'C (174/256 * 80 - 40) or thereabouts. You could probably do the math to figure out what the correlation is between the actual observed temperature in your room is and the thermistor value with a known-good thermometer as well.
Perhaps there's a library for the kit that interprets its values for you?
Related
I wrote an app to detect beacons and calculate the distance by RSSI.
When I use iPhone/android for simulating as beacons will cause a big difference on RSSI.
Such as I put iPhone at 3M far from BLEscanner the RSSI is -65. But at the same place, the RSSI of the android devices will be -80 or more.
Does anyone know how to adjust the difference of RSSI?
As you have discovered, every phone model has a slightly different Bluetooth transmission power. Similarly, every phone model has a slightly different receiver sensitivity. Changing which phone model is used for transmission and reception will affect the RSSI you receive.
You cannot perfectly correct for these differences for two main reasons:
There are lots of other factors that come in to play that affect RSSI that have nothing do do with the phone model (signal reflections, attenuation by the air or obstructions, the effect of a phone case, a nearby hand holding the phone or other human body parts.)
There are limited data on the differences between phones in terms of Bluetooth transmitter power and receiver sensitivity.
With those caveats in mind, Google did create a limited dataset of correction factors as part of its coronavirus contact tracing effort with Apple.
You can read how this works here
And see the full correction data set here
The basic idea is:
Take two values from the CSV data set above for your test setup:
Use "tx" column value for the transmitting phone model as its "TX_Power" in the equation below. Use "RSSI_correction" column value for the receiving phone.
Then plug them into this equation:
Attenuation = TX_power - (RSSI_measured + RSSI_correction)
The resulting Attenuation value is the corrected signal loss (measured in dB and usable similar to RSSI) between your transmitter and receiver and can be used as an input to distance formulas.
I am capturing the udp traffic of my mobile device to understand how the unity messages are sent, with what format, etc.
Currently I am not being able to even read them, I only see their hexadecimal value and if I want to transform it into ascii it does not make any sense. Only sometimes do you see a meaningful value like my username.
As I was able to speak with the developers of the game, unity sends by udp packages values such as the position, the speed with which the character moves, the strength of the shots etc. But I need to be able to see those values and now I can't figure out how.
Most of the packets are short and look like this:
Hexa: 450000282e4c40002711d6cb12c07b11c0a80034b55aeeff00146cac000185649a8b002080000000
Ascii: E(.L#'ÖËÀ{À¨4µZîÿl¬d
The biggest one with some information are similar to this:
Hexa:450002f6d07040002c1115bf12d79214c0a800349c8aff0a02e2d47a0001974c02cf0020c0000000ff82cb00020082c60201000c000001000c00016302030001604df870f965340ea85076954c4641b5cdcccdc20ad7233dcdcc90c2340200000000cdcccdc20ad7233dcdcc90c20100b44200000000000000000100b4420100b442fa000000803f010000000000000000000000000000000400c236ee4343498644a42ef08bbd67c4e8f168eb9d20563004c96d41d68b427abdd2843fe59f909904f8e91cc9b542033100000c00546573747465737474657374000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010000000000000000000000020000001300000010000000510200004b000000e1fb64def58d5524fbaf9b5cf0547b9a0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000006cd5317f111d42141a2481f7e95223c005000000dba0d79272a295c4a9a968a669a3650905000000fd301ab653c6cc548bb9862b0f9b3aa005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000006cd5317f111d42141a2481f7e95223c00500000000000000000000000000000000000000dba0d79272a295c4a9a968a669a365090500000000000000000000000000000000000000fd301ab653c6cc548bb9862b0f9b3aa005000000000000000000000000000000000000000000000000000080f404353f00000080f204353f02000400010036000a0002010000000000000000000000002600000000000000000000000000010000000000000000000000000000000000000000000000000010000a0003020000000000000000000000000000
Ascii: EöÐp#,¿×À¨4ÿ âÔzLÏ ÀÿËÆc`Møpùe4¨PvLFAµÍÌÍ ×#=ÍÌÂ4ÍÌÍ ×#=ÍÌ´B´B´Bú?Â6îCCID¤.ð½gÄèñhë V0ÉmAÖBz½Ò?åøéɵB1TesttesttestQKáûdÞõU$û¯\ðT{lÕ1B$÷éR#ÀÛ ×r¢Ä©©h¦i£e ý0¶SÆÌT¹+: lÕ1B$÷éR#ÀÛ ×r¢Ä©©h¦i£e ý0¶SÆÌT¹+: ô5?ò5?6 &
Where Testtesttest is my Username
Any ideas?
In the application I am looking forward Bluetooth in Beacon is very good option as I want to collect PH from different sources to the application so I can't pair my android device with all the BLE devices at a time as it will be around 20-30.
But I can see that if there is Beacon then Android can scan all of them and also get the RSSI of all devices without being paired with them.
So is it possible that we add few other parameter for example PH, Temperature, Humidity and 3-4 other parameters so Beacon is going to broadcast all these parameter along with RSSI and in Android app I can collect all the information?
I am not sure if this is feasible solution or not and if it is then how to achieve this in beacon?
Bluetooth beacons generally rely upon advertisement packets to send data, which are limited in the number of bytes available. For manufacturer advertisements, you basically have 24 usable bytes to work with, although you need to reserve some of these as a flag to indicate it is your beacon format, and not somebody else's beacon format.
You can look at the AltBeacon spec as an example. This format uses two bytes to identify itself (the "beacon code"), 20 bytes of beacon identifiers, one byte of data and one byte for reference RSSI. You probably still want a unique identifier for each beacon so you know which beacon sent you the information. But you might be able to cut this down to four bytes for your purposes, which would allow you to have 2^32 different beacons sending this information.
The Android Beacon Library lets you both transmit and receive beacons using arbitrary formats you can define using the BeaconParser class. A beacon format that uses a four byte identifier, two bytes each for PH, Temperature and Humidity data fields, and two bytes each for five other data fields might look like this:
m:2-3=abcd,i:4-7,d:8-9,d:10-11,d:12-13,d:14-15,d:16-17,d:18-19,d:20-21,d:22-23,p:24-24
Hi I have developed an android program to display the readings from an omron bp monitor. In the IEEE specification of BP monitors it is said that the BP monitor can send upto 25 datas in one event report.
I am getting the following as data from the monitor,it has only one reading and sometimes it is not the latest reading but the first one from the device's memory
e7000052005000010101004a0000ffffffff0d1f0040f000000100010038004200030032000100
12000300060062004d005420140327213502000002000a005120140327213502000003000
a000020140327213502000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000
How should I get the program to get the latest data or how can I send request monitor to send multiple measurements in one event report?Pls help
You will need to consult the data sheet for the device which describes all the data, and how it should be interpreted.
This data string, actually should contain all the data.
The data sheet should have the details about which bits or a combination of bits gives you what.
For example:
The first 3 bits would give you the Device short name
The 4th, 5th, 6th and 7th bit would give you the timestamp of the reading.
The 9th and 10th bit could give you the Systolic measurement, and so on.
IEEE doesn't specify how this data should be arranged I guess. I have worked on another BP monitor, whose manuals had elaborate documentation about this.
I'm new to android and I thought to develop a bluetooth app to retrieve parameters from an OBDII device. I have downloaded the sample bluetooth chat application and configured it. The problem is how and what is the message that I need to send to the OBDII device in order to receive the parameters? and how should I handle them in the application side?
Thank you.
You're question is not very specific, but I will give you some guidelines.
First of all, test with an exisiting OBD-II reader application if your car actually works.
The ELM327-bluetooth-connector you have (I assumed it's a ELM327) translates ASCII commands to voltages. So all you have to do, is send some ASCII commands, and you get ASCII-values back.
The OBD protocol knows several modes and parameter's, but I will explain to get real-time data. That's mode 1.
Mode 1 Sending
This is kinda simple as it is.
Mode 1 is '01'.
After that part, you have to send a parameter ID with it. 0C is for RPM, 0D is for speed. (Look into the link below).
And after each command you have to send a Carriage Return. (CR = '\r')
So basically, for speed, you have to send:
'010D\r'
Receiving Mode 1
The answer you will get back from a Mode 1 query, starts with '41'.
After that the parameter ID is returned, and then the value.
The value is most of the time in hex. You will have to do some conversion to read a human readable value. For more information, see the link, as formula's to convert are provided too.
Example:
'410D17'
So 17 is the value of your current speed in hex. 17 to decimal is 23, so you're driving with 23 km/h.
This wikipedia page has some good information about it:
OBD-II Parameters