Arduino Tutorials – பாடம் 26 – Accelerometer sensor with servo motor control using Arduino UNO

Accelerometer sensor உடன் இணைக்க பட்ட Servo மோட்டாரை Arduino mega 2560 உதவியுடன் கட்டுப்படுத்துவது. 

Required Components

  1. Accelerometer sensor (MPU 6050) -1 no
  2. Arduino UNO board -1 no
  3. Jumper cable -4 no
  4. Servo motor -1 no

Circuit

Steps

  1. நாம் பயன்படுத்தும் உபகரணங்கள் சரியாக வேலை செய்கிறதா என்பதை உறுதி செய்து கொள்ளவும்.
  2. Accelerometer sensorல் உள்ள SDA மற்றும் SCL பின்களை Arduino வில் உள்ள SDA மற்றும் SCL பின்களுடன் இணைக்க வேண்டும்.
  3. Arduinoன் +5V மற்றும் ground சப்ளையை servo மோட்டார் மற்றும் Accelerometer sensor உடன் இணைக்க வேண்டும்.
  4. Servo மோட்டார் மற்றும் Accelerometer Sensor ஐ Bread board உடன் இணைக்க வேண்டும்.
  5. Servo மோட்டார் டேட்டா பின்னை Arduino mega 2560 வின் 2 வது pin உடன் இணைக்க வேண்டும்.
  6. Arduino program ஐ சரி பார்க்க வேண்டும்.
  7. மின்சுற்றை சரி பார்க்க வேண்டும்.
  8. Arduino program ஐ ரன் செய்ய வேண்டும்.

Arduino Program

#include <Wire.h>
#include <MPU6050.h>
#include <Servo.h>   
Servo sg90;          
int servo_pin = 2;
MPU6050 sensor ;
int16_t ax, ay, az ;
int16_t gx, gy, gz ;

void setup ()
{ 
  sg90.attach ( servo_pin );
  Wire.begin ( );
  Serial.begin  (9600); 
  Serial.println  ( "Initializing the sensor" ); 
  
  sensor.initialize ( ); 
  Serial.println (sensor.testConnection ( ) ? "Successfully Connected" : "Connection failed"); 
  delay (1000); 
  Serial.println ( "Taking Values from the sensor" );
  delay (1000);
}

void loop () 
{ 
  sensor.getMotion6 (&ax, &ay, &az, &gx, &gy, &gz);
  ax = map (ax, -17000, 17000, 0, 180) ;
  Serial.println (ax);
  sg90.write (ax); 
  delay (200);
}

Usage

  1. அலைபேசி (Mobile phones).
  2. ட்ரோன் நிழற்படக்கருவி உறுதிப்படுத்தல் (Drone camera stabilization).
  3. ரோட்டேட்டர் இயந்திரத்தில் உள்ள தவறுகளைக் கண்டறிய (To detect faults in rotator machine).
  4. இலக்கமுறை நிழற்படக்கருவியின் திரையில் செங்குத்தான நிலையில் காட்சி படிமம் காண (To display images in an upright position on screens of digital cameras).

Leave a Reply

Your email address will not be published. Required fields are marked *