الوصف
طريقة التوصيل
- مخرج الأرضي في الأردوينو –> مخرج السالب (-) في الحساس
- مخرج +5V في الأردوينو –> مخرج الموجب (+) في الحساس
- أي مخرج تناظري و ليكن A0 –> مخرج AO في الحساس
- مخرج DO غير مستخدم في حالة المثال التالي
برنامج التشغيل
// Sensor Keyes KY024 (chip ss49E)
// Type: Analog
// External Libraries: no
// Magnetic field sensor analog HALL effect
// ------------------------------------------------ -------------------------
// References:
// Http://www.sensorwiki.org/doku.php/sensors/hall_effect
// Http://dscl.lcsr.jhu.edu/main/images/3/31/SS49e_Hall_Sensor_Datasheet.pdf
// ------------------------------------------------ -------------------------
// Supply 5V
// Connections Arduino
// V = 5V
// G = mass
// S = A0
//
// The typical sensitivity is 1.8mV = 1G - (1024 steps) so 5V 1 step = 2.713G
// 5/1024 / 0.0018
// The sensor manufactured by Honeywell, however, declares 1.4mV per step
const int SIGPIN = A0;
const float GAUSS_PER_STEP = 2,713;
float rawValue = 0.0;
float value = 0.0;
zeroLevel float = 537.0;
void setup () {
Serial.begin (9600);
pinMode (SIGPIN, INPUT);
Serial.println ("KY024 - Linear Hall Sensor - Test program.");
}
void loop () {
rawValue = analogRead (SIGPIN) - zeroLevel;
Serial.print ("Read Raw");
Serial.println (rawValue);
// Reading positive relative to the South Pole, the North Pole negative
value = rawValue * GAUSS_PER_STEP;
// Serial.print ("Reading Calibrated in Gauss:");
// Serial.println (value);
delay (1000);
}
يسمح فقط بالعملاء الذين إشتروا هذا المنتج وسجلوا دخولهم بكتابة رأيهم.
التقييمات
لا يوجد تقييمات حالياً.