Pages: [1] 2   Go Down
Author Topic: I'm starting to worry...  (Read 1088 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm starting to worry that maybe I bought a broken Arduino, because of the fact that it refuses to work.  I started with my circuit, then simplified it, then simplified it again, and again, and eventually I got this circuit:



with this code:

Code:
int outPin = 13;

void setup()
{
  pinMode(outPin, OUTPUT);
}

void loop()
{
  Serial.print("hello world");
  digitalWrite(outPin, HIGH);

}

The arduino does nothing when I upload it.  I also tried pushing the button on the arduino; I don't know what the button does, but it didn't start the program.  I'm hoping that I made a silly mistake.

Thank you in advance.
Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

First you need to put Serial.begin(9600); in setup() to make the serial code work.

Also the Arduino cannot provide too much current which may be why your motor doesnt work.
Try using a transistor to turn the motor on.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
First you need to put Serial.begin(9600); in setup() to make the serial code work.

Also the Arduino cannot provide too much current which may be why your motor doesnt work.
Try using a transistor to turn the motor on.

I thought it provided 5 volts? :-?

EDIT: Also, where will the "hello world" text show up on my computer, so I can make sure it's working?
« Last Edit: November 25, 2007, 10:52:27 am by nickw » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 I recently ran into this issue myself. The digital outputs on the Arduino can only supply 40mA.  Odds are that motor needs a couple of hundred mA.  Because there is a limit to the current, and the resistance of the motor at rest doesn't change, the voltage will drop to the point where V=IR.  
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Check this:  http://www.tigoe.net/pcomp/code/category/code/picbasic-pro/62

I have used that method with serveral differebt DC motors and i works very well

his example is for PIC basic but just use the schematics and Arduino code and you will be ok.

MikMo

http://www.mikmo.dk
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

and yes, your motor might have killed the atmega because of reverse voltage or other high loads if you turned the motor for example (thus using it as a generator). try connecting an led instead of the motor, to check if the pin still works. you might be lucky because pin 13 has an additional resistor which limits the current.

Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I thought it provided 5 volts? :-?
Think of electricity as water.
Voltage is the speed of the water and current is the amount of water.

To drive a motor you need the right speed and amount of water.
Its no good giving it fast water if its just a milliliter of water.
Thats all the Arduino can output directly. About enough for a LED.

Quote
EDIT: Also, where will the "hello world" text show up on my computer, so I can make sure it's working?
Click the Serial Monitor button in Arduino. That will show all the serial data.
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Think of electricity as water.
Voltage is the speed of the water and current is the amount of water.

@cheater:
Wouldn't speed here mean the same as amount of water? something like 2liters/second?
It helped me much though to think of voltage as water pressure.
//kuk
Logged

Augsburg/Munich, Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
"Stay hungry. Stay foolish."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I perfer this water pressure/amount analogy also.
If you imagine two waterfalls, with an equal width but different heights you have different voltages (higher = more voltage) at the same current (=amount of water falling down). On the other side, if you see two rivers with the same gradient, but one is wider than the other, you have the same voltage at different currents (wider means more current).

This rembers me of my first electronic kits, where transistors haven been discribed as set of two connected water gates. :-)
« Last Edit: November 27, 2007, 09:03:51 am by ozel » Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Wouldn't speed here mean the same as amount of water? something like 2liters/second?
No, Thats a amount of water passing a particular point in a second.
I think its a analogy for Watts. smiley

Quote
This rembers me of my first electronic kits, where transistors haven been discribed as set of two connected water gates. :-)
Did someone mention water gates? ;D

http://www.blikstein.com/paulo/projects/project_water.html
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you all, but I do in fact know how electricity works.  I also know that a motor reversed is a generator, but what I don't understand is how putting electricity into a microchip will break it.  For one, isn't it designed to take in electricity for input?  And for another, how does electricity break an electrical device?
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Thank you all, but I do in fact know how electricity works.  I also know that a motor reversed is a generator, but what I don't understand is how putting electricity into a microchip will break it.  For one, isn't it designed to take in electricity for input?  And for another, how does electricity break an electrical device?

electricity is not electricity. there are 100.000 Volt sources that will kill you by getting to near and others you can carry in your pocket without knowing. That's why we came up with the water example.

Electrical current in a wire produces heat. And too much heat may eventually burn something in your "electrical device".

Did you test your board with an LED hooked to pin13 and ground?


Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Unfortunately I don't have an LED to test it with.  Wouldn't I need a resistor too, anyway?  Maybe not, now that I think about it...
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i think all arduinos traditionally come with a ~220? build-in resistor on pin 13. if you connect a LED to it you can take it as a debugging help in your program.
this will also show if your atmega is still alive because the bootloader blinks pin 13 on reset.

Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 1
Posts: 593
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
For one, isn't it designed to take in electricity for input?  And for another, how does electricity break an electrical device?
There is a limit to the amount of current the chip can 'source' (positive) and 'sink' (ground).
Usually they can sink more than they can source but thats a different story.

Its like using a thin PVC pile and using it for a high pressure mains connection.
The pipe will explode.

Microcontrollers and similar complex ICs are fragile.
Push them to the limit and the results are unpredictable.

Do you have a Decimilla? If so there is a led on pin 13 with a resistor.
Its a SMD LED. Basically look for a tiny yellowish rectangle below pin 13.
The other ones are resistors.
Logged

Pages: [1] 2   Go Up
Jump to: