View Full Version : [Question(s)] Interfacing FLIR Lepton with Intel Edison

03-02-2015, 03:48 AM
I am writing here since I did not get any answer on the sensor related google group (https://groups.google.com/forum/#!forum/flir-lepton). My problem seems to be a more general electronical issue and would probably be better disscused here.

My motivation is to use one of the new FLIR Lepton LWIR sensor (http://www.flir.com/cores/content/?id=66257) in combination with the Intel Edison. Since the Edison has an IO logic of 1V8, where the lepton uses 2.5-3.1 V, one has to do a level shifting to let them talk to each other. So far I have not been able to sucessfully accessing the FLIR Lepton over I2C (SCL/SDA) through a logic level translation. However if I am using my Raspberry PI B+ setup, where no shifting is involed, I am able to talk to the sensor without any problems.

Here are my two setups:

Intel Eidson on mini breakout board
Using I2C1_SDA (GP20) & I2C1_SCL (GP19)
Pullmode of both I2C pins are disabled by SoC (not using the internal pullups)
Using of an Adafruit 4-C BI-Directional level shifter (http://www.adafruit.com/product/757) (has 10K pullups on both sides)
Setting the I2C speed to 100 KHz (STD)

Raspberry PI B+
Using I2C1_SDA (GP8) & I2C1_SCL (GP9)
Using of the internal 4.7K Ohm pullup resistors
Using the default I2C speed of 100 KHz

As far as I am using the Raspberry PI setup, everything works like a charm. I have enabled I2C and used the default bus speed of 100 KHz. By executing “i2cdetect –y –r 1” and measuring the signals with my RIGOL DS1052E on the SCL pin yields to the following image:


One can clearly see sharp edges and values that fit to the I2C standard. As a return value of i2cdetect the FLIR Lepton get listed with the address 0x2A. Further I can make use of the Lepton SDK to read out status registers and perform a flat field correction (FFC) without any errors.

When I am using the Intel Edison the situation changes. For debugging purpose I’ve measured all the signals on the I2C bus and tried to stepwise include parts of the electronic circuit. As a starting point I’ve measured the signal on the SCL pin without the connection to the level shifter:


Not that sharp edges but values that still fit to the I2C standard too. The edges and the signal LOW/HIGH value depends on the used pullup resistor. I’ve been playing with different values here and ended up by using a 5K Ohm resistor.

As a next step I have included the level shifter and connected the lower side with the 1V8 pin and the higher side with the 3V3 pin of the Edison. SCL on the higher side is also pulled up with a 5K Ohm resistor. Measuring this time on the higher logic level side of the SCL line yields to the signal in the next image:


So far so good. When I now include the FLIR Lepton and measuring the signal on the 3V3 logic level side I’ve got the following strange image:


It seems that the signal can’t reach anymore the voltage of a logic LOW. Another observation is the measured current (5.3mA) that flows through the SCL pin of the Lepton. Is this supposed to happen? It looks like the input has an internal resistor of about 528 Ohms (2.8V/0.0053A). I am also a bit confused about the 2V8 IO voltage of the Lepton and the breakout board from Pure Engineering. Shouldn’t there be a connector that let me connect the 2V8 IO voltage as the higher voltage of the level shifter? Could this be the problem with the shifting?

Please let me know if you have or have not successfully connected your Lepton to another logic level. I would also appreciate if you have any hints on how I could solve my issue here.

Thank you very much in advance…

03-02-2015, 03:45 PM
1.8V is a very low voltage -- it may be that the MOSFETs in the Adafruit converter are not able to properly turn on with that voltage.
You may need to go to Digi-Key or similar, and find another N-channel MOSFET that has a low enough Vgsthresh.
(And, in case you didn't know, a level converter like this is just a single MOSFET per wire, plus the pull-ups, so you can build that on a breadboard or whatever.)

03-02-2015, 04:07 PM
This is quite strange.
I don't really have an idea about what could have gone wrong (the BSS138 on the level shifter seems to be roughly adequate at first glance). Could you check what the Edision side of the level shifter (SCL and 1.8V) looks like when everything is connected ?
Maybe check with another line of the level converter (it has happened to me to kill these things at least once or twice), and re-verify that the lepton module still works... :/

03-02-2015, 04:26 PM
Quick update from my side. The images of the Edison setup from the previouse post where taken with a I2C speed of 400 KHz (my fault :-)), but changing the speed won't result in a diffrent signal.

I have followed the advise from https://groups.google.com/forum/#!topic/flir-lepton/jp8Ewr6jIR4 and tried to just add pullup resistors to my 1V8 logic without using a level translator. On the SCL pin of the Lepton I am measuring a voltage of 2V8 without the pullup connected. If I am adding a 10K Ohm pullup resistor the voltage goes down to 2V4 and the communication over I2C is still not working.

The Edison with the Adafruit level shifter (no addition external pullups) works like a charm with an ADXL345 sensor.


Gonna take an image now from the lower level side with the Lepton put in...

03-02-2015, 04:36 PM
Here we go... The image was taken with the 10K Ohm pullups on the adafruit level shifter. If I am adding another 5K Ohm resistor on the lower level side I can increase the high value up to 1V52 but the lower line stays at 0V54.



Thanks for the hint. My reference was this document from nxp --> http://www.adafruit.com/datasheets/AN10441.pdf. It looks like the level shifter / edison can't drive the 5.3mA since there are only 3mA on a GPIO where the Raspberry PI can drive about 30mA. Are there any Push-Pull I2C compilant translators? For what I know I2C works mostly with open-collectors...


Double checked with different ports on the level shifter, same result. Lepton still works greate on the Raspberry PI.

03-02-2015, 05:33 PM
There exist plenty of buffer ICs with open-drain/open-collector outputs, but those that can operate down to 1.8V tend to be surface mount. You could get a cheap dual buffer with open-drain outputs for as little as ~$0.40 each in singles on digikey. For your setup, you would need one dual buffer powered from 1.8V and one powered from 3.3V. The 1.8V buffer would have its two inputs connected to the 1.8V I2C SDA and SCL lines, and its two outputs connected to the 2.8V I2C SDA and SCL lines. The 3.3V buffer would have its two inputs connected to the 2.8V I2C SDA and SCL lines, and its two outputs connected to the 1.8V I2C SDA and SCL lines. Pull-up resistors connected to each I2C line as usual.

It might be possible to use a single quad buffer instead of two dual buffers, but running off a single voltage runs the risk of damage to the 'high' voltage inputs (2.8V SDA and SCL) if powered at 1.8V (when not specifically designed to survive that) and the 'low' voltage inputs not getting high enough to reach the threshold if powered at 3.3V.

03-02-2015, 05:59 PM
I was wondering about maybe trying one of the sparkfun Edison boards for doing the conversion?

At least for my one with the mini breakout board. The Edison Arduino board has it's own voltage converters.

03-03-2015, 02:31 PM
This sounds interesting. I am not familiar with this kind of components since my background is more IT related. As far as I understand, this buffer can be used to break down bus capacitances into smaller compliant pieces and provides level translation capabilities. Beside this they can also accelerate the rise time. From a theoretical point of view is this what helps me solve my problem? Isn't the fall time the issue here? I don't yet understand the issue of not reaching the sink (low level voltage) completely. Or is even my capacity on the bus to high with only one sensor?

They indeed use an active part that does the level shifting. I've tested one of these https://www.sparkfun.com/products/11955 but the result is similar than with the one from adafruit. Somewhat makes me believe they are using the same schematic internally for the level shifting.

03-03-2015, 02:42 PM
The PCA9306 used on the Sparkfun board is rated down to 1.2 Volts on one side, and 1.8 Volts on the other side, so that should work.
The oscilloscope shows a too-slow rising edge, which I would believe means too-soft pull-up. With 100 kHz speed, 10 kOhm should be enough at 5 Volts, but the lower voltages should scale down the pull-up in proportion. You might want to try with 2.2 kOhm, and see if it works better.

03-03-2015, 02:44 PM
Also: The problem of not reaching the lowest level is typically caused by a too weak driver on the one driving the signal down.
On AVR microcontrollers, that is sometimes seen when a port is accidentally set to "input" and the "output" register simply drives the pull-up resistor. I don't know if there is similar configuration on some part of your current setup.
0.5 Volts also looks like a diode drop worth of voltage. Perhaps the output stage is protected or designed in a way that makes that be the outcome.
Or perhaps you already runined this output stage with hooking up something too hot in a previous experiment. There's many possible reasons...
What does the waveform look like with external pull-ups, but nothing else connected?

03-04-2015, 03:36 AM
I don't have any other components in my current setup beside the Edison as the I2C master, the level shifter in-between and the Lepton as the one and only I2C slave on the bus. My MCP9808 and ADXL345 sensors work as they should with this configuration. As you can see from the attached image the I2C SCL pin from the Edison should be ok (not yet toasted) when using a 1K Ohm pullup.


It must have something to do with the Lepton. What coul'd I do about a weak driver?

03-07-2015, 12:54 AM
I don't have any other components in my current setup beside the Edison as the I2C master, the level shifter in-between and the Lepton as the one and only I2C slave on the bus.

I lost lock on which combinations worked and didn't. Could you post the circuit diagrams for the Raspberry (i.e the LEPTON one that worked) and Edison (i.e. the sensor ones that worked and the latest LEPTON one that didn't)?