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?


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:


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.

/*Reads the value from a Real Time Clock (RTC) DS1307 and displays it in the serial monitor
 *Created by D. Sjunnesson d.sjunnesson (at)
 *Created with combined information from
 *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()
/*                              // update time/date constants and uncomment block to set new time & date
  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   


void loop()

  Serial.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
  Serial.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
  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(RTC.get(DS1307_DATE,false));//read day
  Serial.print(RTC.get(DS1307_YR,false)); //read year




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:

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
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:

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.

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.

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
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.


10524  Using Arduino / Programming Questions / Re: Newbie: Finding Libraries on: February 27, 2011, 07:11:35 pm
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: , 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.

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

0 Folders:

24 Files:


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

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

13 Folders:


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:

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

10 Folders:


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?


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?


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.

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
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.

10528  Using Arduino / Microcontrollers / Re: Arduino faster than the Mega? on: February 27, 2011, 01:00:14 pm
(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)


Edit: My bad, fahnestock clips are still alive and well:,or.&fp=f02c1330b766f6e0
10529  Using Arduino / Programming Questions / Re: Timer interrupt question on: February 27, 2011, 12:45:55 pm
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.


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:

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