How to view/access digital pin status and analog pin values of XBee - xbee

XBee has digital and analog pins.
Before hooking two XBees on API mode on radio, we want to first confirm the analog values from the sensor in order to range for scaling it to engineering value of the sensor. (E.g. scaling 0-65535 to say -20 - +40 deg C).
Is there a way we could check the pin status/values? We couldn't find this capability in XCTU software (or may be we don't know where it is).
Is it possible to see these values on serial port of XBee in computer (e.g. Raspberry pi)?

Yes, you can read serial data from remote xbee by connecting coordinator xbee(at PC) to its TX to DIN and RX to DOUT. That is for arduino uno. Then on serial, it will print 24 packets of data and digital data will be on 20 and 21 and analog data will be on 22 and 23.

Related

Can't read from VEML6030 (or only get 0x0000) via I²C using Renesas r5F104GK

My problem:
I have connected a VEML6030 (Ambient Light Sensor from Vishay) to my µC.
If I want to read this sensor, I only get 0x0000 as an answer.
I'm programming in c on a Renesas r5F104GK.
I used Applilet as a code generator.
I have the data sheet and an application note as documentation. I have also already spent days searching online - unfortunately unsuccessful so far.
I also have a Lis3DH sensor on my PCB, which is connected to the same I²C bus.
I can separate both components from the bus with a jumper.
What I have already achieved:
Depending on the level of the ADDR pin, I see an ack on the bus.
identify veml6030
The communication with the Lis3DH works (read & write)
I get protocol-compliant Ack / NACK from the sensor.
The system is operated at 3V
If I try to read output, I only get 0x000:
Output
During the tests I am sure that only the VEML6030 is contacted.
I would be very happy if someone here could share their experience with the VEML6030 and, if necessary, have a tip on what I'm doing wrong.
In the end, I'm sure that the problem is in front of the monitor ;)
Update (#Lundin)
How can I move my ticket to electronics.stackexchange.com?
Unfortunately I can only publish a part of the schematic
2.1) SDA & SCL have got 10k Pullups
2.2) SDA is connected to µC Pin 18 (P14/RxD2/SI20/SDA20/TRDIOD0/(SCLA0))
2.3) SCL is connected to µC Pin 17 (P15/PCLBUZ1/SCK20/SCL20/TRDIOB0/(SDAA0))
2.4) INT is connected to µC Pin 36 (P140/PCLBUZ0/INTP6)
The Connector at ADDR is just used to get the correct footprint on the PCB. In real it is a Jumper with 3 pins.
P.S.: Solved Communication
enter image description here
I hope this is the correct way now.
My problem is solved.
I've to send only a "Start".

Getting data from an RFID reader

I have a an RFID reader with very scant documentation.
It has some wires hanging out and they come from a connector with "+12V", "GND", "NC" , "COM" (or CDM) , "NO", "SW", "D0" , "D1" pins.
I don't know what they are but "+12V" and "GND" are for voltage and ground. Probably D0 and D1 are for I2C communication.
The unit works fine (beeps while reading from RFID card etc) but I'd like to get the info of the cards to a laptop using a serial (COM) port. I don't want to damage the serial port of my laptop. How would I go about trying to receive data from the RFID reader. I can try on another Windows XP laptop which is expendable.
My guess is to connect the D0 and D1 to the serial port but which pins do I connect? What about the voltage? I am familiar with RX and TX port usage. I just want to know that I can get data off the RFID reader and if so I'll write a more robust com send/receive C program.
D0 stands for Data Low pin.
D1 stands for Data High pin.
From the description of yours, you might be using Wiegand based RFID reader. The pin connection present here RFID reader. The pins D0 and D1 are used to send data to controller.
When D0 and D1 are both Low or 0 that means no data is
transmitting.
When D0 is Low and D1 is high (1) then the output 0 is transmitting.
When D0 is High and D1 is Low then the output 1 is transmitting.
When D0 and D1 are both High or 1 that means no data is transmitting.
So when you connect these two pins to some controller, it has to monitor the data from these two pins and has to determine the output (logic 0 or 1) based on the above four points. After controller reading all the data from D0 and D1 (may be 96 or 128 consecutive bits), you need to decode that binary data into ASCII first and then you can extract card number from that data.
Well you'll first need to make the RS232 connector. Your pins are as follows:
+12V: Hot voltage supply
GND: Ground
^^Connect those to a power 12V power supply.
NC: Normally closed
COM: Common
NO: Normally open
SW: Switch
D0: Data 0
D1: Data 1
There should be at least some documentation with the device as to which pins communicate. Look up RS232 9 pin wiring to see what you should solder where.
Then you'll need a Serial communication program that can send or at least receive communications from the device. Putty would be your best bet.

Raspberry Pi can't send data to PC through serial communication

I am trying to send/receive data over the serial connection (GPIO UART pins) between a Raspberry Pi 2(raspian wheezy) and an STM32F4 board. I am using the sample code in the link: http://www.raspberry-projects.com/pi/programming-in-c/uart-serial-port/using-the-uart.
It works when I connect the TX and RX pins on the board together. However, when I connect RPI to my laptop by module USB-TTL PL2303 and use hyper terminal to see the result, the received characters are garbage characters. I don't understand why. Is there anything I missed?
Could you give me some advice I could look for, please? Thank you!
Most likely you are using incorrect baud rate. It should be 115200 (115200-8-N-1) (you can use else but then you need to set both endpoints to the same baud). Check the baud rate of the serial connection using stty
stty -F /dev/ttyX
or setserial. In case of baud rate error you can try what authors say:
Try using a slower BAUD rate (or a single 0xFF byte which only has the
start bit low) and see if it works. We had a problem using 115k2 baud
rate where our microcontroller communicating with the RPi could hit
113636baud or 119047baud. 113636baud had the lowest error margin so
we used it and TX from the RPi being received by the microcontroller
worked fine. However when transmitting to the RPi nothing was ever
received. Changing the microcontroller to use 119047baud caused RX to
work.

C code to Read data from nonin Pulse Oximeter device via bluetooth Serial Port profile in linux

I am trying to communicate to the Nonin Pulse oximeter device to read the data (Pulse rate and SPO2 level) via Bluetooth. Nonin device supports SPP and HDP profile. I want to communicate through SPP profile. I am able to scan and pair with the device by the sample code available in Bluez.
Please tell me next steps how to send command and read data from the device. I have got struck at this point.
I realize this is a late response, but I recently setup data acquisition from a Nonin PalmSAT 2500A VET unit. I am using the RTC-1000 cable and an RS232 to USB converter.
This is straight from the manual:
"Information from the device, in the real-time mode, is sent in an ASCII serial format at 9600 baud with 9 data bits, 1 start bit, and 1 stop bit. The data are output at a rate of once per second.
NOTE: The 9th data bit is used for odd parity in memory playback mode. In real-time mode, it is always set to the mark condition. Therefore the real-time data may be read as 8 data bits, no parity.
Real-time data may be printed or displayed by devices other than the pulse oximeter. On power up a header is sent identifying the format and the time and date. Thereafter, the data are sent once per second in the following format:
SPO2=XXX HR=YYY
where “XXX” represents the SpO2 value, and “YYY” represents the pulse rate. The SpO2 and pulse rate will be displayed as “---” if there are no data available for the data reading."
Link to manual:
http://www.proactmedical.co.uk/proshop_support_docs/2500aman.pdf
What model oximeter are you working with?

API mode Xbee doesn't send digital samples?

I've been playing with getting an XBee to transmit whether a push button is up or down.
To do this I have the wire coming out of the circuit connected to DIO4 on the XBee. I used X-CTU to set DIO4 to digital input mode. Nothing else is enabled.
Now, the sensor XBee is transmitting a ZigBee I/O Data Sample Rx Indicator packet. I used the 'Building Wireless Sensor Networks' book to help parse out the packet. It says a packet always includes the analog sample values and will only include the digital ones if a digital pin is configured. I'm getting a 21 byte packet back, which implies the digital bit sample is not included. The digital mask says IO4 is enabled, and all the analog inputs are disabled. However, it appears the digital values were placed into the analog samples.
This is my confusion. Why is the digital sample being stuffed into the analog sample? Or is the analog sample simply left out if no analog inputs are configured (contrary to what the book says)?
Short answer: Yes, there are only analog samples in the payload if bits are set in the analog channel mask.
Long answer:
The XBee S2B documentation describes the details of the packet in the ZigBee IO Data Sample Rx Indicator section on page 114.
In summary, the payload starts with the number of samples (always 0x01), then a 16-bit digital channel mask and an 8-bit analog channel mask. The masks indicate what data follows. If any bits were set in the digital channel mask, there will be a 16-bit value holding the digital samples. Then a 16-bit value for each analog sample indicated in the analog channel mask, from AD0 to AD3, followed by the supply voltage.
Digi's Open Source XBee Host C Library has some code in include/xbee/io.h and src/xbee/xbee_io.c that demonstrate parsing of those frames.

Resources