6
\$\begingroup\$

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.

\$\endgroup\$
  • 2
    \$\begingroup\$ Maybe you can edit your starting post and give more information about what kind of serial device you're talking about? Is the communication via UART, SPI, I2C, or anything else? Component or module names come in handy. \$\endgroup\$ – Hans Dec 29 '10 at 9:56
  • 1
    \$\begingroup\$ @sheepel Tell us what connections you are making between the Arduino and the BT modem. Then tell us what serial device you are trying to connect additionally (datasheet ref would be good). \$\endgroup\$ – vicatcu Dec 29 '10 at 15:38
11
\$\begingroup\$

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).

\$\endgroup\$
4
\$\begingroup\$

Maybe have a look at software serial - it allows multiple serial connections. Any of the digital pins on the Arduino can be used for serial communication, and the normal serial pins can continue to be used for your bluetooth modem.

\$\endgroup\$
2
\$\begingroup\$

Yea, Using Software serial (as linked too, above) is your answer, it's fairly robust as long as you arn't doing to much other heavy stuff on the arduino at the same time and the baud rate is something sensible. It's your choice if you use the hardware UART for the modem or the device, and which you link up to the software serial port.

I'm assuming you are using UART for the both devices, but if so, are you aware that you don't need an arduino in the loop? just wire the device straight into the blutooth modem's uart in/out (make sure that both use TTL or otherwise compatible voltages) and you can pick up the data on the other end of the bluetooth link using SPP (as you would be doing anyway I assume)

Jim

\$\endgroup\$
0
\$\begingroup\$

From what i remember, you should be able to use USART and SPI or USART and I2C on the arduino at the same time. If you can give us more details on the Blue-tooth and the serial device, someone should be able to give you a definitive answer.

\$\endgroup\$
0
\$\begingroup\$

The quickest (though limited) method would be to simply connect the device you want to read from (assuming it's an async. serial stream) to the AVR's RX, then the AVR TX pin to the BT module's RX pin. You could then simply read from the UART, do whatever processing you want (or none at all), then write back out to the UART.

The major limitation is that the baud rate of the BT radio and your device must match. You can adjust the baud rate on most BT radios, however. You're also stuck with single-direction communications.

If you're doing no processing, you could directly connect them.

\$\endgroup\$
0
\$\begingroup\$

One simpler option would be to use a Bluetooth module with serial interface and hook it up to the serial line that you want to forward. No need to add/program an Arduino.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy