gauge motor

hello i have this gauge from bus and i want to fix for my car with lm35 but i want to choose the range of this like foto from start to stop position i try to fix but never start and stop at the position i want. can help anyone to start this project?? i try to do with arduino uno only but nothing i try with L293D but againe nothing the start and stop at minimum and maximun range only i want to fix to start and stop only at range i want with first time run programm to check at this range and them i fix to work with LM35 thanks a lot.

the motor is bipolar but i read to use only the 2 wires not 4 but againe i dont fink something

Might want to look here.

He has the code posted on his blog which might give you some hints.

all the code i try no one work well with the position i want. all the code work like on-off the motor leftmost and right only pls help

Hi, what is your electronics, programming, arduino, hardware experience?

What are the numbers on the side of the motor?

Tom..... :slight_smile:

TomGeorge:
Hi, what is your electronics, programming, arduino, hardware experience?

What are the numbers on the side of the motor?

Tom..... :slight_smile:

my experience from arduino is to low this is the third project i buy i book to lern but i pay 30euro to lern the blink and to how to connect lcd pffff so sad. the numbers of side motor i fink is the type but i search at google but nothing. THK700 and 278815

only with this http://grobotronics.com/images/detailed/5/1438top_LRG.jpg i find some code but i dont have this Shield i borrowed from me friend and at my country they dont have and with capitals control they dont let me buy from athores country or ebay and i try to fix with only arduino or with l293d but nothing.

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61); 

// Select which 'port' M1, M2, M3 or M4. In this case, M1
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// You can also make another motor on port M2
//Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Adafruit Motorshield v2 - DC Motor test!");

  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin(1000);  // OR with a different frequency, say 1KHz
  
  // Set the speed to start, from 0 (off) to 255 (max speed)
  myMotor->setSpeed(150);
  myMotor->run(FORWARD);
  // turn on motor
  myMotor->run(RELEASE);
}

void loop() {
  uint8_t i;
  
  Serial.print("tick");

  myMotor->run(FORWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  
  Serial.print("tock");

  myMotor->run(BACKWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    myMotor->setSpeed(i);  
    delay(10);
  }

  Serial.print("tech");
  myMotor->run(RELEASE);
  delay(1000);
}

this code work i try to fix to work with out shield but nothing i fink the code i need is this to fix the range of needle is this some of code the 255 is the range of needle

 myMotor->run(FORWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);

i dont know how to fix to work alone with arduino uno.

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Have you identified which terminals on the gauge are the windings?

Tom..... :slight_smile:

i dont have circuit i just connect the 1 and 4 pins from motor to arduino 3-5 pins .
i try to find the pins but at internet i dont fink and i give 5v at pins and i see
if i get Vcc at 4 pin of motor and 1 GND the needle go forward and if i connect the 2 pin from motor at Vcc and 3 at GND the needle go back only this i find fro my motor and at arduino i connect the 4 and 1 pin from motor to 3 and 5 pins to arduino. my friend say this motor is brush and me i fink is bipolar... what do you think you???