Show Posts
Pages: 1 ... 700 701 [702] 703 704 ... 1115
10516  Using Arduino / LEDs and Multiplexing / Re: Driving 3W LEDs with PWM on Arduino? on: February 27, 2011, 09:42:12 pm
Thanks for the help; I'll definitely try out some TIP102s.

Regarding the circuit diagram; lets say I am powering my big LED using a high current 5V DC supply and I am powering my Arduino using the USB power - does this mean I have to connect the - part of my 5VDC to Arduino's ground?

Does anyone know why the IRF520 would not work in this case?

Cheers.

Yes you will have to wire your external 5vdc power supply negative terminal to a arduino ground pin. That transistor will not conduct base current without that connection.

A IRF520 won't work because it's a standard N-channel MOSFET that requires +10vdc gate/source voltage to fully turn on for rated current flow. A logic level N-channel MOSFET will fully turn on with just +5vdc output voltage from a arduino output pin. Here is an example of a true logic level mosfet:

http://www.sparkfun.com/products/10213

Lefty

10517  Using Arduino / Networking, Protocols, and Devices / Re: Ds1307 using a MEGA on: February 27, 2011, 09:34:58 pm
With values of all 0s I would think you have a wiring or software problem. I have a test sketch you can try.

Here is the sketch I use (and it works!) if you have the proper DS1307 library code loaded into your user's libraries folder.
Upload as is and it will print time data to the serial monitor at 57600 baud rate. Uncomment out the time data section in the setup section and change the parameters to todays time and date and then upload again, it will update the new time and date and print values to the serial monitor. Finally re-comment out the setup portion and up load again to just display time and date.


Quote
/*Reads the value from a Real Time Clock (RTC) DS1307 and displays it in the serial monitor
 *
 *Created by D. Sjunnesson 1scale1.com d.sjunnesson (at) 1scale1.com
 *
 *Created with combined information from
 *http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1180908809
 *http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1191209057
 *
 *
 *Big credit to  mattt (please contact me for a more correct name...) from the Arduino forum
 *which has written the main part of the library which I have modified
 *
 */

#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h> // written by  mattt on the Arduino forum and modified by D. Sjunnesson

void setup()
{
  Serial.begin(57600);
/*                              // update time/date constants and uncomment block to set new time & date
  RTC.stop();
  RTC.set(DS1307_SEC,1);        //set the seconds
  RTC.set(DS1307_MIN,50);       //set the minutes
  RTC.set(DS1307_HR,0);        //set the hours   note 24 hour clock
  RTC.set(DS1307_DOW,5);        //set the day of the week
  RTC.set(DS1307_DATE,14);      //set the date
  RTC.set(DS1307_MTH,8);        //set the month
  RTC.set(DS1307_YR,9);         //set the year   
  RTC.start();

  */
}

void loop()
{

  Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
  Serial.print(":");
  Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
  Serial.print(":");
  Serial.print(RTC.get(DS1307_SEC,false));//read seconds
  Serial.print("      ");                 // some space for a more happy life
  Serial.print(RTC.get(DS1307_MTH,false));//read month
  Serial.print("/");
  Serial.print(RTC.get(DS1307_DATE,false));//read day
  Serial.print("/");
  Serial.print(RTC.get(DS1307_YR,false)); //read year
  Serial.println();

  delay(1000);

}


Lefty


10518  Using Arduino / LEDs and Multiplexing / Re: Driving 3W LEDs with PWM on Arduino? on: February 27, 2011, 08:54:49 pm
Use this simple solenoid drive circuit and instead of the solenoid wire your LED with current limiting resistor or current driver in it's place. The TIP102 is a cheap common NPN transistor that will handle your current fine. You will need to pick a digital output pin that supports PWM analogWrite commands: http://arduino.cc/en/Reference/AnalogWrite


http://arduino.cc/playground/uploads/Learning/solenoid_driver.pdf



Lefty
10519  Using Arduino / Project Guidance / Re: New to Arduino, guidance on a simple syringe pump for my lab. HELP! FOR SCIENCE! on: February 27, 2011, 08:25:23 pm
Quote
How hard might it be to modify the motor on those to get some sort of variable speed?

Variable speed drive to AC motors is a difficult thing to do correctly. Just wiring them to light dimmers will not cut it. Use a servo, you will have better and easier control for both stroke length and speed. Here is one source of servos:

http://www.hobby-lobby.com/servos_241_ctg.htm

Lefty
10520  Using Arduino / Networking, Protocols, and Devices / Re: Ds1307 using a MEGA on: February 27, 2011, 08:15:28 pm
No sketch or library code changes needed. Only wiring changes required. Uno (or any 168/328 based board) uses analog pins 4 & 5 for the I2C data and clock signals respectively. The mega uses pins 20 and 21 for those two connections to the RTC board. Select the correct board in the IDE and upload the RTC sketch and it all should work, mine does on either my 328 board or mega1280 board.

You have no pin number choice the I2C hardware inside the controller chip only wires the data and clock signals to specific pins, depending on chip type.

Lefty
10521  Using Arduino / Project Guidance / Re: New to Arduino, guidance on a simple syringe pump for my lab. HELP! FOR SCIENCE! on: February 27, 2011, 08:00:22 pm
Well the simplest solution I can think of is to use a servo. Just convert the rotary action to a linear action through appropriate linkage/bell crank type thingee. Your software can control the depth of travel and the rate. Servos come in all sizes and torque ratings with optional quality metal gear trains etc. It should be a cheap project (relative to your $700 pump, no wonder why my health care costs are so high  smiley-wink ) and a great excuse to have an arduino board work for a living.

Lefty
10522  Using Arduino / Programming Questions / Re: Newbie: Finding Libraries on: February 27, 2011, 07:52:56 pm
Hmm, yeah I never created a user libraries directory.  When I grabbed StopWatch.h and StopWatch.cpp I just created a new directory: arduino-0022/libraries/StopWatch and put the files in there.  I guess I was supposed to create a new user libraries directory?

Correct. Unfortunately installing the Arduino IDE does not go ahead and create a user's library folder into the user's sketch folder. It probably should check if you have one or not and if not create such a directory. In older versions of the IDE there was no concept of a users library directory that the IDE would search for, instead you had to load any libraries you found into the arduino core libraries directory. That worked, but every time you upgraded to a new arduino IDE version you would end up losing all your contributed library files. No winning I guess, you just have to play the game.  smiley-grin
10523  Using Arduino / Programming Questions / Re: Newbie: Finding Libraries on: February 27, 2011, 07:41:28 pm
Quote
My Sketch/Import library menu isn't segmented, but it is probably because I'm on Linux.

Or possibly because you haven't created a user libraries folder correctly or in the correct directory, or you have never placed any library folders containing .h and .c or .cpp files? I don't think it's a windows/Linux thing at all. The IDE is just telling you it didn't find any user library files for whatever reason.


Lefty

 
10524  Using Arduino / Programming Questions / Re: Newbie: Finding Libraries on: February 27, 2011, 07:11:35 pm
Quote
For instance, there is a function millis() that a lot of code tends to utilize apparently, and every time I search for it like everything else I search for, I find links to it being used, but never the functions code or where I can get it.

millis() is a arduino build-in function that is in the arduiono cores folder and not stored in your users libraries folder. Here is a listing of my arduino core library files, millis() is a function defined in one of them. If you use a function that is listed in the official arduino reference page: http://arduino.cc/en/Reference/HomePage , It is not a function you have to load into your skectch, the arduino IDE automatically knows where to find it. Here is where all the build=in functions come from:

Wiring.h (and .c) contains the millis() function along with a lot of others.

Quote
C:\Documents and Settings\Primary Windows User\My Documents\My Programs\Arduino\arduino-0022\hardware\arduino\cores\arduino

0 Folders:

24 Files:

binary.h
HardwareSerial.cpp
HardwareSerial.h
main.cpp
pins_arduino.c
pins_arduino.h
Print.cpp
Print.h
Stream.h
Tone.cpp
WCharacter.h
WConstants.h
WInterrupts.c
wiring.c
wiring.h
wiring_analog.c
wiring_digital.c
wiring_private.h
wiring_pulse.c
wiring_shift.c
WMath.cpp
WProgram.h
WString.cpp
WString.h

There is also a folder for 'official arduino libraries' that come with each distrubution of the IDE:

Quote
C:\Documents and Settings\Primary Windows User\My Documents\My Programs\Arduino\arduino-0022\libraries

13 Folders:

ArduinoTestSuite
EEPROM
Ethernet
Firmata
LiquidCrystal
Matrix
SD
Servo
SoftwareSerial
SPI
Sprite
Stepper
Wire


0 Files:

And finally there is a place where you store library code for user contributed (that you might find on the web or in the arduino playground area) or ones you write yourself:

Quote
C:\Documents and Settings\Primary Windows User\My Documents\Arduino\libraries

10 Folders:

Button
DS1307
Flash
MsTimer2
Playtune
Streaming
String
Tone
WString
__MACOSX


0 Files:

I know it can be a bit confusing but start simple and you should get the hang of it soon. When you are in the Arduion IDE there is a Sketch button/Import Library you can hit and it will show you the names of libraries avalible for you to include by selecting one. You will notice that the list comes in two sections, the top section is the official arduino libraries and the 'Contributed' list is from library folders you have stored in your users libraries folder.

That help?

Lefty


10525  Using Arduino / Programming Questions / Re: Newbie: Finding Libraries on: February 27, 2011, 06:20:49 pm
It shouldn't be that hard. You state: "gave it a directory in Libraries"

The libraries folder name in your Arduino sketch folder must not start a capital L?

Could your problem be that simple?

Lefty

10526  Using Arduino / Motors, Mechanics, and Power / Re: max current for v5 pin on: February 27, 2011, 01:56:20 pm
How much current can the Uno supply on the 5 volt pin,(SparkFun's 1:100 Mini gearmotor @ 90 mA).


Arduino has 40mA on it's pin's so going on with as other's have defined in here for a external power supply is the thing.

Note that the arduino +5vdc power pin on the sheild connector is not the same as any of the digital output pin's current limit. They have different current limits.




Lefty
10527  Using Arduino / Interfacing w/ Software on the Computer / Re: external 5V at Vin pin, and USB connection - UNO board on: February 27, 2011, 01:08:26 pm
Quote
So that's sorted, but I still need to know if I can plug in USB while it is powered via +5V pin from the shield.


It should work ok. However is the 500ma current limit for USB power enough to run both the Uno board and your shield board? The polyfuse in the Uno board will open if current draw is > then 500ma.

Lefty
10528  Using Arduino / Microcontrollers / Re: Arduino faster than the Mega? on: February 27, 2011, 01:00:14 pm
Quote
(as long as ATMEL keeps making the processors)

Its a big proviso.......

Having diluted the Arduino market, by making an SMD version (I know, I know, devil and the deep blue sea/ rock and a hard place etc) it gives 'em more excuse to drop the DIP altogether. 

Well the main missing open source component of the Arduino platform is the reliance on a proprietary controller the AVR chip. Without a second source with manufacturing rights to produce the chip(S) the project will always be somewhat dependent of Atmel. Back when I was first exposed to the electronics industry through my employment a company would almost never design in a component unless there was already a 2nd source for the component. I guess in this day of highly complex and expensive IC development that concept has fallen by the wayside. However even today one can utilize Intel or AMD processors for PC manufacturing? I understand that the Arduino wave does not have a big enough tail to wag the ATMEL dog, but still I hold out hope that the DIP format does not go the way of the fahnestock clip (how old am I  smiley-grin)

Lefty

Edit: My bad, fahnestock clips are still alive and well: http://www.google.com/search?sourceid=navclient&ie=UTF-8&rlz=1T4GGLL_enUS373US373&q=fahnestock+clip+#q=fahnestock+clip&hl=en&rlz=1T4GGLL_enUS373US373&prmd=ivns&source=univ&tbs=shop:1&tbo=u&sa=X&ei=7JBqTfyZJ4SqsAOe3OGmBA&ved=0CC4QrQQ&biw=1051&bih=705&bav=on.1,or.&fp=f02c1330b766f6e0
10529  Using Arduino / Programming Questions / Re: Timer interrupt question on: February 27, 2011, 12:45:55 pm
Quote
Ah, you are right davekw7x.. I have a 328 chip... I'm a dolt.

Your not a dolt, your a wingding.  smiley-grin

Just kidding, good luck with your efforts.

Lefty

10530  Using Arduino / Project Guidance / Re: How to use millis function to turn led on for 5s then turn it off indefinitely? on: February 27, 2011, 12:19:48 pm
Ahh... one problem..... I dont want to use the delay function i want to use the Millis function? Any ideas?
So we have circled around again to the AWOL suggestion:

Quote
Have a look at the blink without delay example.
Pages: 1 ... 700 701 [702] 703 704 ... 1115