{"id":871,"date":"2023-01-21T22:16:39","date_gmt":"2023-01-22T06:16:39","guid":{"rendered":"https:\/\/unixwizardry.com\/?p=871"},"modified":"2024-03-20T17:38:59","modified_gmt":"2024-03-21T00:38:59","slug":"metone-windvane-testing-the-mlx90316-angle-sensor-part-deux","status":"publish","type":"post","link":"https:\/\/unixwizardry.com\/index.php\/2023\/01\/21\/metone-windvane-testing-the-mlx90316-angle-sensor-part-deux\/","title":{"rendered":"MetOne Windvane: Testing the MLX90316 angle sensor &#8211; Part Deux"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"871\" class=\"elementor elementor-871\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-36c7e3a3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"36c7e3a3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6de74953\" data-id=\"6de74953\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-43726fd9 elementor-widget elementor-widget-text-editor\" data-id=\"43726fd9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>During testing the wind vane pot replacement, I was getting some weird results.\u00a0 I was getting errors like NO SPI DEVICE FOUND, weak magnetic field, and generally not being reliable.\u00a0 Part of the problem was a solder bridge between pins 2 and 3 on the MLX90316 PCB (J1) header and it so happens that pin 2 goes to ground when the anemometer reed switch closes it messes up (technical term \ud83d\ude42 ) the SS (slave select) signal from the MCU.\u00a0 No wonder I was getting <strong>NO SPI DEVICE FOUND<\/strong>!\u00a0 Removing the solder bridge should fix a lot of the errors I was getting.\u00a0 Also, after making the height of the magnet adjustable above the sensor, no more complaints about weak magnetic field.\u00a0 I still need to see if the MLX90316 works reliably using an 8-12&#8242; cable between it and the Wemos D1Mini.\u00a0<\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-medium wp-image-884 alignleft\" src=\"https:\/\/unixwizardry.com\/wp-content\/uploads\/2023\/01\/IMG_3185-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/unixwizardry.com\/wp-content\/uploads\/2023\/01\/IMG_3185-225x300.jpg 225w, https:\/\/unixwizardry.com\/wp-content\/uploads\/2023\/01\/IMG_3185-230x307.jpg 230w, https:\/\/unixwizardry.com\/wp-content\/uploads\/2023\/01\/IMG_3185-350x467.jpg 350w, https:\/\/unixwizardry.com\/wp-content\/uploads\/2023\/01\/IMG_3185-rotated.jpg 480w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/p><p>I found this out by using a LOT shorter wires to the test jig since it DID work fine with the sensor on the breadboard.\u00a0 The only other difference was using 100nF bypass capacitors (specified on the Melexis PDF) instead of 10nF I had mistakenly used earlier.\u00a0<\/p><p><span style=\"color: var(--sydney-text-color);\">This, then is the output from my WindSubsystemTest code using the PlatformIO VSCode extension:<\/span><\/p><p><i><span style=\"color: var(--sydney-text-color);\">Starting MetOne 034B Wind Subsystem Test.<\/span><br \/><\/i><\/p><p><i>pulseCount: 0 revCount: 0 rps: 0 rpm: 0 miles\/hour: 0<\/i><\/p><p><strong><i>No SPI signal or MLX angle sensor not found&#8230;<\/i><\/strong><\/p><p><i><br \/>pulseCount: 1\u00a0 \u00a0 \u00a0 revCount: 0 rps: 0\u00a0 \u00a0 rpm: 0\u00a0 \u00a0 \u00a0MPH: 0<br \/>Heading: 65 Card: NNE<br \/>pulseCount: 4\u00a0 \u00a0 \u00a0revCount: 2 rps: 0\u00a0 \u00a0 rpm: 0\u00a0 \u00a0 \u00a0 MPH: 0<br \/>Heading: 49 Card: NNE<br \/>pulseCount: 75\u00a0 \u00a0revCount: 37 rps: 7\u00a0 \u00a0rpm: 420\u00a0 \u00a0MPH: 26<br \/>Heading: 39 Card: NNE<br \/>pulseCount: 22\u00a0 revCount: 11 rps: 2\u00a0 \u00a0rpm: 120\u00a0 \u00a0MPH: 8<br \/>Heading: 49 Card: NNE<br \/>pulseCount: 64\u00a0 revCount: 32 rps: 6\u00a0 \u00a0rpm: 360\u00a0 \u00a0MPH: 22<br \/>Heading: 57 Card: NNE<br \/>pulseCount: 52\u00a0 revCount: 26 rps: 5\u00a0 \u00a0rpm: 300\u00a0 \u00a0MPH: 18<br \/>Heading: 57 Card: NNE<br \/>pulseCount: 26\u00a0 revCount: 13 rps: 2\u00a0 \u00a0rpm: 120\u00a0 \u00a0MPH: 8<br \/>Heading: 68 Card: NNE<\/i><\/p><p>I connected the 034B sensor board to the test breadboard with the D1Mini via the 12&#8242; ethernet cable and it does work a LOT better; I&#8217;m getting spurious &#8220;magnetic field too weak&#8221; and SPI issues, and that might be the cable.\u00a0 I don&#8217;t really need 12&#8242; distance to the D1Mini anyway.\u00a0 (I don&#8217;t think.)\u00a0 \u00a0Next to do: fix the cardinal direction, since it always shows &#8220;NNE&#8221; and make sure the wind speed is accurate and I&#8217;m not getting a bunch of reed switch contact bounces.<\/p><p>Starting MetOne 034B Wind Subsystem Test.<br \/>pulseCount: 0 revCount: 0 rps: 0 rpm: 0 MPH: 0<\/p><p><strong>No SPI signal or MLX angle sensor not found&#8230;\u00a0 (This one is pretty normal on startup)<\/strong><br \/>pulseCount: 1 revCount: 0 rps: 0 rpm: 0 MPH: 0<br \/>Heading: 331 Card: NNE<br \/>pulseCount: 18 revCount: 9 rps: 1 rpm: 60 MPH: 4<br \/>Heading: 311 Card: NNE<br \/>pulseCount: 25 revCount: 12 rps: 2 rpm: 120 MPH: 8<br \/>Heading: 311 Card: NNE<br \/>pulseCount: 18 revCount: 9 rps: 1 rpm: 60 MPH: 4<br \/><strong>Magnetic field too weak<\/strong><br \/>pulseCount: 18 revCount: 9 rps: 1 rpm: 60 MPH: 4<br \/><strong>Magnetic field too weak<\/strong><br \/>pulseCount: 18 revCount: 9 rps: 1 rpm: 60 MPH: 4<br \/>Heading: 218 Card: NNE<\/p><p><strong style=\"color: var(--sydney-text-color);\">No SPI signal or MLX angle sensor not found&#8230;\u00a0 (not normal)<\/strong><\/p><p>pulseCount: 0 revCount: 0 rps: 0 rpm: 0 MPH: 0<\/p><p><strong>No SPI signal or MLX angle sensor not found&#8230;<\/strong><br \/>pulseCount: 0 revCount: 0 rps: 0 rpm: 0 MPH: 0<\/p><p><strong>No SPI signal or MLX angle sensor not found&#8230;<\/strong><br \/>pulseCount: 0 revCount: 0 rps: 0 rpm: 0 MPH: 0<\/p><p><strong>No SPI signal or MLX angle sensor not found&#8230;<\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>During testing the wind vane pot replacement, I was getting some weird results.\u00a0 I was getting errors like NO SPI DEVICE FOUND, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40,41],"tags":[],"class_list":["post-871","post","type-post","status-publish","format-standard","hentry","category-electronics","category-kicad"],"_links":{"self":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts\/871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/comments?post=871"}],"version-history":[{"count":25,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts\/871\/revisions"}],"predecessor-version":[{"id":1275,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/posts\/871\/revisions\/1275"}],"wp:attachment":[{"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/media?parent=871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/categories?post=871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unixwizardry.com\/index.php\/wp-json\/wp\/v2\/tags?post=871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}