Show Posts
Pages: [1] 2 3 ... 7
1  Using Arduino / Programming Questions / Re: LED Timer on: August 03, 2014, 10:02:13 am
I don't get to spend as much time as I would like to, playing with my Arduino. I will use it for a couple of weeks and I have to go back and learn all the basics all over again, seeing the gap in between uses are so long. So its difficult to learn everything all over again, I would blame my lack of consistency on not knowing some of the basics.
2  Using Arduino / Programming Questions / Re: LED Timer on: August 02, 2014, 10:10:20 pm
 Thank to everyone for responding and your willingness to assist. I started working on BulldogLowell's sketch, which is EXCELENT, with some minor changes I should have this project up and running in no time. Thank you very much, it would have been months for me to come up with code this great! This project is a tool that I will be using at my place of employment to assist me with keeping track of my call times and providing warning led notifications when I need to try to wrap it up... Again, thank you very much!

 
So, I'm working on a call timer and trying to get LEDs to react to certain commands upon a given time frame. I have downloaded the Timer.h library and this does not seem to do the trick. I have a LCD that is counting the time (milli). So after x amount of time for example lets say 20 sec I want a led to light. Does anyone have any ideas? The sketch I have listed below is so cut up, broken and battered... please don't judge.. LOL!

It is much harder when you start with something that doesn't work.

try this and see if you can get it to work:

Code:
#include <LiquidCrystal.h>
//initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int ledR = 9; //red LED
int ledY = 8; // yellow LED
int ledG = 7; //green LED
int buttonPin = 6;
unsigned long oneSecond = 1000UL;
unsigned long lastTime;
unsigned long startFlash;
unsigned long startTime;
int myMinutes;
int mySeconds;
int counter;
byte lastState;
//
void setup()
{
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  lcd.setCursor(0, 0);
  lcd.print("Call Time:");
  pinMode(ledR,OUTPUT);
  pinMode(ledY,OUTPUT);
  pinMode(ledG,OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
}
//
void loop()
{
  //This Block used to reset your timer with a pushbutton switch
  byte buttonState = digitalRead(buttonPin);
  if (buttonState)
  {
    if (buttonState != lastState)
    {
      startTime = millis();
      lastTime = startTime;
    }
  }
  lastState = buttonState;
  //--------------------------------------------------------------
  if (millis() - lastTime >= oneSecond)
  {
    unsigned long elapsedSeconds = millis() / oneSecond;
    myMinutes = elapsedSeconds / 60;
    mySeconds = elapsedSeconds % 60;
    lcd.setCursor(0, 1);
    if (myMinutes < 10)
    {
      Serial.print("0");
      lcd.print("0");
    }
    Serial.print(myMinutes);
    lcd.print(myMinutes);
    Serial.print(":");
    lcd.print(":");
    if (mySeconds < 10)
    {
      Serial.print("0");
      lcd.print("0");
    }
    Serial.println(mySeconds);
    lcd.print(mySeconds);
    counter++;
    lastTime += oneSecond;
  }
  if (millis() - startTime >= 20000UL) // this is your 20 Second LED liter
  {
    flashRed();
  }
}
//
void flashRed()
{
  if (millis() - startFlash >= 50UL)
  {
    digitalWrite(ledR, !digitalRead(ledR));
    startFlash += 50UL;
  }
}
3  Using Arduino / Programming Questions / LED Timer on: August 01, 2014, 11:33:39 pm
So, I'm working on a call timer and trying to get LEDs to react to certain commands upon a given time frame. I have downloaded the Timer.h library and this does not seem to do the trick. I have a LCD that is counting the time (milli). So after x amount of time for example lets say 20 sec I want a led to light. Does anyone have any ideas? The sketch I have listed below is so cut up, broken and battered... please don't judge.. LOL!

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int ledR = 9; //red LED
int ledY = 8; // yellow LED
int ledG = 7; //green LED
unsigned long time;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(20, 4);
  // Print a message to the LCD.
  lcd.print("Call Time");
 
  pinMode(ledR,OUTPUT);
  pinMode(ledY,OUTPUT);
  pinMode(ledG,OUTPUT);
 
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000)
 

 if  (time =< 20)
   {
    digitalWrite(ledG, HIGH);
   }
 else
   {
    digitalWrite(ledG, LOW);
   }


}
}
4  Using Arduino / General Electronics / Re: Regulating DC Voltage on: April 22, 2014, 07:30:44 am
Well I picked up a DC buck boost regulator from eBay, just waiting on it to come in the mail.
5  Using Arduino / General Electronics / Re: Regulating DC Voltage on: April 21, 2014, 08:07:02 am
The dimensions would be  18650, ~18mm (w) x 650mm (h).

650mm long ? Are you sure ?
That can't be right. that's 25 inches , more than 2 feet long.
  A meter is 1000mm

Woops! I just skipped right over the decimal, lol! 65.0mm... Sorry! Hahaha!
6  Using Arduino / General Electronics / Re: Regulating DC Voltage on: April 20, 2014, 10:22:02 pm
I'm sorry, when you say dimensions you're talking about the physical size of the battery, correct? The dimensions would be  18650, ~18mm (w) x 650mm (h).
7  Using Arduino / General Electronics / Re: Regulating DC Voltage on: April 20, 2014, 10:13:22 pm
http://originvape.com/product/efest-flat-top-high-drain-35a-18650-2500mah-battery/

You need to be more specific about your battery specs.
There are two ratings regarding current
1 mAh rating (mAmps continuous for one hour)
2 Discharge rate (called "C" rating for Lipo batteries) is usually specified with two numbers;
         A. Continuous discharge rate (self explanatory)
         B. Max burst discharge rate (discharge rate for 10 second burst)

The same voltage battery may be available in many different mAh ratings and discharge rates
2500mAh/35A = 14C (14 times the discharge rate of the mAh rating , in this case 14 times 2.5A/per hour)
Stating that your battery is rated for 35A in no way means in could not have the shape or size of the one shown in the link I posted since the battery shown in this link is the same size but as you can see if read the description , is rated for 35A

The link you posted is in fact the batteries I have.
8  Using Arduino / General Electronics / Re: Regulating DC Voltage on: April 20, 2014, 07:48:18 pm
Thank you for the info, I'll give the boost regulator a shot! Hopefully that will workout. As for the battery I'm using one rated for 35A so I don't think it's going to lack in that perspective.
9  Using Arduino / General Electronics / Regulating DC Voltage on: April 19, 2014, 11:14:52 pm
I have constructed a circuit that has an Arduino Pro Mini (3.3v) along with an LCD screen (3v) that is being powered off of a single 18650 battery ( 4.2v – 3.6v). The purpose of the Arduino is to take a analog reading of the voltage of the battery while the 18650 is also powering a higher ampere secondary circuit. The problem I’m running into is when I’m running the secondary circuit, the backlight and the contrast in dimming on the LCD readout due to a drop of voltage (brings it to 2.5v) along with effecting the Arduino as well seeing that I’m running the 18650 to RAW and the VCC is out to the LCD.

Now, is there anything I can use to eliminate that voltage drop while the secondary circuit is in use? I'm not able to use a voltage regulator due to the minimal amount of provided voltage so a LM317 is out of the question... If you have any ideas, I would love to hear what you have to offer. Thank you in advanced for your help!
10  Using Arduino / Displays / Re: Help w/ Display (Drivers SPLC780D OR ST7066U) on: April 14, 2014, 11:12:03 pm
You aren't providing much information.  Are you sure that the current drain of the backlight isn't causing your supply voltage to sag?

Don

I thought about this a little more, I have a regulator circuit on this to step down to 3v... Now, it's working perfect! Well other than I had to change the resistor on the contrast. When I have the LCD on the text disappears and when I have it off it works fine. I have to find the right resistance that will work for both. Not really a big deal. Thanks for the help Floresta!
11  Using Arduino / Displays / Re: Help w/ Display (Drivers SPLC780D OR ST7066U) on: April 14, 2014, 10:37:33 pm
Yes, Voltage is good. The display is working fine, it's just displaying random nonsense. What information could I provide you that would help with diagnosing the issue? I really do appreciate your help on this!
12  Using Arduino / Displays / Re: Help w/ Display (Drivers SPLC780D OR ST7066U) on: April 14, 2014, 09:39:38 pm
According to the data sheet that you linked to this is a 3.3v device.  Have you taken that into account?

Don

Yes sir.
13  Using Arduino / Displays / Help w/ Display (Drivers SPLC780D OR ST7066U) on: April 14, 2014, 07:24:40 pm
I have just recently purchased some displays from New Haven Display and the drivers listed are SPLC780D OR ST7066U, from doing some reading prior to purchase, I saw that it is compatible to the Arduino because it's the same coding for the HD44780 driver (if I worded that incorrectly I apologize). I had a sketch running already that had a HD44780 screen on it and wanted to change the screen out to this new 4x20 display I purchased (NHD-0420AZ-FL-GBW-3V3). When I hooked it up, to no surprise it was NOT working properly. I tinkered around a little, did some reading (which has confused me more) and here I am!

To make this easier, I'm working off of the "Hello World" sketch which has the pin out as follows:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)

The display is on, and working it just has symbols and blacked out segments...

Here is the datasheet from the LCD display:
http://www.newhavendisplay.com/specs/NHD-0420AZ-FL-GBW-3V3.pdf

Any help would be much appreciated!  If I can supply any additional information please let me know what you need. Thank you in advanced for your help!

Pete
14  Using Arduino / Displays / Re: Arduino Mini Pro 3.3v LCD? on: April 10, 2014, 10:26:43 pm
I found one on sale at NewHavenDisplay.com
http://www.newhavendisplay.com/nhd0420azflgbw3v3-p-2003.html

The only thing that made me second guess, was the Controller/Driver: SPLC780D OR ST7066U, I wasn't positive that it would be compatible. From what I have read this would not be an issue, so I picked up 2 of them. I was a fan of this model because it only needs 2.7v min with typical being 3v and max at 3.3v and low mA so it won't kill the battery life either. It's perfect for my application. I really hope I don't have any issues with the drivers though... Staying positive and keeping my fingers crossed.

15  Using Arduino / Displays / Re: Arduino Mini Pro 3.3v LCD? on: April 10, 2014, 10:16:20 am
Sounds good, I'll take a look. As for the 4.18v max, that would be the max output voltage of a 18650 battery I'm using for the project. At full charge they ring in at 4.18v. Thanks again for the help!
Pages: [1] 2 3 ... 7