Hey, hope ive chosen the correct form for my post, if not i apologise.
i am trying to control a small motor (from a hand fan) that normally runs from 2AA batteries, i am using a Toshiba ta7291p bridge driver with my uno trying to control the motor. What is happening when i enter the control to speed up/turn on the fan, the motor makes a very faint hight pitched sound but no movement, at times the chip heats up as well.
From what i understand on the datasheet the max amps its takes is 2, wondering maybe my amps are too high or maybe voltage too low ?
ive measured the fan to battery’s as 3 volt with round .6 amp, not too familiar with multi-meters so my settings could be off by loads ?
Be great if somebody could help, maybe its not possible with this motor if not any ideas on which one would be best (just using it for a fan) ?
here image of the set up and sketch
#include <string.h>
// Motor preparation. Motor driver using the TA7291.
int Pwm_pin = 3; // Connect the fourth of TA7291 to Digital3 number of arduino.
int MotorA_pin = 7; // Connect the 5th of TA7291 to Digital7 number of arduino.
int MotorB_pin = 8; // Connect the sixth of TA7291 in Digital8 number of arduino.
int motorpwm_val = 0; //the rotational force of the motor; 0-255.
char serialmessage [256]; // put the string to receive the serial communication array. Until the time being 256 characters.
char * splitserial [10]; // split array to store the string. For now up to eleven.
void setup () {
Serial.begin (115200);
// Set of motor pin
pinMode (MotorA_pin, OUTPUT);
pinMode (MotorB_pin, OUTPUT);
digitalWrite (MotorA_pin, HIGH);
digitalWrite (MotorB_pin, LOW);
analogWrite (Pwm_pin, 250);
}
void loop () {
Serial.print("motorpwm_val=");
Serial.println(motorpwm_val);
if (Serial.available ()) {
delay (10);
serial_to_char ();
splitchar (serialmessage, ",", splitserial);
if (splitserial [0] = "motor") {
motorpwm_val = atoi(splitserial[1]);
Serial.print ("motorpwm_val =");
Serial.println (motorpwm_val);
analogWrite (Pwm_pin, motorpwm_val);
}
}
if(Serial.available()){
delay(800);
serial_to_char();
splitchar(serialmessage,",",splitserial);
if(splitserial[0] = "motor"){
motorpwm_val = atoi(splitserial[1]);
Serial.print("motorpwm_val=");
Serial.println(motorpwm_val);
analogWrite(Pwm_pin,motorpwm_val);
}
}
}
void serial_to_char () {
memset (serialmessage, '\0', sizeof (serialmessage));
for (int i = 0; Serial.available (); i ++) {
serialmessage [i] = Serial.read ();
}
}
// Char string to split.
void splitchar( char *str, const char *delim, char *split[] ) {
char *splitpart;
splitpart = strtok( str, delim );
for( int i = 0;splitpart != NULL && i < 10 ;i++) {
split[i] = splitpart;
splitpart = strtok( NULL, delim );
}
}
Thanks again, any help would be appreciated, just starting with Arduino !