Show Posts
Pages: 1 [2]
16  Using Arduino / Motors, Mechanics, and Power / Re: stepper overheating after first spin and stays on current to pin 2 3 on: February 08, 2013, 07:31:02 pm
for those who still wonder :    stepper.freeMotor();
17  Using Arduino / Motors, Mechanics, and Power / Re: stepper overheating after first spin and stays on current to pin 2 3 on: April 15, 2011, 09:22:03 am
That is my idea also..I am thinking that I should turn all pins of arduino to  LOW state, after every loop.
Das Anyone know the command of setting pins to LOW from the Stepper library ?
I tried  motor_pin_1=0 motor_pin_2=0 ...etc  but compiller sent error as unknown item
18  Using Arduino / Motors, Mechanics, and Power / stepper overheating after first spin and stays on current to pin 2 3 on: April 15, 2011, 06:05:10 am
I am using stepper with the simple ,stepper_oneRevolution example.
I follow all instructions for connecting 4 wires stepper.
The only thing that i changed is delay ,so can measure voltage to pins.

Before the first spin ,all the voltages to pins of the arduino is 0 and the voltage of stepper wires is 12 volt. In this stage stepper is spining freely by hand and there is no resistance to my hand.Also it doesn't  heat at all

After the first spin  ,voltages to arduino is 0 ,5 ,0 , 5 volts ,and the voltage to stepper is now 12, 0 ,12, 0 volt. In this stage stepper is heating even if I will not send a new spin.Also if I try to spin in with my hand I feel resistance from the stepper, like he is trying to hold position.

How can I ,after every spin ,set the pins on arduino back to 0 voltage state so I can reduse overheating? I dont want stepper to work as brake after every spin

19  Using Arduino / Programming Questions / Re: add hours and days on timecounter on: April 07, 2011, 02:39:40 am
Is it possible to see how datetime.h is made so I can manipulate it ?
20  Using Arduino / Programming Questions / Re: add hours and days on timecounter on: April 06, 2011, 02:09:36 pm
My project is an egg hatcher.Its a project that involves  all basic electronics (sensors ,timers, moters, buttons etc) so i thote that is a good start for learning.
Until now my code ,reads temperature and huminity.Then makes a desition for opening airflow  heaters boilers etc.
The method is that 2 temperature sensors reads temp and by the method of wet bumb i get huminity.

My next step is to insert time in project. The reason is that chickens  egg  need to be at 37 C / 80 humidity  for 18 days  and then  for the last 3 days needs 36 C/ 90 humidity and no moving .
There is some problems in that idea. First I think that I want to avoid external timer.I want by a button choice ,a timer of days start up.
In that point by an internal timer I think that I solved that problem. But if power lost ,program will start from day 1.
So I want by a press of button to correct time counter (1 button for hours , one for days)

Later I will try to backup time elapsed to eeprom every 1 hour but for now I need to be able to correct time counter ....

A litle dificult for newbie ,but I needed motivation smiley

Here is the code I copied/write  until now

Code:
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


int pin0 = 0; // analog pin 0
int pin1 = 1; // analog pin 1
int heater = 13;
int cooler = 10;
float tempF = 0,tempC=0,wetF=0,wetC=0,etemp=0,ewet=0,eall=0,humidity=0 ; // temperature variables
float samples[8]; // variables to make a better precision (dry sensor)
float wetsamples[8]; // variables to make a better precision (wet sensor)
int i;

void setup()
{
  Serial.begin(9600); // start serial communication
  lcd.begin(16, 4);  // set up the LCD's number of columns and rows
  pinMode(cooler, OUTPUT);
  pinMode(heater, OUTPUT);
}

void loop()
{
 
 
for(i = 0;i<=7;i++){ // gets 8 samples of temperature
 
  samples[i] = ( 5.0 * analogRead(pin0) * 100.0) / 1024.0;
  wetsamples[i] = ( 5.0 * analogRead(pin1) * 100.0) / 1024.0;
  tempF = tempF + samples[i];
  wetF = wetF + wetsamples[i];
  delay(100);

}

tempF = tempF/8.0; // better precision
wetF = wetF/8.0;

tempC = (tempF - 32.0)/ 1.8 ; // converts to celsius
wetC = (wetF - 32)/ 1.8 ; //converts to celsius

//follows up code to calculate humidity from 2 temp sensor and wet bumb method. Air presure preset to 1013 .
etemp=(17.67*tempC)/(tempC+243.50) ; //
etemp=exp(etemp); //log
etemp=6.112*etemp;
ewet=(17.67*wetC)/(wetC+243.50) ; //
ewet=exp(ewet); //log
ewet=6.112 * ewet ;
eall= ewet - ((1013.25*(tempC-wetC)) * (0.00066*(1+(0.00115*wetC))));
humidity=(eall/etemp)*100; //humidity



// cooling and heating examples
if (tempC <= 37.6) {digitalWrite(heater, HIGH);}
else {digitalWrite(heater,LOW);}
if (tempC>= 38.2 ){digitalWrite(cooler,HIGH);  }
else {digitalWrite(cooler,LOW);}




//data on LCD or serial

Serial.print(tempC);
Serial.print(" Celsius, ");
lcd.setCursor(0, 0);
lcd.print(" Celsius, ");
lcd.print(tempC);

Serial.print(wetC);
Serial.print(" wetC -> ");
lcd.setCursor(0, 1);
lcd.print(" wetC -> ");
lcd.print(wetC);

Serial.print(humidity);
Serial.print(" humidity -> ");
lcd.setCursor(0, 3);
lcd.print(" humidity -> ");
lcd.print(humidity);

tempF = 0; //reset variables
wetF=0;


}
21  Using Arduino / Programming Questions / Re: add hours and days on timecounter on: April 06, 2011, 07:49:56 am
so I am back in the beginning... smiley-sad
22  Using Arduino / Programming Questions / Re: add hours and days on timecounter on: April 06, 2011, 06:14:52 am
No I dont want to reset them
pin for increase Hour and Minute variables will be in other pins  (not in pin 3 (reset pin) )

I want to add a code like this
void loop(){
 if(digitalRead(increaseHourPin) == LOW)
     hour++;      // increase hour by one (this is the command i dont know)
 
 if(digitalRead(increaseMinPin) == LOW)
   minute ++ ;      // increase min by one (this is the command i dont know)
23  Using Arduino / Programming Questions / add hours and days on timecounter on: April 06, 2011, 04:41:38 am
I am running this code copied from here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227406778/all
Thiw code just count time since reset
I need to insert button for changing hours  on counter.
Fow example if time is 3 hours and 32 min ,by pressing the button 2 times the new time will be 5 hours and 32 min.
I was tring to find command of change  DateTime.Hour and DateTime.Day   (etc DateTime.Hour++) but nothing happend
Anyone knows those commands (-- and ++) please help

Code:
#include <DateTime.h>
#include <LiquidCrystal.h>

int resetPin = 3; // pin 3 resets the time

//create object to control an LCD GMD1602K.
LiquidCrystal lcd(12, 11, 2, 7, 8, 9, 10);

void setup(){
 digitalWrite(resetPin,HIGH);  // this line enables pull-up
 pinMode(13,OUTPUT);          // we flash the LED each second
 pinMode(resetPin, INPUT);    // a button on this pin resets the time
 DateTime.sync( 0 );             // set time to zero
}

void loop(){
 if(digitalRead(resetPin) == LOW)
     DateTime.sync( 0 );      // reset time to zero if button pressed


 /* --------- Prints time in hours, minutes and seconds ----------- */
 DateTime.available(); // needed to refresh the clock time
 time_t timeNow = DateTime.now();
 lcd.setCursor(0,0);
 lcd.print(timeNow/60);        // total elapsed minutes
 lcd.setCursor(0,8);
 lcd.print(timeNow/3600);    //  total elapsed seconds

 lcd.setCursor(0,0);
 lcd.print("Hour:min");
 lcd.setCursor(10,0);
 lcd.print(DateTime.Hour,DEC);      // prints total hours (up to 24)
 lcd.print(":");
 lcd.print(DateTime.Minute,DEC);   // and minutes since reset
 lcd.setCursor(0,1);
 lcd.print("Sec");
 lcd.setCursor(10,1);
 lcd.print(DateTime.Second,DEC);  // and seconds since reset
 lcd.print(" ");                               // clears second digit every minute
 
 digitalWrite(13, LOW);                  //light the LED every second
 delay (1000);
 digitalWrite(13, HIGH);                 //
}
24  Using Arduino / Storage / Re: store, days passed counter, to eeprom on: April 04, 2011, 07:31:00 am
I will count about 50 days.
My best choice would be to backup timer  every 1 hour, but i read that ,internal eeprom will have problem with many read/writes.
If you think that  writing every 1 hour for 1-2 years working period is not so much ,then maybe its for the best to choice more accuracy ,on backup counter.
25  Using Arduino / Storage / store, days passed counter, to eeprom on: April 04, 2011, 07:21:02 am
hi from a newbe !
In my project ,micro controller need to change some  values of the program, depending to the days that passed.
For example if we are on day 1 ,the he keep the temperature of the room ,to 23 Celcius . On day 2 the temperature must set to 25 C.
I will use an internal clock to count days.Something like this code http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227406778/all
The problem is that  if power lost (or reset) , then the arduino will start again fron day one.
I want every 6 hours arduino ,store the days passed  (2 days and 6 hours, or 2 and 1/4 ,or something similar).So  and after every reboot ,arduino, first read those data and continue counting. If I store time every minute ,maybe it will be a problem with eeprom and from the other hand, loosing 6 hours is not a big problem .
If my all idea of solving this problem is wrong, please feel free to guide me. Thank you
Pages: 1 [2]