Electronic – arduino – Using an Arduino to read data from serial device then send data over bluetooth

arduinoserial

So from a general high level standpoint I need to grab data from a serial device and then send this data over bluetooth. I have a bluetooth modem picked out. I understand how to hook it up to the arduino. I however do no know how to hook the a serial device that will talk to the arduino.

It seems like I am trying to do too many simultaneousness serial connections.

Best Answer

A serial protocol mostly uses a master/slave configuration with different addressing schemes:

  • SPI: Serial Peripheral Interface; pins often labeled MOSI, MISO, SS or Select, and SCLK or CLK.
  • I2C / TWI: Inter-Integrated Circuit / Two Wire Interface; pins often labeled SDA and SCL.
  • 1-Wire: Actually needs two or more wires -- at least power/data and ground.
  • UNI/O: used with some EEPROM ICs from Microchip; will likely have to write your own library.

  • U[S]ART: Universal [Synchronous/] Asynchronous Receiver/Transmitter; typically does not use master/slave configuration, only being used for point-to-point communication.
  • USB: Universal Serial Bus; uses a host/device scheme akin to master/slave. Pins often labeled VCC, DATA+, DATA-, and ground or GND.
  • PS/2: Personal System/2 connector, an old IBM PC std. connector; pins are often labeled VCC, DATA, CLK, and ground or GND; often made interchangeable with USB sockets.

The library NewSoftSerial by Mikal Hart allows the user to implement an interrupt-driven software (as opposed to hardware, like UART peripherals) routine for serial communications. Use it if you need to, but be aware that debugging clashing interrupts is more challenging than debugging polling routines (which is apparently what the default libraries do).