Show Posts
Pages: 1 ... 32 33 [34] 35 36 ... 269
496  Using Arduino / Microcontrollers / Re: Using a standalone relay with an arduino. on: June 06, 2014, 10:24:50 am
This tutorial shows how to hook up a relay to an Arduino
497  Using Arduino / Programming Questions / Re: Motor not spinning on: June 06, 2014, 10:06:57 am

I looked further in the project book and they apply a battery to the setup. So only the switching with the LEDs can be done by the arduino, but not the motor..


No, not quite true. The Arduino will do the switching of the motor, but indirectly. It will switch a transistor, which in turn will switch on the supply from the eternal battery.
498  Using Arduino / Programming Questions / Re: Motor not spinning on: June 06, 2014, 10:04:41 am
lets put a motor to it to make it more interesting.

You need to look at tutorials like this one. Two problems you have introduced are that the motor might have been trying to pull too much current so that could cause damage, and also the reverse spike when the motor stops can be huge. That's what the diode in the tutorial is for.
499  Using Arduino / Programming Questions / Re: Motor not spinning on: June 06, 2014, 09:46:49 am
Also looks to me that the switch is on a pull down resistor so pin 2 will be low when the button isn't pushed, so the leds and motor will be active before the button is pushed and stop when it's pushed.
500  Using Arduino / Programming Questions / Re: Motor not spinning on: June 06, 2014, 09:44:01 am
Where's the motor?

Looks to me it's the red and black going out to the right, since the red is on digital pin 6 via the yellow.

If you're not supplying external power to the motor and switching a transistor, it might not be getting enough current from the Arduino. Not a good idea to power a motor from the Arduino.
501  Using Arduino / Programming Questions / Re: Motor not spinning on: June 06, 2014, 09:22:56 am
Can you show the circuit so we can see that switch?
502  Using Arduino / Programming Questions / Re: How to use analog reading in array outside of the array. on: June 06, 2014, 08:36:47 am
Looks to me from this snippet:

Code:
for (unsigned char i = 0; i < NUM_SENSORS; i++)
  {
    Serial.print(sensorValues[i]);
    Serial.print('\t');
  }

...... that the readings are in an array called sensorValues, so if you want any one of them just do that with the index, eg sensorValues[2] or sensorValues[4] or whatever.
503  Using Arduino / General Electronics / Re: Placing resistor AFTER LED. Why? on: June 06, 2014, 07:34:27 am
The pics attached prove it by the way.

Grabbed the nearest resistor which was 470R and the pics show the same current (to 1 decimal of a milliAmp anyway) with the resistor "in front" or "behind" the LED.
504  Using Arduino / General Electronics / Re: Placing resistor AFTER LED. Why? on: June 06, 2014, 06:31:46 am
It doesn't make any difference. You can resist the flow anywhere- either side- and it won't matter. What goes in must come out, so the current is the same everywhere.
505  Using Arduino / Motors, Mechanics, and Power / Re: Solenoids turning on at startup of arduino on: June 05, 2014, 01:50:42 pm
I see a +
506  Using Arduino / Sensors / Re: Blood Leakage Detector on: June 05, 2014, 12:21:51 pm
Before you get to the circuit and code, how do you envisage this idea working?
507  Topics / Robotics / Re: Arduino Robot on: June 05, 2014, 12:16:02 pm
If I were you I'd disconnect everything except the servo, with the Arduino powered say thru your PC USB, and separate power to the servo. It would look like the attached but obviously just one servo. Load sweep. See what happens then.
508  Topics / Robotics / Re: Arduino Robot on: June 05, 2014, 12:01:42 pm
Yes i am supplying the Uno with 5V through the 5V pin........Something else to try?

For a start, I think you should follow the maker's instructions and not power it that way.
509  Using Arduino / Project Guidance / Re: The proper name of the button used in circuit on: June 05, 2014, 11:20:51 am
Can you tell me more about the better way to connect it you said ?

Here goes:

Have a look at at the button in your pic- you'll see the left hand connection goes to 5V. The right side goes both to the data pin and to ground through the resistor. That's what known as a pull-down resistor, and when the button isn't pushed it makes sure the data pin is forced to a known state, ie ground, 0V.

When the button is pushed, left and right get connected, and so the data pin is now connected to 5V thru the switch and to 0V through the resistor. The 5V side has no resistor so it wins that battle and the pin sees 5V.

BUT if you have a look at this example you'll see the Arduino has pull-up resistors built in so if you code like in that example, you don't have to mess around with external resistors.

The logic changes though: the way you have it, the data pin is at 0V usually and 5V when pressed; with a pull-up it's at 5V usually and 0V when pressed. So your coding has to be reversed to take acount of what was on is now off, and what was off is now on.

Pull-ups are seen as being better, and this approach is called active-low, meaning voltage goes low when you activate the switch.
510  Topics / Robotics / Re: Arduino Robot on: June 05, 2014, 10:57:57 am
Have I got this right: you're supplying the Uno with 5V through the 5V pin? That's really a power out pin....

Read this, which is from the Uno product page

Quote
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.

If that's how you did it you might like to rethink that.

I haven't checked all the circuit, but maybe you should try to get it to work a bit at a time. Comment out all the code except the servo code for example, and have only the servo connected; see if that works. (Edit... although that's not too easy given the structure of the code. Maybe load and run the sweep program to check the servo works on its own? Sweep is in the IDE: File>Examples>Servo)
Pages: 1 ... 32 33 [34] 35 36 ... 269