Show Posts
Pages: 1 [2] 3 4 ... 143
16  Using Arduino / Programming Questions / Re: stop loop on: April 01, 2014, 09:46:40 pm
Setup runs once.

Code:
int n;
void setup()
{
   Serial.begin(9600);
for(n=0; n < 5; n++)
    {
        Serial.println(n);
    }
}

void loop()
{
}  

17  Using Arduino / Programming Questions / Re: Need Help with Piezo Buzzer and Ultrasonic Sensor code on: April 01, 2014, 09:35:33 pm
If I wanted to mount this sensor to a servo and use it for obstacle detection for a robot, then in your opinion what type of sensitivity would I need so the robot has time to properly maneuver?

Just have to experiment.

Good luck with your project.
18  Using Arduino / General Electronics / Re: Beginners questions on: April 01, 2014, 09:01:57 pm
I've got some really basic questions regarding the Arduino uno. I recently purchased one to start learning.
While fiddling with the breadboard i accidentaly short circuited pin 13 to ground and 5v power pin to ground for about 1-2 secs in both cases while trying to light up a red LED. Does this cause any kind off long term damage?
Most likely it will.

I think the circuits might overheat because of the high current but since it short circuited for such a short time is there any serious concern for these little mistakes?
You could perminantely damage the board.

Also to calculate the resistance needed for a Standard red led (1.7V 10mA) i need about 330 ohms, if i add another one the Vf will be higher (1.7v+1.7v) does that mean that the resistance will have to be smaller?
Yes.

What is the output voltage from the digital pins?
0 to 5 volts.

 And can i change it?
No.

Last question: In case of a short circuit in the arduino while connected to the PC is there any chance of damage to the pc?
Possibly, but depends what you do.

If any of these questions have already been answered i'm sorry   Thank you for your time
19  Using Arduino / Programming Questions / Re: Need Help with Piezo Buzzer and Ultrasonic Sensor code on: April 01, 2014, 08:57:19 pm
Make hysteresis = 0, what happens?
Make hysteresis = 10, what happens?

This could be referred to as sensitivity.
20  Using Arduino / Programming Questions / Re: Need Help with Piezo Buzzer and Ultrasonic Sensor code on: April 01, 2014, 08:55:18 pm
distance is the value that is measured EACH time trough the loop() this can be update thousands of times in a second.
lastDistance is the value you measured in a PRIOR loop (in a past ).
lastDistance is only update to the new value if there has been SIGNIFICANT movement.

What you are doing is comparing the current distance to a previous distance and, only if, they are different are you going to turn on the speaker.  If they are the same (within a range+-) the speaker is quiet. 

So in essence, the speaker will only beep if, A SIGNIFICANT CHANGE HAS BEEN DETECTED.
hysteresis is the variable that defines HOW MUCH you have to move towards OR away from the sensor before this can be called significant.
21  Using Arduino / Programming Questions / Re: Need guidance on programming technique on: April 01, 2014, 08:06:39 pm
Not sure what you are doing here but your indentation suggests you want to execute the two lines if the condition is true.
At the very end of the sketch:

if (flag_AquariumSensorDeviation == HIGH)
          lcd.setCursor(0,0);
          lcd.print("Temp Sensor Deviate");
Is not the same as:
if (flag_AquariumSensorDeviation == HIGH)
         {
          lcd.setCursor(0,0);
          lcd.print("Temp Sensor Deviate");
          }
22  Using Arduino / Project Guidance / Re: Arduino Pro Mini Connectivity and Power Questions on: April 01, 2014, 06:46:17 pm
You need to design the load on an output so it doesn't take more than 20ma.
If your o/p is driving a resistor load only and you need to have the full 20ma flow through it, then using ohms law:
(An o/p will go from 0V to 5V)
V/A=R   5/.02=250   
 Your resistor would need to be 250 ohms to get 20ma through it and therefore not damage the Arduino output.
Now you need to limit your load currents so the maximum package current does not exceed edit: 200ma.

23  Using Arduino / Programming Questions / Re: trouble applying blink without delay type code on: April 01, 2014, 04:47:44 pm
May be of some use:

Code:
const unsigned long TaskAtime  = 500UL;  //Runs TaskA every 1/2 second
const unsigned long TaskBtime  = 1000UL; //Runs TaskB every 1 second
const unsigned long TaskCtime  = 2000UL; //Runs TaskC every 2 seconds
const unsigned long TaskDtime  = 4000UL; //Runs TaskD every 4 seconds

unsigned long TimeA;                     //Times up, Task A time
unsigned long TimeB;                     //Times up, Task B time
unsigned long TimeC;                     //Times up, Task C time
unsigned long TimeD;                     //Times up, Task D time
// etc.



//==========================================================
void setup()
{
  TimeA = millis();                      //Initailize 
  TimeB = TimeA;                         //Initialize
  TimeC = TimeA;                         //Initialize
  TimeD = TimeA;                         //Initialize

  pinMode(13,OUTPUT);                    //
  pinMode(12,OUTPUT);                    //
  pinMode(11,OUTPUT);                    //
  pinMode(10,OUTPUT);                    //

} //        >>>>>>>>>>>>>> END OF setup() <<<<<<<<<<<<<<<<<


void loop()
{
  unsigned long millisNow = millis();

  //==================  Cooking Eggs
  if (millisNow - TimeA >= TaskAtime) //Is it time to run Task A?
  {
    TimeA = millis();                 //Re-initialize
    TaskA();
  }

  //==================  Making Toast
  if (millisNow - TimeB >= TaskBtime) //Is it time to run Task B?
  {
    TimeB = millis();                 //Re-initialize
    TaskB();
  } 

  //==================   Cooking Bacon
  if (millisNow - TimeC >= TaskCtime) //Is it time to run Task C?
  {
    TimeC = millis();                 //Re-initialize
    TaskC();
  } 

  //==================   Doing something else
  if (millisNow - TimeD >= TaskDtime) //Is it time to run Task D?
  {
    TimeD = millis();                 //Re-initialize
    TaskD();
  } 

  //==================

  //Other stuff goes here


} //        >>>>>>>>>>>>>> END OF loop() <<<<<<<<<<<<<<<<<



// FUNCTIONS
//==========================================================

void TaskA()
{
  digitalWrite(13,!digitalRead(13));   //Toggle pin 13
  //Other stuff

}

//==================
void TaskB()
{
  digitalWrite(12,!digitalRead(12));   //Toggle pin 12
  //Other stuff

}

//==================
void TaskC()
{
  digitalWrite(11,!digitalRead(11));   //Toggle pin 11
  //Other stuff

}

//==================
void TaskD()
{
  digitalWrite(10,!digitalRead(10));   //Toggle pin 10
  //Other stuff

}


//======================================================================
//                             END OF CODE
//======================================================================

24  Using Arduino / General Electronics / Re: How to use RS232 in that case? on: April 01, 2014, 03:36:04 pm
Are you using an UNO?
You can use Serial.print(ln) instructions.
If the Arduino is the DTE device, you may need to set RTS and/or DTR.
If the Arduino is the DCE device, you may have to set CTS and/or DSR.
25  Using Arduino / General Electronics / Re: MOSFET choise... on: April 01, 2014, 02:52:25 pm
Look for:
Logic-Level Gate Drive
Low value for RDS(on) (Ω),    IMO I like less than .1 Ohms(100 milli ohms) (lowest possible)
Drain-Source Voltage, to be greater than your power supply
Continuous Drain Current, to be greater than your load will require

I use WinQcad no longer available.
Try Fritzing, Eagle, Kicad OR search the forums as it has been discussed here many times.
http://fritzing.org/home/
http://www.cadsoftusa.com/
http://www.kicad-pcb.org/display/KICAD/KiCad+EDA+Software+Suite
26  Using Arduino / General Electronics / Re: MOSFET choise... on: April 01, 2014, 02:15:36 pm
See Image also:
Vgs(th) is 2.5V (page 2)
27  Using Arduino / General Electronics / Re: LED Indicators for bike schematic on: April 01, 2014, 01:55:58 pm
Is it OK with you to switch the ground in this application instead of the supply?
How are you powering the Arduino?
How many LEDS will be on the trailer?

Edit:
See attached image in the PDF
28  Using Arduino / Project Guidance / Re: Question about Atmega328 on: April 01, 2014, 01:46:15 pm
Some problems here, would you attach the code you are referring to?
Are you connecting a bread board chip circuit to PC computer?
29  Using Arduino / Motors, Mechanics, and Power / Re: My first 110v project - Water pump on: April 01, 2014, 01:40:30 pm
I would switch the HOT wire (smaller of the two plug holes) not the Neutral wire.
I would also connect the earth ground wire to the motor frame if it is recommended to do it.
You may find you need a contractor too switch that much current.
30  Using Arduino / General Electronics / Re: LED Indicators for bike schematic on: April 01, 2014, 01:28:32 pm
I think you are going to be taxing the maximum current that a pin can provide.
I'll draw up a drawing and post you my suggestions for changes.

Before I do this, are you using any other pins on the Arduino?
Pages: 1 [2] 3 4 ... 143