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.

asked Dec 29, 2010 at 7:51
\$\endgroup\$
2
  • 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\$ Commented Dec 29, 2010 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\$ Commented Dec 29, 2010 at 15:38

6 Answers 6

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

answered Dec 29, 2010 at 10:06
\$\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.

answered Dec 29, 2010 at 16:55
\$\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

answered Jan 4, 2011 at 12:34
\$\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.

answered Dec 29, 2010 at 14:04
\$\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.

answered Jan 4, 2011 at 16:25
\$\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.

answered Mar 4, 2015 at 3:04
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.