<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MAG3110 erroneous reading in Sensors</title>
    <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620958#M3822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We had tried interfacing the 2 MAG3110 boards with both Raspberry Pi-3 board and CC1110&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1:- MAG3110 interface with raspberry Pi using I2C protocol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The code for Raspberry PI-3 board is attached as "mag3110.py"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2:- MAG3110 interface with CC1110 using Bit banging method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Our main intention to interface the MAG3110 sensor is with the TI's CC1110&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Due to erroneous sensor reading we did some filtering to the raw output of the MAG3110 sensor in the code to get stable reading . The filtered process implemented in the code is as follows:-&lt;/P&gt;&lt;P&gt;1. Exponential average of raw sensor data&lt;/P&gt;&lt;P&gt;2. Difference between the raw and exponential average&lt;/P&gt;&lt;P&gt;3. Squaring the difference&lt;/P&gt;&lt;P&gt;4. Quadratic mean of the Squared Output&lt;/P&gt;&lt;P&gt;The main idea behind the filtering is to detect the drastic change in the earths magnetic field due to presence of the vehicle and make the readings from the sensor raw data with less difference to zero&lt;/P&gt;&lt;P&gt;The code for the CC1110 is attached as "CC1110_MAG3110 code"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Fakhruddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Apr 2017 10:48:12 GMT</pubDate>
    <dc:creator>fakhruddinkhan</dc:creator>
    <dc:date>2017-04-04T10:48:12Z</dc:date>
    <item>
      <title>MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620952#M3816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are using MAG3110 sensor for parking occupancy detection application. We are getting varying results even when the sensor is placed in fixed position and there is no moving objects around the sensor (Please find attached file).&lt;/P&gt;&lt;P&gt;Our configuration is as follows:&lt;/P&gt;&lt;P&gt;CTRL_REG2 = 0x80&lt;/P&gt;&lt;P&gt;CTRL_REG1 = 0x01&lt;/P&gt;&lt;P&gt;I am reading in while loop during interrupt from MAG3110&lt;/P&gt;&lt;P&gt;Please suggest any method to get the stable reading , since our application is to detect a vehicle whenever the vehicle is over the sensor.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338820" target="_blank"&gt;MAG3110Logs.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2026 21:58:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620952#M3816</guid>
      <dc:creator>fakhruddinkhan</dc:creator>
      <dc:date>2026-02-03T21:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620953#M3817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fakhruddin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is hard to say where the problem might be. How many parts have you tested? Is this behavior same for all parts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend you taking a closer look at our &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-330484"&gt;example project&lt;/A&gt; and &lt;A href="https://blog.nxp.com/tech-in-depth/how-to-detect-vehicle-presence-or-movements-with-magnetometers-part-2"&gt;this&lt;/A&gt; blog post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Tomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Mar 2017 11:56:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620953#M3817</guid>
      <dc:creator>TomasVaverka</dc:creator>
      <dc:date>2017-03-30T11:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620954#M3818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fakhruddin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataset you provided is very strange, I&amp;nbsp;can't&amp;nbsp;really trust it's comming from our MAG3110 device.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/16376i71A8F29D9AE8293A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here my suggestions/questions/feedback/concerns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regarding your data:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You may have a defective part. Did you test several MAG3110 or only one?&lt;/LI&gt;&lt;LI&gt;Are you sure to well convert the data from the MAG3110 in signed format? The noise scale is unbelivable. I think it is the best track for solution.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regarding your application:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Try to use the raw mode&lt;BR /&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/16448iDE856B66C6F2A784/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;Regarding your application, I'm not sure a 80 Hz datarate well adapted. I may use a lower ODR with a big OSR to reduce the noise comming from the environnement&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/16537iDBED61AB860AE3B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Let me know if it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 12:47:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620954#M3818</guid>
      <dc:creator>anthonyduhamel</dc:creator>
      <dc:date>2017-03-31T12:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620955#M3819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. As per your suggestion I will check and let you know shortly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Fakhruddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 13:16:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620955#M3819</guid>
      <dc:creator>fakhruddinkhan</dc:creator>
      <dc:date>2017-04-03T13:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620956#M3820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have purchased 2 MAG3110 boards from Ebay and initially we had tried interfacing the MAG3110 boards with the CC1110&amp;nbsp;directly using bit banging method and we got the readings we had shared with you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now we have interface the MAG3110 boards with the Raspberry Pi-3 using I2C peripheral and we are getting the results attached .&lt;/P&gt;&lt;P&gt;Since you have mentioned about defective piece how can we come to know whether the MAG3110 is defective or not?&lt;/P&gt;&lt;P&gt;Please reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Fakhruddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 15:11:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620956#M3820</guid>
      <dc:creator>fakhruddinkhan</dc:creator>
      <dc:date>2017-04-03T15:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620957#M3821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Fakhruddin,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;You didn't get correclty the magnetic data from the sensor to your raspberry. If you plot your data in a chart, you can see the curve shape is similar on the three axis (not same scale/offset but same tendencies):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/16129i1ED24D89D8DFD26A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/16171i03CA5E8B622BFF51/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;So you really need to check how you communicate with the MAG3110 &amp;nbsp;(are you sure to read the right registers?) and how do you convert it. If you need more support, please share your code and the I²C frame screenshots. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I don't think it's a defective part issue there, but i&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;f you want a trust supplier for a mag3110 evaluation board, I suggest you to try the &lt;A href="http://www.nxp.com/products/sensors/sensor-toolbox-sensor-development-ecosystem/evaluation-boards/sensor-toolbox-development-platform-for-mma8652-fxas21002-and-mag3110-9-axis-solution:AGM04-SOLUTION?lang_cd=en"&gt;BRKT-STBC-AGM01 &lt;/A&gt;, you can buy it on NXP website.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Anthony&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2017 15:49:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620957#M3821</guid>
      <dc:creator>anthonyduhamel</dc:creator>
      <dc:date>2017-04-03T15:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620958#M3822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We had tried interfacing the 2 MAG3110 boards with both Raspberry Pi-3 board and CC1110&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1:- MAG3110 interface with raspberry Pi using I2C protocol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The code for Raspberry PI-3 board is attached as "mag3110.py"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2:- MAG3110 interface with CC1110 using Bit banging method&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Our main intention to interface the MAG3110 sensor is with the TI's CC1110&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Due to erroneous sensor reading we did some filtering to the raw output of the MAG3110 sensor in the code to get stable reading . The filtered process implemented in the code is as follows:-&lt;/P&gt;&lt;P&gt;1. Exponential average of raw sensor data&lt;/P&gt;&lt;P&gt;2. Difference between the raw and exponential average&lt;/P&gt;&lt;P&gt;3. Squaring the difference&lt;/P&gt;&lt;P&gt;4. Quadratic mean of the Squared Output&lt;/P&gt;&lt;P&gt;The main idea behind the filtering is to detect the drastic change in the earths magnetic field due to presence of the vehicle and make the readings from the sensor raw data with less difference to zero&lt;/P&gt;&lt;P&gt;The code for the CC1110 is attached as "CC1110_MAG3110 code"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Fakhruddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 10:48:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620958#M3822</guid>
      <dc:creator>fakhruddinkhan</dc:creator>
      <dc:date>2017-04-04T10:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: MAG3110 erroneous reading</title>
      <link>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620959#M3823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you get the codes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Fakhruddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 06:52:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Sensors/MAG3110-erroneous-reading/m-p/620959#M3823</guid>
      <dc:creator>fakhruddinkhan</dc:creator>
      <dc:date>2017-04-06T06:52:08Z</dc:date>
    </item>
  </channel>
</rss>

