Show Posts
Pages: 1 ... 41 42 [43] 44 45 ... 68
631  Using Arduino / Sensors / Re: MPU-6050 on: July 31, 2012, 11:45:28 am
The first picture in this page shows how : http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter

But the Sparkfun breakout board has already 10k pull-up resistors.
You don't really need extra pull-up resistors, but 4k7 is better than 10k. So you could add two 10k pull-up resistors (10k parallel 10k becomes 5k).
But that's just an improvement. The breakout board should work if those 10k on the breakout board are soldered properly.
632  Using Arduino / Programming Questions / Re: Blink without delay for a set period on: July 31, 2012, 03:15:04 am
This a long thread: http://arduino.cc/forum/index.php/topic,115352.0.html
But you should look at some examples. In the second post of that thread I posted some links. Look at them to see if they can be of use for you.

I could look at your code, but I'm not sure what you want.

To answer your question about blink without delay: anything is possible.
633  Using Arduino / Motors, Mechanics, and Power / Re: Software Servo library vs ATmega 328 timers (Arduino Uno) on: July 31, 2012, 03:07:52 am
The Servo library uses a hardware timer of the avr chip, but the hardware timer only issues an interrupt and does not change any output pins.
Inside the interrupt, the function "handle_interrupts" is called. This function sets the outputs pins high or low for one or more pins.
http://www.arduino.cc/en/Reference/Servo
The tone() function and the SoftPWM use the same technique.

I'm not familiar with DC brushless servo motors.
Can you post a link where I can read about it ?
I have only used normal servo motors (0-180 degrees) and H-bridge drivers for DC motors.
Can those motors operate with a PWM signal ? If you use the function analogWrite, you use hardware timers with PWM output.
634  Using Arduino / General Electronics / Re: Relay Switching on: July 31, 2012, 01:48:22 am
The battery voltage changing from 10.9 to 14.8 is no problem at all. Not for the 7805 and not for the transistors and not for the relays.
But I would add a fuse. If your circuit accidently causes a shortcut, you don't want the wires to become hot glowing.

The TIP102 can do 8A continuously, and 15A peak according to the datasheet.
It is a darlington transistor, so it needs very little base current (good), but has a larger voltage drop (not a big problem).
You have to calculate the base resistor.
Suppose the load is 200mA. At 200mA the hFE is 900 (datasheet).
200mA / 900 = 0.22mA
For saturation 30% is added : 0.22mA * 1.30 = 0.29mA
The VBE could be 2.8V
So the resistor is (5 - 2.8 ) / 0.29mA = 7k6
Calculation (copy whole link) : http://www.google.com/search?q=%285-2.8%29%2F%280.2%2F900*1.30%29
But since the base current is allowed to be 1A, I would choose a resistor of 4k7 (or even 2k2).

Any "logic level" mosfet that can handle the current will do.
You can search Ebay for : logic mosfet
I have a bunch of RFP12N10L for this kind of loads, because they were cheap at that moment.
It is best to have a resistor from the Arduino to the gate of 1k for the capacitance of the mosfet.
And a resistor of 10k from the Arduino to ground, to keep it low during power up.

Using a transistor or darlington transistor is simpler, so I advise to start with that TIP102.
You could also use the TIP120, it's about the same as the TIP102 : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1218993473
I have checked the datasheet, and the base resistor calculation turnes out the be almost the same.

If you use a transistor or a mosfet, you need a flyback diode over the relay.
635  Using Arduino / Sensors / Re: ADXL335 and Arduino UNO R3 on: July 30, 2012, 08:51:59 am
The ADXL335 has 3 analog outputs and the Arduino Uno has 6 analog inputs.
So yes, you can connect two ADXL335 to the Arduino Uno.

That sensor needs 3.3V. So use the 3.3V pin on the Arduino Uno to power both sensors. The analog outputs of the first sensor could be connected for example to A0,A1,A2 of the Arduino Uno, and the analog outputs of the second sensor could be connected to A3,A4,A5.

After that, you don't have any spare analog input, and also a i2c bus is no longer possible. If you want more inputs and i2c you can always use the Arduino Mega (or even the Arduino Leonardo). Or you could use an analog multiplexer.
636  Using Arduino / Sensors / Re: pimg/sonar on: July 30, 2012, 12:14:42 am
A few links:

Parallax ping sensor : http://www.parallax.com/tabid/768/ProductID/92/Default.aspx
The instructable you use : http://www.instructables.com/id/RC-Car-to-Robot/?ALLSTEPS
HC-SR04 datasheet : http://www.micropik.com/PDF/HCSR04.pdf
ID-10T : http://www.urbandictionary.com/define.php?term=ID10T
Ping tutorial : http://www.arduino.cc/en/Tutorial/Ping

The 'New Ping' is compatible with both sensors : http://arduino.cc/forum/index.php?topic=106043.0
I don't know if the sensors are compatible, but you could just test it.
Or you could use code like in this page : http://www.robot-electronics.co.uk/htm/arduino_examples.htm#SRF04%20Ultrasonic%20Ranger
637  Using Arduino / Sensors / Re: MPU-6050 on: July 30, 2012, 12:03:16 am
Is this your sensor board : https://www.sparkfun.com/products/11028
If the I2C can't continue, perhaps something is keeping the line low. You might have mixed up the SDA and SCL, or the pull-up resistors are missing, or you use very long wires, or you accidently used ASCL and ASDA (which are for a second sub-i2c bus), or the voltage is wrong, or de sensor is damaged, or something else.
638  Using Arduino / Sensors / Re: Electrical to mechanical speedo on: July 29, 2012, 11:49:42 pm
You can place your code between the code tags. Use the '#' button (above the smileys when you are writing a message).
You can also copy an URL in the text, like this: http://arduino.cc/en/Reference/pulseIn

My first thought was to measure the number of pulses during a certain time, but measuring the pulse length is a smart idea. You get the speed immediate for every rotation of the wheel. If it is accurate enough ...
But I think that the diameter of the wheel does not influence the pulse length.

But I have many questions:
- If your sketch is not working, so what is not working ? Please be more precise.
- How is the magnetic switch connected to the arduino ? can you upload a schematic ?
- Is the magnetic switch some kind of reed contact, and not some fancy hall sensor ?
- You checked the inputs ? are you sure the magnetic switch is working ?
- Can you turn the led on and off with code ?
- Is the variable 'time' chaning if you rotate the wheel with different speeds ?
639  Using Arduino / Sensors / Re: MPU6050 SparkFun Breakout to Arduino Uno - No Communication on: July 29, 2012, 04:59:29 pm
...
Thanks for your very informative playground article
...
Would you mind checking your onboard regulator output, mine is 4.3V with 5V or 3.3V supply
...

I'm glad my sketch did help.

I have a good multimeter. My +5V is 4.95V and the 3.3V of the breakout board is 3.31V.
Also the XDA and XCL of the sub-I2C-bus pins are 3.31V (I think they have a pull-up somewhere).
My MPU-6050 is connected to the I2C via a level shifter, so I have not current flow from the I2C to the MPU-6050 voltage.
Can you measure the SDA and SCL (while not active), and check the XDA and XCL ?

Your breakout board has 10k pull-up resistors to the 3.3V.
That should be 4k7 to be safe.
I think that it might perhaps cause the higher voltage.
Can you add another two pull-up resistors of 10k from the SDA and SCL to the 3.3V of the Arduino board ?

The 4k7 prevents that the internal pull-up resistors in the avr chip (on the Arduino board) raises the voltage of the I2C too high for 3.3V devices.

I have added your GY-52 breakout board : http://arduino.cc/playground/Main/MPU-6050
640  Using Arduino / Programming Questions / Re: Time functions on: July 29, 2012, 12:20:14 pm
That's very interesting !
641  Using Arduino / Sensors / Re: Led light sensor help... on: July 29, 2012, 12:16:27 pm
In my case I used a digital input. So I check the digital input during that 4 ... 1200 ms.
In your case, you use the analog value. So 1000 ms is (far) too long I think. But that all depends on the led and the amount of light.

Since this is done with the capacitance of the led and the circuit is high impedance, every little electric noise will influence the reading. Your hands will probably introduce noise from the mains 50Hz or 60Hz into the circuit. The longer the delay, the more this is a problem.
642  Using Arduino / Programming Questions / Re: How to Convert Float to String with specific Format (Leading Zero,precision)? on: July 29, 2012, 12:09:33 pm
Use the sprintf format with a '+' for the sign, like so: %+5d
643  Using Arduino / General Electronics / Re: Sufficient power supply on: July 29, 2012, 10:34:51 am
The current is in Ampere: http://en.wikipedia.org/wiki/Ampere
So your adapter is 5 Volt and 2 Ampere ?

The Arduino Uno power socket is for 7 ... 12 Volts.
Can you get an adapter of 7 ... 12V ? An adapter of 500mA or 1A should be enough.
I use a 9V adapter for my Uno.

You can use an adapter of 5V, but you have to connect that to the +5V pin of the Arduino. That way you bypass the voltage regulator on the Arduino Uno board.
644  Using Arduino / General Electronics / Re: motor controller capacity on: July 29, 2012, 10:28:21 am
I don't know.
Google for: Infineon BTS 7970
It seems that this driver is discontinued. And the peak current is 68A, but I don't know what the continues current might be (probably depends on the heat sink). How sure are you that the BTS 7970 is under the heat sink, and not a lesser one ?
645  Using Arduino / Programming Questions / Re: How to Convert Float to String with specific Format (Leading Zero,precision)? on: July 29, 2012, 02:42:20 am
Well, you ran into a problem.

Normally the sprintf() function would do this, but the Arduino does not have the floating point enabled for the sprintf() function.
If you try this: https://gist.github.com/2343665 you will see that it prints a '?' for the sprintf() function.
You could enable the floating point for sprintf: http://srejbi.info/posts/16_arduino-printf-scanf-floats
Or you could write your own code, like these:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1164927646
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207226548/11#11

I hope someone else knows a better solution ...
Pages: 1 ... 41 42 [43] 44 45 ... 68