Shop OBEX P1 Docs P2 Docs Learn Events
How to program: MLX90614 Infrared Thermometer Module — Parallax Forums

How to program: MLX90614 Infrared Thermometer Module

HNguyenHNguyen Posts: 1
edited 2010-01-15 20:58 in Accessories
I recently purchased the MLX90614 Infrared Thermometer Module (90* FOV) and am not sure how to communicate with the senor. I've read the specifications and understand the commands but I'm not sure how to send it to the module so that I can use it.

What I know:
- Module can sent and receive serial data.
- Module can have a set trigger temperature (temperature at which the alarm pin will go high)
- Other features, but none that I am concerned with for what I plan on using the senor for.

What I don't know:
- How to send the serial commands to the module, through the SIG pin using a C or C++ compiler.

What I want the module to do exactly is to have a set temperature, for example 30*C, and if the temperature passes 30*C the alarm pin will go high. I know that the command to do this is "!TEMA" and that the there is an example program included for the senor that does exactly what I need. The issue is that everything seems to be using BASIC Stamp.

My current setup I am using for this project is a MC9S12DG256 microprocessor on a Dragon12 board with Code Warrior. I've done some reading on how to send serial information with C / C++ but aren't exactly sure how to send the data to the single SIG pin.

From my best guess I would think it would be something like,
DDRA_BIT0 = 0xFF;
<C command> PORTA_BIT0, <baudrate>, [noparse][[/noparse]0, "!TEMA", slaveddr, alarmlowbyte, alarmhighbyte]




I was wondering if anyone knew the C command or could suggest a library with the same functionality. I've found a few but aren't quite sure how to use them. If not, could anyone who has also purchased this senor please tell me what they used and how they got it to work. Any information would be very helpful.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-15 20:58
    We can't help you with the programming on the microprocessor side. As you've noticed, there are examples available for the microprocessors that Parallax sells and supports. The MLX90614 sends and receives standard asynchronous serial data at a variety of speeds. Sending and receiving serial data on the same I/O pin often depends on details of how the microprocessor handles serial data. You'll just have to do some research on this on the support forums and in the documentation provided with your microprocessor.
Sign In or Register to comment.