This is the development sandbox for the DRV425EVM and its magnetic sensing.

Dependencies:   mbed

/media/uploads/Krabby127/ohmboyzvectorized.png

Repository for the 2015 OhmBoyZ Capstone group.

Revision:
11:791839389530
Parent:
10:3f9fbc127abb
Child:
12:b9d71de8733d
--- a/main.cpp	Tue Dec 01 19:04:29 2015 +0000
+++ b/main.cpp	Tue Dec 01 19:25:17 2015 +0000
@@ -13,8 +13,9 @@
         meas = analog_value.read(); // Converts and read the analog input value (value from 0.0 to 1.0)
         meas = meas * 3300; // Change the value to be in the 0 to 3300 range (currently to mV)
         printf("meas = %fmV\n\r",meas); // Print out raw measurement in terms of mV
-        b=((meas-(3.3/2.0*1000))/(4.0*12.2*100.0)); // Based on equation 1
+        b=(((meas-(3.3/2.0*1000))/1000)/(4.0*12.2*100.0)); // Based on equation 1 from DRV425EVM pdf
         //VVOUT [V] = B × G × RSHUNT × GAMP = B [mT] × 12.2 mA/mT × RSHUNT [Ω] × 4 [V/V]
+        //VVOUT is with reference to REFIN
         //0 Tesla is VDD/2
         // 12.2 mA/mT
         printf("b = %f Gauss\n\r",b); // Print out b field measure in milliTesla