Show Posts
Pages: 1 ... 41 42 [43] 44 45 ... 68
631  Using Arduino / Sensors / Re: MPU 6050 Breakout board [HELP] on: August 01, 2012, 05:18:01 pm
To test it, you could use delays of 500ms.
Without the delays the servo gets the jitter, and the jitter is positioning it between 0 and 180.

Use my libraries? I don't know.
You need this guide, but that's still too complicated for me : http://arduino.cc/forum/index.php/topic,58048.0.html

You could reduce the sensitivity. In my sketch with writing to a register of the sensor, or with the functions of the Jeff Rowberg library.

You are not the only one that wondered about the raw values, so I added my own measurements from my sketch to the page about the MPU-6050: http://arduino.cc/playground/Main/MPU-6050 (in the "Measurements" section).
632  Using Arduino / Sensors / Re: MPU 6050 Breakout board [HELP] on: August 01, 2012, 01:26:57 pm
The raw values of my sketch look good.
The raw values do change, that's why some filtering or averaging is always needed.
So I guess that Jeff Rowbergs values are also good.

The gyro drifts, the accellerator jitters, it's all normal. Remember they are 16-bits values, a change of 50 is very little.

But the Jeff Rowberg library needs an interrupt.
The FIFO of the sensor is only read by the Arduino if the sensor signals an interrupt to the Arduino.
I think that the library uses INT0, pin 2.
http://arduino.cc/it/Hacking/PinMapping168
So you have to connect the 'INT' of the sensor breakout board to pin 2 of the Arduino.

So nothing is wrong, you are getting there.
633  Using Arduino / Sensors / Re: HELP: tri axis Accelerometer KXPB5 to arduino pin on: August 01, 2012, 11:58:07 am
According to the datasheet, also S0, S1, Aux_in, PD, ST should be tied to ground if they are not used.

You could tilt the sensor 90 degrees to the right, to the left, forward, backward and upside down. Do the values change ?
634  Using Arduino / Sensors / Re: MPU 6050 Breakout board [HELP] on: August 01, 2012, 11:55:16 am
Can you show a number of values ?
The sensor is 16-bit and very sensitive. If I put it on the table, the computer on my table causes vibrations (which I don't feel) that makes the values noisy/jitter. If I place the sensor on concreet, the values still do that, but not as much.
635  Using Arduino / Sensors / Re: HELP: tri axis Accelerometer KXPB5 to arduino pin on: August 01, 2012, 07:00:25 am
Did you look at the links. And did you read the datasheet of the sensor ?
I can read the datatsheet for you, and write what's in there, but you have to read it yourself.

There are two versions :
 - KXPB5-2050  (with analog outputs)
 - KXPB5-2353  (with digital interface SPI)

If the photo in your first post is the breakout board you have, you have the version with the analog outputs.
This pins are shown in Table 4 of the datasheet.
VDD = 3.3V  (the sensor is made for 3.3V but also 5V is allowed)
GND = GND
Vmux : this is a outputs, don't connect it.
S0, S1, Aux_in, PD, ST : connect to ground.
X_output, Y_output, Z_output : connecto to three analog inputs of the Arduino, like A0, A1, A2.



Next time, if you want to buy a sensor, check out these sites:
 - http://www.sparkfun.com/
 - http://adafruit.com/
636  Using Arduino / Sensors / Re: Led light sensor help... on: August 01, 2012, 04:24:47 am
There is no advantage of a digital input over an analog input.
But it is possible, and I used my analog inputs for other things.

To know the time, an interrupt intput could be used or the pulseIn function : http://arduino.cc/en/Reference/pulseIn
But I did a loop with to test if the input changed.
It turned out that my led needed somewhere between 4ms (very light) and 1200ms (very dark) to get rid of the charge.
637  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.
638  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.
639  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.
640  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.
641  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.
642  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
643  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.
644  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 ?
645  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
Pages: 1 ... 41 42 [43] 44 45 ... 68