Shop OBEX P1 Docs P2 Docs Learn Events
MLX90614 IR temperature sensor Can`t get any contact with the sensor — Parallax Forums

MLX90614 IR temperature sensor Can`t get any contact with the sensor

avionikerenavionikeren Posts: 64
edited 2010-01-29 12:51 in Propeller 1
When the power to the sensor is turned on the propeller stops.
As you can see in the code, I have a counter to see it`s running.
I first tried with 5v, but now it`s running on a propeller pin.
The signal is connected directly and the reset is connected via a 1k resistor.
I have tried adress $5A and $00.
Any idea?

CON
  _clkmode = xtal1 + pll8x
  _xinfreq = 10_000_000
  lcdtx         = 10
  mlxsig        = 15
  mlxpower      = 9
  mlxreset      = 8
  
VAR
  long    irtemp
  long    tester
  
  long    Stack[noparse][[/noparse]20]
  
OBJ
  bs2           : "bs2_functions"
  serial        : "Extended_FDSerial"
  mlx           : "MLX90614" 
    
PUB start
  mlx.start(mlxsig,mlxreset,9600)
  bs2.start(21,22)
  cognew(Lcd, @Stack)
  tester := 1
  dira[noparse][[/noparse]mlxpower]~~
  outa[noparse][[/noparse]mlxpower] := 1
  
  repeat
    irtemp := mlx.GetTempC(0)    
    waitcnt(clkfreq>>1+cnt) 
    tester := tester + 1
    if tester == 1000000
      tester := 1
                                             
PUB Lcd
 
  serial.start(20,lcdtx,1,38400)
  
  serial.tx(13)
  serial.tx(13)
          
  Serial.str(String("ac01"))      'clear screen
  bs2.pause(100)
  serial.tx(13)
  Serial.str(String("ac01"))      'clear screen
  bs2.pause(100)
  serial.tx(13)
    
  Serial.str(String("ac80"))      'home
  bs2.pause(100)
  serial.tx(13)
  Serial.str(String("ac0c"))      'cursor off
  bs2.pause(100)
  serial.tx(13)
  
  Serial.str(String("adLoading"))  'print loading
  serial.tx(13)
  bs2.pause(1000)
  Serial.str(String("ac01"))   'return home
  bs2.pause(100)               
  serial.tx(13)
  repeat
  
    Serial.str(String("ac80"))
    serial.tx(13)
    Serial.str(String("ad"))      '1.line
    serial.dec(irtemp)
    serial.tx(13)
    Serial.str(String("acc0")) 
    serial.tx(13)
    Serial.str(String("ad"))          '2.line
    serial.dec(tester) 
    serial.tx(13)

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2010-01-29 12:51
    This program only shows that the COG which should read the sensor stops, not that the whole propeller stops. Put your tester variable into the Lcd-code and you will see if it's the whole propeller.

    My guess is that the mlx.GetTempC never returns. Maybe you should power on the MLX before calling the mlx.start. Maybe start is doing some initialization of the MLX.
Sign In or Register to comment.