Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Asking for help - handicapped on: February 23, 2014, 12:32:25 pm
Hi everyone.  I started a small Arduino project about two years ago but before I could finish I had a stroke.  I had to take a year off and about this time last year I tried to get back into my project.  I had to learn all over again.  But with limited thinking capability.  During my "comeback" efforts I suffered another brain complication and had to stop again.  Well, here it is another year later and I plan to start over again.

Is there any of you out there who would be willing to guide me through my project?  I want to control a DC motor to run CW at a designated time of day and CCW at another designated time of day.  The duration of the run times must be controlled by either limit switches or by location sensor(s).  That's it in a nutshell.  I have all of my previous efforts notes, sketches, and equipment lists I can share with you.

Watcha think?  Thanks.
2  Using Arduino / Installation & Troubleshooting / Installation help request on: June 06, 2013, 11:28:55 pm
I just downloaded and installed an update from 1.0.1 to 1.0.5

I'm still very new at this stuff and I need some advice . . .

I need to add the RTC library to the new IDE 1.0.5 program.  I have a folder named RTClib and in this folder is a sub-folder named RTClib-master.  I do not know which of these folders to add to my new program under menu selection sketch/import library/add library.  Oops - I just tried to add RTClib-master and it would not take it, so I tried to add RTClib and it seemed to take it OK.  Do you see any problem here?

I also need to know which PROGRAMMER to select under the TOOLS menu.  And why would I select one instead of another?

Thanks.
3  Community / Gigs and Collaborations / Re: In search of assistance. on: April 05, 2013, 11:28:56 am
focalist - did you get my PM?
4  Community / Gigs and Collaborations / In search of assistance. on: April 04, 2013, 08:45:46 pm
I started a very elementary project 2 years ago and three weeks into my project I had a stroke.  I'm partially disabled now and would like to finish my project more than ever as the project would greatly help me with my disability.

I have several sketches that I made before the stroke and with my reduced thinking ability I'm unable to take my programing any further.  Too confusing for my broken brain I guess smiley-confuse.  I have an Arduino UNO R3, an Arduino motor shield, and an Adafruit RTC.

Is there anyone out there who could give me a cost estimate to complete my programing.  I will provide my project description/requirements and my sketches for review.  We can communicate via telephone and email.

Thanks.
5  Using Arduino / Programming Questions / Re: Strugling with RTC on: March 31, 2013, 08:55:58 am
I have tried the program with the "  " and also with the < >  around the RTClib and neither will allow my laptop screen to print the clock functions.  I have adjuster the baud rate to match the sketch with no luck.  I have read many posts on several different websites with no success.  Without the ability to see (on the screen) the results of the uploaded sketch I don't know if my RTC is programmed with the correct time or not.

I even went back to some of my old learning sketches to see if the print-to-screen commands work OK.  They do.  I even experimented with changing the baud rates and everything seems to work OK.

I'm completely puzzled with nowhere to turn.  We're getting ready for planting season and the farm is very busy these days.  I was hoping to have the Arduino controlled door opener issues solved before the spring rush.  We're working 12 to 16 hours a day.  Very frustrating.

Is there anyone out there who can help me?  I think if I can just get something to work I could continue on my own.

Thanks.
6  Using Arduino / Programming Questions / Re: Strugling with RTC on: March 29, 2013, 08:20:17 pm
Here is a snapshot of the IDE screen after compiling.  You can see the different colors in the two "include" statements.  I'm sure these colors indicate something but I cannot find out what it means.  Any suggestions?
7  Using Arduino / Programming Questions / Re: Strugling with RTC on: March 29, 2013, 04:42:07 pm
It is not clear from your posts whether the Adafruit RTC test sketch works when you try it.

Thank you for your reply UKHeliBob.  I cannot determine if the RTC is accepting the program because I cannot get anything on the computer screen to indicate that the RTC has received the program.  The LEDs on the UNO blink to indicate that the program is loaded.  Is there another way to determine that the program is working?  I'm so new to all of this stuff I do not know of other possible ways to check.

afremont, yes I have set the baud rate correctly at 57600.  Thanks.

Ian, I will try your suggestion when I get home.  Thanks.
8  Using Arduino / Programming Questions / Re: Strugling with RTC on: March 29, 2013, 09:30:05 am
Anybody out there?
9  Using Arduino / Programming Questions / Re: Strugling with RTC on: March 28, 2013, 06:16:15 pm
Sorry.  I should have put this in my first post.  It's the RTC test sketch provided by Adafruit on their website.

I have gone through many of the learning lessons from various places on the internet and I also have had good success with printing to screen with a couple of the lessons.  Also, I have written a sketch that runs my coop door open and closed just great.  I encountered lots of trouble trying to program lengthy pause times.  So I decided that an RTC was needed to overcome millis() limitations.

Here is the RTC test sketch provided by Adafruit . . .
 
Code:
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
 
#include <Wire.h>
#include "RTClib.h"
 
RTC_DS1307 RTC;
 
void setup () {
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();
 
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    //RTC.adjust(DateTime(__DATE__, __TIME__));
  }
 
}
 
void loop () {
    DateTime now = RTC.now();
 
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
 
    Serial.print(" since 1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");
 
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);
 
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();
 
    Serial.println();
    delay(3000);
}

I may be having trouble with my addition of the RTClib library.  I remember reading somewhere in the gazillion pages of my studies that the Arduino IDE will automatically color the #include commands when the correct files are located in the library directory.  My IDE colors those commands blue and I'm pretty sure that's not good.  I did have some difficulty getting those RTClib.cpp and RTClib.h files in the library.  I might have something wrong there.  But when I compiled that sketch no error messages were given.  Hmmmmm.

Here is the sketch that I have tried to use with the lengthy pause intervals between run times for my door motor.  I have tested this same sketch with much shorter timing settings and it works very good.

Code:
// Drive motor CW 34 seconds, pause 16 hours, run motor CCW 34 seconds, pause 8 hours, repeat.  L.C. H. 2/24/2013

// Motor A definitions
int DIR_A = 12;
int SPEED_A = 3;
int BREAK_A = 9;

// Motor B definitions
int DIR_B = 13;
int SPEED_B = 11;
int BREAK_B = 8;

void setup()
{
  pinMode(SPEED_A, OUTPUT);
  pinMode(DIR_A, OUTPUT);
  pinMode(BREAK_A, OUTPUT);
 
  // release break
  digitalWrite(BREAK_A, LOW);
}

void loop()
{
  // run motor backward full speed.  (Max is 250)
  digitalWrite(DIR_A, HIGH);
  analogWrite(SPEED_A, 250);

  // run motor for 34 seconds to open
  delay(34000);
 
 // stop motor
  analogWrite(SPEED_A, 0);

  // pause door open 16 hours (minus runtime)
  delay(57566000);

 // run motor forward full speed.  (Max is 250)
  digitalWrite(DIR_A, LOW);
  analogWrite(SPEED_A, 250);

  // run motor for 34 seconds to close
  delay(34000);
 
  // stop motor
  analogWrite(SPEED_A, 0);

  // pause door closed 8 hour (minus runtime)
  delay(10000);
  
}
10  Using Arduino / Programming Questions / Strugling with RTC on: March 28, 2013, 03:41:55 pm
I'm trying to build a controller for an automatic chicken coop door.  The door and the mechanics are no problem at all but I have no electronics nor programing experience.  As a result I have been stubbing my toe on setting up my RTC to work with the UNO R3 I have.  The pic below shows my set-up with the Arduino UNO on the bottom, the Arduino motor controller shield on top, and the Adafruit RTC plugged into the motor controller.  The black plastic box is an old Pelican box I had in my junk pile and works great to keep the electronics clean in a dusty chicken coop.

Using the instructions at the Adafruit learning site I have installed (I guess) the RTClib library and compiled/loaded the "TEST" sketch into my UNO.  The compiling and loading seemed to work OK but when I go to serial monitor I get a blank screen.

Since I get a blank screen I do not know if the sketch is loaded properly.  Since I get a blank screen I do not know if the clock time is set properly.  Can someone talk me through some troubleshooting steps?  Thanks.

11  Using Arduino / Programming Questions / Re: Does Arduino have an automatic time-out? on: March 24, 2013, 05:54:21 pm
I don't know what an RTC is.  What is it and how is it used? Thanks.

Edit: I have been reading many posts here and I found that RTC means "real time clock".  I'll study more.
12  Using Arduino / Programming Questions / Does Arduino have an automatic time-out? on: March 24, 2013, 12:30:47 pm
I'm very new to the Arduino world and I have no experience with programming language.  I'm using my Arduino UNO R3 to run an automatic door operator.  I want the door to open, stay open for a set time, close, and stay closed for a set time, repeat (24 hour cycle).  I have developed the following sketches to accomplish this task using an Arduino R3 motor shield.  My  sketch #1 (quick test) works perfectly but when I upload sketch #2 (my desired timing) the door will open and never will shut.  I wonder if the Arduino has an automatic time-out function that I'm not aware of.  Can you guys help me trouble-shoot my sketch?  Is there a better way to do long term motor shutdown times?  Thanks.
_______________________________________________________________
Code:
// Sketch #1 (my quick test sketch)
//Drive DC motor CW 10 seconds, pause 2 seconds, run motor CCW 10 seconds, pause 2 seconds, repeat.
//L. C. H. 2/23/2013

// Motor definitions
int DIR_A = 12;
int SPEED_A = 3;
int BREAK_A = 9;

void setup()
{
  pinMode(SPEED_A, OUTPUT);
  pinMode(DIR_A, OUTPUT);
  pinMode(BREAK_A, OUTPUT);
 
  // release break
  digitalWrite(BREAK_A, LOW);
}

void loop()
{
  // run motor CW full speed.  (Max is 250)
  digitalWrite(DIR_A, HIGH);
  analogWrite(SPEED_A, 250);

  // run motor for 10 seconds
  delay(10000);

 // stop motor
  analogWrite(SPEED_A, 0);
 
  // pause 2 seconds
  delay(2000);

  // move motor CCW full speed.  (Max is 250)
  digitalWrite(DIR_A, LOW);
  analogWrite(SPEED_A, 250);

  // run motor for 10 seconds
  delay(10000);

 // stop motor
  analogWrite(SPEED_A, 0);
 
  // pause 2 seconds
  delay(2000);

 }
_______________________________________________________________
Code:
//Sketch #2 (my long-term-pause sketch w/desired timing)
//Drive DC motor CW for 18 seconds, pause 14 hours, run CCW for 18 seconds, pause 10 hours, repeat.
//L. C. H. 2/24/2013

// Motor A definitions
int DIR_A = 12;
int SPEED_A = 3;
int BREAK_A = 9;

void setup()
{
  pinMode(SPEED_A, OUTPUT);
  pinMode(DIR_A, OUTPUT);
  pinMode(BREAK_A, OUTPUT);
 
  // release break
  digitalWrite(BREAK_A, LOW);
}

void loop()
{
  // run motor CW full speed.  (Max is 250)
  digitalWrite(DIR_A, HIGH);
  analogWrite(SPEED_A, 250);

  // run motor for 18 seconds to open
  delay(18000);
 
 // stop motor
  analogWrite(SPEED_A, 0);

  // pause door open 14 hours (minus 18000 ms runtime)
  delay(50398200);

 // run motor CCW full speed.  (Max is 250)
  digitalWrite(DIR_A, LOW);
  analogWrite(SPEED_A, 250);

  // run motor for 18 seconds to close
  delay(18000);
 
  // stop motor
  analogWrite(SPEED_A, 0);

  // pause door closed 10 hours (minus 18000 ms runtime)
  delay(35998200);
  
}
13  Using Arduino / Motors, Mechanics, and Power / Re: Motor shield advice request on: February 24, 2013, 10:16:42 pm
Thanks everyone.

I have been trying several things with my sketches and I have developed a very simple program that I think will meet my needs.  Also, maybe I failed to let you guys know that I already have an Arduion UNO R3 and an Arduino motor shield R3.  I have been having a real struggle trying to remember ANY of the C++ programming language that I used to know so well.  Trying to remember things is like trying to walk on two rubber legs after my stroke.  Sometimes I feel totally useless.

My needs for the motor control are as follows -
1. Run motor CW for 18 seconds
2. Stop motor (without break)
3. Pause 14 hours
4. Run motor CCW for 18 seconds
5. Stop motor (without break)
6. Pause 10 hours
That's it.  I know it may seem simple to you but I'm struggling.  As you will see in my sketch below, I'm using nano-seconds for my timing commands.  I'm pretty sure there is a better way to program lengthy MOTOR OFF periods but I simply cannot remember.  Any advise would be appreciated.

Anyway here is my sketch: (please comment on ways to simplify or to streamline - thanks)
// Drive a simple DC motor forward and backward at full
// speed with timed pause between each run.  2/24/2013
//
// Motor connected to Motor output A on Arduino Motor Shield R3

// Motor A definitions
int DIR_A = 12;
int SPEED_A = 3;
int BREAK_A = 9;

// Motor B definitions
int DIR_B = 13;
int SPEED_B = 11;
int BREAK_B = 8;

void setup()
{
  pinMode(SPEED_A, OUTPUT);
  pinMode(DIR_A, OUTPUT);
  pinMode(BREAK_A, OUTPUT);
 
  // release break
  digitalWrite(BREAK_A, LOW);
}

void loop()
{
  // run motor backward full speed.  (Max is 250)
  digitalWrite(DIR_A, HIGH);
  analogWrite(SPEED_A, 250);

  // run motor for 18 seconds to open door
  delay(18000);
 
 // stop motor
  analogWrite(SPEED_A, 0);

  // pause door open 14 hours (minus run time)
  delay(50398200);

 // run motor forward full speed.  (Max is 250)
  digitalWrite(DIR_A, LOW);
  analogWrite(SPEED_A, 250);

  // run motor for 18 seconds to close door
  delay(18000);
 
  // stop motor
  analogWrite(SPEED_A, 0);

  // pause door closed 10 hours (minus run time)
  delay(35998200);
 
}
14  Using Arduino / Motors, Mechanics, and Power / Re: Motor shield advice request on: February 14, 2013, 09:21:36 am
Can anybody else help me?  Thanks.
15  Using Arduino / Programming Questions / Re: Delay question on: February 10, 2013, 06:49:36 am
Thanks wildbill.  Oops, I meant 28800000ms - see what I mean?  Dealing with ms for lengthy timing gets somewhat unwieldy.

Have a look at the TimeAlarms library.  Set an alarm to go off in 8 hours and run a function that you specify.  Job done.
Where would you suggest I look for TimeAlarms library info?
Pages: [1] 2