Go Down

Topic: Thermal Camera RS232 (Read 1 time) previous topic - next topic

I am trying to talk to a Thermal Camera and control the higher functions of it.

it is a Tau 320/640 made by corebyindigo.com it is RS232 capable and is inverted.

We have the SDK kit from FLIR, and it has samples of the code. My first step  want to do is talk to the camera using the arduino TX/RX lines and the sample code that they have given me. that will allow me to change the color pallate and get like the serial number of the camera and a few other functions. (the only way i can currently talk to the camera is if i put a different board on it and plug it directly into the computer with a USB) I want/need to as Phase 1 talk to it using the TX/RX lines from the arduino and have the arduino plugged into the computer via USB. that is stage one! if we can get that then i will post Stage/Phase 2 of this project.


dc42


I want/need to as Phase 1 talk to it using the TX/RX lines from the arduino and have the arduino plugged into the computer via USB. that is stage one! if we can get that then i will post Stage/Phase 2 of this project.


I can think of a few solutions:

1. Arduino Mega (has several serial ports, one is used for the USB, so use one of the others for the camera)

2. Arduino Leonardo (has mcu with built-in USB, so doesn't need the serial port for that) - but not available yet AFAIK

3. Teensy

4. Arduino + serial port chip

Some might suggest SoftwareSerial but I don't advise that except under special circumstances. Whichever solution you use, if the camera uses genuine RS232 signal levels (i.e. around +/- 10v, you will need to use RS232 level converters.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

We currently have the Arduino Uno along with the Wixel and Wixel Shield.

Can you describe to me about each one and what the benefits are of the different solutions you have?

Core By Indigo says that the core can handle RS232 of about 6.0V. The Arduino is 5.0V and Wixel is 3.3V so we are good there. We followed Pololu's guide to inverting the signal of the Wixel.

Function       COMMAND        Description                                                                             BYTE                                Argument
CODE                                                                                                                                 Count                              (i.e, Data Bytes) (hex)
(hex)

0x10            VIDEO_LUT       Gets and sets the analog video LUT or intensity transform.       Get Cmd: 0 None              0x0000 = White hot     
                                                                                                                                         Set Cmd: 2                       0x0001 = Black hot 
                                                                                                                                           &                                   0x0002 = Fusion
                                                                                                                                         Resp: 2                            0x0003 = Rainbow
                                                                                                                                                                                0x0004 = Globow
                                                                                                                                                                                0x0005 = Ironbow1
                                                                                                                                                                                0x0006 = Ironbow2
                                                                                                                                                                                0x0007 = Sepia
                                                                                                                                                                                0x0008 = Color1
                                                                                                                                                                                0x0009 = Color2
                                                                                                                                                                                0x000A = Ice and fire
                                                                                                                                                                                0x000B = Rain
                                                                                                                                                                                0x000C= OEM custom #1


We also don't know quite how to implement that (that is from the user manual), I have tried the USB to Serial made by Pololu Using the Wixel and the Pololu Serial Transmitter but can not get the camera to respond to me at all.

Like i stated i have the SDK that has sample GUIs but the code looks complete different than that above, which i know to expect but still unsure how to go about using the sample GUI and talk to the camera using the Arduino or Wixels TX/RX lines. Our ultimate goal is to not have the thing plugged into the computer at all, we want to control the camera using push buttons that call the above command and change the palate of the camera. and a few other functions. I hope this help anybody that is viewing this thread as well so you have additional details.

dc42

From the data sheet, it looks like the logic 0 and logic 1 levels are 0v and 3.3v, but it is not clear which way round. You might need to invert them between the camera and the Arduino using CMOS inverters. If you don't need to invert them, the 3.3v TxData signal from the camera can probably feed the RxData input of the Arduino directly, or use a diode and a pullup resistor to shift the signal from the camera to the Arduino up by 0.6v. You can feed the RxData pin of the camera from a voltage divider attached to the Arduino Tx pin, to drop the 5v to 3.3v.

The main problem you face is that the Arduino Uno can't communicate via both hardware serial and USB in the same sketch, because the USB is driven via the hardware serial port. You'll either have to use one of the solutions I suggested (3 of which involve replacing your Uno for something else), or use software serial. The best solution will be the Leonardo when it is available. If you want to add a UART to your existing Uno, take a look at http://www.sparkfun.com/products/9745 which looks like it already has 3.3v logic levels on the serial Tx and Rx pins.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


From the data sheet, it looks like the logic 0 and logic 1 levels are 0v and 3.3v, but it is not clear which way round. You might need to invert them between the camera and the Arduino using CMOS inverters. If you don't need to invert them, the 3.3v TxData signal from the camera can probably feed the RxData input of the Arduino directly, or use a diode and a pullup resistor to shift the signal from the camera to the Arduino up by 0.6v. You can feed the RxData pin of the camera from a voltage divider attached to the Arduino Tx pin, to drop the 5v to 3.3v.


We have talked to the manufacturer and logic 0 is 3.3V and logic 1 is 0V (if that helps)


The main problem you face is that the Arduino Uno can't communicate via both hardware serial and USB in the same sketch, because the USB is driven via the hardware serial port. You'll either have to use one of the solutions I suggested (3 of which involve replacing your Uno for something else), or use software serial. The best solution will be the Leonardo when it is available. If you want to add a UART to your existing Uno, take a look at http://www.sparkfun.com/products/9745 which looks like it already has 3.3v logic levels on the serial Tx and Rx pins.


When will the Leonardo be available and until then could you assist me with how I can go about using Software Serial? Be greatly appreciated.

Also would you like be to post a ZIP of the GUI from the SDK that has the coding for controlling the cameras higher functions? I am using Visual Studio Ultimate 2010 for the programming and have Visual Micro Arduino installed on my end.

also going through some other folders that came with the SDK there are a lot of files with the extension of " .h "

do you want me to upload some of those files or folders for you to take a look at and see if they are of any value to me?


dc42


We have talked to the manufacturer and logic 0 is 3.3V and logic 1 is 0V (if that helps)


Looks like it's the opposite way round to a standard unbuffered UART, in which case you'll need inverters. I suggest a 74HCT04 hex inverter. Use one inverter to receive the 3.3v level signal and feed it to the RxData pin on the mcu or UART. As the HCT series accepts TTL-compatible signal levels, it should accept the 3.3v logic level signal with no problems. Use another inverter to invert the output from the TxData pin, with a voltage divider on the output feeding the camera (e.g. camera input has 10k to gnd, 5k1 to inverter output).

I don't know when the Leonardo will be available, and I've always avoided Software Serial, so I can't offer much help with that. Your other easy option is Arduino Mega.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up