Can I connect 2 RFID card readers to one arduino? - rfid

I am looking for connecting to ADAFRUIT RFID PN532 readers to one arduino,
I think its possible since I2C was for that, but how can i modify the code (Which is already in RFID ADAFRUIT LIBRARY) two access through the both readers at one instance ?

No, you can't connect two Adafruit PN532 shields on the same I2C bus. The problem is that you can't change the peripheral address of the PN532. Thus, both PN532 NFC chips would respond to the same address and you can't control which of the two shields you communicate with.
However, you may be able to separate the two boards
by using an I2C multiplexer that switches between the two boards, or
by using the SPI option of the PN532 shields. In SPI mode you have an additional chip-select PIN that you could wire to separate PINs of the Adruino. You could then address a specific PN532 shield using those chip-select lines. However, you would need to port the PN532 library to SPI communication.

Related

Reading signals on ethernet port directly with RaspberryPi

I have a device which connects to its remote using rj45 port and 4 wire cable (a desk with adjustable height). I'm pretty sure it does not actually use an Ethernet protocol and uses sends some simple digital signals.
I want to Raspberry Pi to be able to control the device, so I was wondering if it is possible to read and dump and then send signals using Ethernet port just like I can do with any other pins? Probably the actual question here is about a way to bypass Ethernet driver in Linux OS.
This won't work. The Ethernet NIC on the RPi - just like any other NIC - can only receive Ethernet frames. Anything else needs to be connected over GPIO.
Edit: As NO-OP has reasonably pointed out, the signals may need to be made compatible with the GPIO pins - levels adjusted, maybe an opto-isolator here and there. Nothing expensive though usually. For controlling powered devices you likely need a driver or relais board - there are plenty around for the RPi.

GATT profile and UART service

I am new to developing a mobile app with bluetooth connection to peripheral device. I searched that GATT is the relevant profile used for bluetoothLE communication but our client recommended that we use UART service. Now I am confused as to
1. how these two things are related and
2. Do we have to opt for one of these, if so, what are the pros and cons of each. Thanks
Legacy Bluetooth provides the serial port profile (SPP) - This is essentially a serial input/output stream over Bluetooth.
Bluetooth Low Energy provides a number of profiles, but the most commonly used is GATT. GATT exposes characteristics/attributes which are a little like variables that you can read from/write to. A read/write is limited to 20 bytes.
Many embedded BLE chipsets provide a "UART emulation" over BLE GATT. Here a pair of attributes are used; one for read and one for write.
The Central device writes bytes to the 'write' attribute and the embedded chip sends them out of a serial port on the chip.
Similarly, data that is written to the chip's serial port and sent to the central via a notification of new data in the 'read' attribute.
You don't say what platform your are developing on, but one important consideration is that use of SPP on iOS requires your hardware to be MFi certified by Apple, while BLE/GATT does not.

Having trouble with SPI in Arduino

I have a project where I am trying to use the adxl345 as a pedometer and it is hooked up to an Arduino where it will count steps.I also have a bluetooth device from Adafruit (nrf8001) that is hooked up to an Arduino.
I want to the Arduino to send the steps via bluetooth to an smart phone. The problem I am currently at is the Arduino can only use either the adxl345 or the nrf8001. I cannot have both using SPI communication. I know that SPI can have multiple devices attached to it using chip select. I am using slave select but I don't know why it is not working. According to Adafruit they use their own special SPI communication that not only uses chip select but also a reset and interrupt.
Read following page.
https://learn.adafruit.com/getting-started-with-the-nrf8001-bluefruit-le-breakout/pinouts
It's REQ pin is considered as chip select.

How USB to Bluetooth DTR/RTS work?

A number of bluetooth Arduino shields (Bluefruit EZ-link, SparkFun Bluetooth Silver) support DTR/RTS and have special out pin to wire. How do they work? Does it require special drivers (linux f.e.)? Can any bluetooth receiver be used or modified to provide DTR/RTS? Since setting DTR/RTS is vendor-specific does it depend on transmitter side or receiver (bluetooth shield) only?
The only idea is that special USB drivers needed that send special AT commands to make BT receiver know actual DTR/RTS value.
The documentation of Bluetooth SPP (https://developer.bluetooth.org/TechnologyOverview/Documents/SPP_SPEC.pdf) states in section 4.1 RS232 Control Signals that "all devices are required to send information on all changes in RS232 control signals".
And since Bluefruit EZ-link is not using any special drivers on the side of the computer, it must be that the standard BT virtual serial port drivers that manage the ports created for the BT connection to Arduino handle the control signals properly and send them over to the BT shield connected to Arduino. Hence no work should be needed on the side of the computer, and it only depends on the receiver: whether it has the control signals accessible on any of the output pins and operates them as it should, or not (as usually is the case, unfortunately).

Bluetooth: Uart or SPI?

My question is : what is the best method to drive a bluetooth module(BTM-331 as an example) over UART or SPI? I am asking this in the following context.
I have some analog sensors connected to a uP. The uP sends this data over spi to another uP who has also a bluetooth module. Because I talk with the sensors via SPI is ok to talk with the Bluetooth module with spi or uart is better?
I am pretty sure that even if you want to use it with SPI, you can't. I've used other BTM modules and the SPI on them is used for programming the module. Communication with it is possible through UART and (most of the times) USB.
Looking at the BTM 331 (description here) and it does say that USB and UART are the interfaces used.
Other than that it is fairly simple to use, you send data to it and the data goes to whoever the module is connected to. That is the least you can do with it but it is more than enough for most people.

Resources