SparkFun Electronics Commentsurn:uuid:214d0e4e-f1b1-d287-ce26-ac5b4c9f82492024-03-29T08:32:55-06:00SparkFun ElectronicsMaarten. on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRMaarten.urn:uuid:a9968635-3eab-8b1e-0f14-5f738132d1762014-07-23T10:12:07-06:00<p>It is worse than I thought, didn't realise it took longer then 9999 micros, infact it takes over 3 ms. Is there something I'm overlooking here?<pre><code>#include <Wire.h>
#include <LSM303.h>
LSM303 compass;
void setup() {
Serial.begin(115200);
Wire.begin();
compass.init();
compass.enableDefault();
compass.m_min = (LSM303::vector<int16_t>){-32767, -32767, -32767};
compass.m_max = (LSM303::vector<int16_t>){+32767, +32767, +32767};
}
void loop() {
unsigned long startTimeMicros = 0;
unsigned long startTimeMillis = 0;
unsigned long endTimeMicros = 0;
unsigned long endTimeMillis = 0;
startTimeMillis = millis();
startTimeMicros = micros();
compass.read(); // 2 millis, 1900 micros
float heading = compass.heading(); // 1 millis, 900 micros
endTimeMicros = micros()-startTimeMicros;
endTimeMillis = millis()-startTimeMillis;
Serial.print(endTimeMillis);
Serial.print(" millis, ");
Serial.print(endTimeMicros);
Serial.print(" micros, heading: ");
Serial.println(heading);
delay(500);
}
</code></pre></p>
Maarten. on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRMaarten.urn:uuid:d38139a9-4a66-d9e9-2fe0-7aaef99ecd3c2014-07-22T14:30:57-06:00<p>(edited, correction)<p>Hi, I'm using the arduino uno v3 with both the LSM303DLMTR and HMC5883L (seperately). With both I've got performance issues. When I readout the LSM303 it's taking over 3 ms to do so.</p><p>The rest of my code (not very small), is only taking up 80 microseconds. The high latency is causing problems for serial port communication.</p><p>Is this normal?</p></p>
Toni_K on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRToni_Kurn:uuid:9e5086c8-bda3-3684-c9b8-58df685522072014-06-23T10:32:45-06:00<p>The IC was actually retired by the manufacturer. Though we are working on the new replacement IC currently so there should be a new board coming out soon that's comparable.</p>
Dylan Moore on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRDylan Mooreurn:uuid:ed25ac42-c9f4-c2af-e22c-0b98920d36782014-06-22T13:45:36-06:00<p>Any clue as to why this guy was retired? Not only did I get one working straight out of the red box, but it's been a champ. I came back for more, but alas, it looks like it's collecting social security and living in Florida.<p>The rest of the IMU's / 6 DOF's look like they have some bogus proprietary library nonsense, are a bit pricy, and no one in the comments seems particularly happy with the parts. Any recommendations?</p></p>
Customer #382010 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #382010urn:uuid:c8e3ff30-306f-29e9-8795-7d2eadcf90582014-05-22T13:56:44-06:00<p>Mine was a bad board/solder. Sparkfun sent a new one and it didn't have the problem. You might want to contact support.</p>
Customer #553240 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #553240urn:uuid:ec5ee32b-86a4-d95c-4bec-17867f1625362014-05-22T12:04:20-06:00<p>I have a similar issue. When running the calibration code, I always end up with -4096 as my x-min. Does anyone know why this is?</p>
Shpoople on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRShpoopleurn:uuid:67d622ae-bec5-836f-aadc-7f794dfc1e572014-02-27T18:48:29-07:00<p>I believe that the regulator is a MIC5205 LDO, which from my experience continues to operate down to 3.1 volts... (It stopped working soon after I measured the source Lipo battery at 3.12 volts)</p>
Customer #382010 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #382010urn:uuid:fc3b9285-e545-77f2-ea03-5126408738a62014-01-03T19:04:26-07:00<p>After following the great tutorial below, I have this mostly working. But it seems like the Y axis is not working correctly.<p>I've run this several times to calibrate the MIN and MAX settings. The problem is that Y always reports -4096 for both MIN and MAX values.
min: { -4096, -4096, -507} max: { +424, -4096, +518}</p><p>As a result, the heading doesn't work correctly. Could this be the module or the library? Has anyone else had this problem?</p><p>Thanks in advance</p></p>
josemiguelvelasco on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRjosemiguelvelascourn:uuid:114718cf-8761-2980-edcb-e7672c122dc72013-08-26T01:24:00-06:00<p>Thanks</p>
Toni_K on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRToni_Kurn:uuid:c76510fa-0a2d-440b-c995-6261b7814a862013-08-25T12:38:15-06:00<p>Our tech support team has been very busy with students returning to school, but they should get back to you by Monday or Tuesday.</p>
josemiguelvelasco on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRjosemiguelvelascourn:uuid:0cace1be-d9ca-6f4f-e939-07173d3f55502013-08-24T01:06:00-06:00<p>I have sent an e-mail to that address explaining the problem 24 hours ago and haven't received any reply yet</p>
RobertC. on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRRobertC.urn:uuid:d78e7b10-a2d7-9bd6-5ac9-de0aa1dc2ea72013-08-22T15:50:57-06:00<p>please contact techsupport@sparkfun.com</p>
josemiguelvelasco on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRjosemiguelvelascourn:uuid:2fec45dd-ac8c-bd06-9966-5e30a30fed2f2013-08-22T15:20:49-06:00<p>Hello
I bought an LSM303DLM digital compass, and have wired it to an Arduino Uno according to the video tutorial below, but I can't see any reading on the Serial Monitor. According to the traces I have put in the program, it keeps waiting unendlessly when the read function is called.
Is it possible to make a check to the LSM303 module so that I can see if the module is damaged?
Can I do anything else to fix the problem?
Thanks</p>
Customer #443538 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #443538urn:uuid:09998772-3f03-16d1-46b8-b38ee1ad72a32013-06-03T23:33:28-06:00<p>It doesn't work in magnetometer (bad specification I2C no ACK of chip) same with the level translator
It work in accelerometer</p>
Customer #230104 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #230104urn:uuid:b2a9a3ce-d83b-94fe-cd86-b8cb5e8b671e2013-05-22T15:08:09-06:00<p>hey. crazy question on this. everything i've seen said that having a magnetic field nearby can interfere with the accuracy. What if i wanted to imbed a magnet (say a small/medium rare earth) and use this device to always reference towards that magnet? the furthest the magnet would be is about 30" to 40" from the sensor, would it still detect? How would you determine the size of magnet for distance to override the earth's pole?</p>
sentryGun53 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRsentryGun53urn:uuid:3000ed80-6a53-8dfa-9b8d-b014630537662013-04-14T14:57:14-06:00<p>Took me a bit to find some good references for this board, here's what I found:<p><a href="https://github.com/pololu/LSM303" rel="nofollow">Library for Arduino</a> - works great with this module</p><p><a href="http://www.youtube.com/watch?v=h7gElYWgt0k" rel="nofollow">Video tutorial on calibrating the module</a> - uses the above library</p><p><strong>Another note:</strong> I'm using this to replace the <a href="https://www.sparkfun.com/products/7915" rel="nofollow">HMC6352</a>, which is not tilt-compensated. The HMC6352 had a nice north-indicator arrow screenprinted onto the PCB, but this LMS303 board lacks that indicator.... So, to draw it on yourself: hold the board flat in front of you, with the chip on top, and rotate the board until the "SA0" marking is properly readable to you. The north-reference arrow should be drawn to point exactly towards the right-hand edge of the board.</p><p>Hope that helps somebody else using this board!</p></p>
Kamiquasi on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRKamiquasiurn:uuid:f655c6cc-78d2-53da-5d12-5965dc8db7852013-04-12T14:26:45-06:00<p>Seems Member #136942 also pointed this out, 2 months ago. I would think that you can still make the board word by bypassing the 3.3V regulator as suggested by them as well.<p>With the world increasingly moving to 3.3V - if not lower - I do agree it would be nice if all products would have their operating voltage clearly noted, perhaps as the top-most bullet point.</p></p>
Customer #216992 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #216992urn:uuid:797a740c-44b4-27fb-ce0c-0dd824fc6b562013-04-12T13:40:41-06:00<p>Maybe you should note in the description this is working on 5v not 3.3v<p>It's very frustrating when you realize by yourself after purchasing.</p></p>
Toni_K on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRToni_Kurn:uuid:82ac0810-3f05-35ba-7e8b-9e3862826be12013-02-25T10:53:50-07:00<p>The lack of screw holes was intentional to keep the size of the board as minimal as possible. This is an argument that occurs for almost every sensor breakout we make as to whether screw holes would add to the board, or if the additional size would be a negative feature. Generally though, a little bit of Velcro can work wonders for applications where you need the sensor mounted.</p>
Customer #136942 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #136942urn:uuid:27c3668b-554a-7759-2303-4815b53b49ef2013-02-23T20:23:02-07:00<p>I'm looking at using this module with the Raspberry Pi. Since the Rpi uses 3.3v and this module appears to need 5v (based on the 3.3v LDO regulator usage), I'm wondering if I need to worry about this for the i2c interface. I know these are open drain lines, but since this board has pull-ups to VIN, will that cause problems?<p>I'd rather not use level shifters if at all possible. If the differing levels would be a problem, I'm thinking I could either bypass the 3.3v regulator and power it with the 3.3v from the rpi (thus making VIN now 3.3v). Or, maybe the easiest thing would be to remove the 4.7k pull-ups on this board. Since the Rpi already has pull-ups, would this work?</p></p>
Customer #124781 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #124781urn:uuid:3f263490-c64e-64be-6eea-465b55b956192013-01-26T12:58:22-07:00<p>Does this have level shifters on it so that it is compatible with 5v logic?</p>
ChTacklind on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRChTacklindurn:uuid:b6ff2c2c-be18-b78f-c9ea-92cd4bd05ec02013-01-04T17:23:34-07:00<p>Whew! Found some very nice code at https://github.com/pololu/LSM303/tree/master/LSM303. The first example works well. They also have calibration routines.</p>
ChTacklind on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRChTacklindurn:uuid:9ea68507-a6b8-27a0-c2ae-1d22d7a38ffa2013-01-04T12:32:20-07:00<p>Where is the latest updated example code for this board?</p>
brianb000 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRbrianb000urn:uuid:32af044f-9618-e9d9-0072-61b030283b802012-09-19T23:10:18-06:00<p>Hi Sparkfun Team,
Your sample code, in the procedure getAccel, shifts the axis I suppose to make the compass work, but the result is the magnetometer and accelerometer are no longer aligned, at least that is what my measurements show. Additionally the compass works, but only with the chip aligned vertically. Your code even states this in a comment:
//rawValues[ZM] = ((int)LSM303_read(OUT_X_L_A) COMMENT --->>> // had to swap those to right the data with the proper axis<p>I have checked all the register assignment values and they all look correct. What is it about the unit that made you decide to rotate the axis assignments ?
Thanks.</p></p>
Levi on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRLeviurn:uuid:dc41bd0e-38b8-c77e-0838-36dc074822442012-08-13T10:14:12-06:00<p>Is this pin compatible with the LSM303DLH?</p>
Lefty4000 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRLefty4000urn:uuid:386f36a5-ce11-6e23-2bbe-4e8110c1b8f22012-08-01T11:10:42-06:00<p>This man has a very good point! Whats the point of using a tilt compass if you can't keep it from...tilting.</p>
Customer #341600 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRCustomer #341600urn:uuid:510b3607-6b3b-e3f8-f861-8fd4b781859c2012-07-29T04:40:00-06:00<p>I'm new to all this and was wandering what is the best way to get tilt-compensated output data of this to the PC via USB and what is the update rate? Can I use an Arduino Pico? Thanks again!</p>
chipaudette on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRchipaudetteurn:uuid:f8c2bec6-86c8-25a8-7db5-d5c4839200fe2012-07-27T10:15:41-06:00<p>No screw holes?! So sad. It could be a great device, but the lack of screw holes makes it needlessly difficult to integrate with one's project.</p>
Bangwaiter on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRBangwaiterurn:uuid:a11186e0-2ee7-6cfb-316e-ded928bfb3752012-07-23T16:54:44-06:00<p>It would be nice if there was a video comparing the LSM303DLH (old one) with this one, especially the issues with noise, which were quite significant even after calibration on the old one, sometimes it could not even get the right world side (eg. pointing it to the south would sometimes result in reading of east). I heard it was caused by the accelerometer, is there any comparsion in the means of specifications?</p>
Sora62896 on SEN-10888 - Tilt Compensated Compass Breakout - LSM303DLMTRSora62896urn:uuid:93b5c9e9-9c2d-93f4-002c-7a64f1c318f12012-07-23T11:29:31-06:00<p>I just bought the HMC6352......this one would have helped......</p>