Show Posts
Pages: 1 ... 51 52 [53] 54 55 ... 68
781  Using Arduino / Sensors / Re: accelerometer angle reading on: June 28, 2012, 06:57:24 am
...trace angles and control the rotation of a motor...

Please tell us more how you plan to do this. An accelerometer does not measure the rotation of a motor. I can measure how much something is tilted.
782  Using Arduino / Motors, Mechanics, and Power / Re: HELP 4 motors 1 arduino on: June 28, 2012, 04:10:14 am
No, the schematic is a little confusing.
In my attachted drawing I use the same 12V power supply for the Arduino and the motor. But you could use two different power supplies, as long as both grounds are connected to each other.

You could buy a motor shield. Have you thought about that?
I had fun with an Ebay clone of the Adafruit motor shield : http://arduino.cc/playground/Main/AdafruitMotorShield
No soldering, but you need some program code to make it work.
783  Using Arduino / Sensors / Re: MPU6050 SparkFun Breakout to Arduino Uno - No Communication on: June 28, 2012, 03:52:11 am
...As far as i have understanded from the datasheet  ¿it auto calibrates to 0g right?, i mean, i don't need to substract any 0g value from my output ¿right?.

And at +-2g scale the sensitivity is 16384 LSB/g so, to get acceleration in g's, at 16bits, (rawAxis - 32767)/16384 ¿am i right?

My sketch is ment to give a quick start. On this page http://arduino.cc/playground/Main/MPU-6050 I mention to use the library by Jeff Rowberg for serious use.

The MEMS sensors are a great invention, but they have a large offset and the sensitivity is inaccurate.
Lucky for us, the sensitivity of the MPU-6050 is calibrated. The gyro sensitivity scale and the accelerometer scale are factory calibrated.
But not the offset (I can't read it in the datasheet).
So when using the raw values, the offset could be taken care of in software. Or by using the undocumented offset registers in the MPU-6050.
When using DMP firmware, the offset compensation could be in the firmware.

Accelerator with +/-2g range = 16384 LSB/g. So a value of 16384 is 1 g.
Get the accelerator value during setup(), and save it in rawOffset.
In the loop() get the value and calculate the 'g' value:
Code:
double g;
g = (double) (rawAxis - rawOffset ) / 16384.0;
And that for all 6 values (3 gyro, 3 accel).

During setup() the z-axis gets 1 'g' of the earth gravity. So you have to add 1 'g' after the offset compensation.
784  Using Arduino / Sensors / Re: MPU6050 + arduino nano + raw data over serial on: June 28, 2012, 03:16:17 am
I used a function to write multiple bytes, and used that to write a single byte.
For someone used to handle data and pointers is looks standard, but it looks weird the first time.

This is how it was:
Code:
uint8_t c;           // an unsigned character of 8 bits

c = 0x08;           // the value to write to the register

// Use address of 'c', by using '&c'.
// Third parameter if '1', that is the number of bytes to write.
MPU6050_write (MPU6050_GYRO_CONFIG, &c, 1);


But now I have added a function to write a single byte. Get the new code : http://arduino.cc/playground/Main/MPU-6050
It is now like this:
Code:
MPU6050_write_reg (MPU6050_GYRO_CONFIG, 0x08);
That's a lot easier.
785  Using Arduino / Sensors / Re: Linear potentiometer on: June 27, 2012, 07:52:19 pm
You could add some links, just copy the url in the message.
Is this your sensor : http://www.interlinkelectronics.com/Product/Force-Sensing-Linear-Potentiometer-FSLP  ?
Is it the same as the MicroNav Strip ?
The datasheet can be found by googling for "Force Sensing Linear Potentiometer (FSLP) Integration Guide".
http://media.digikey.com/pdf/Data%20Sheets/Interlink%20Electronics.PDF/FSLP_IntegrationGuide.pdf
http://akizukidenshi.com/download/ds/interlinkelec/94-00022+Rev+B%20FSLP%20Integration%20Guide.pdf

For example the Arduino Uno has 13 digital inputs/outputs (sometimes called GPIO = General Purpose Input/Output) and 6 analog inputs. The 6 analog inputs can also be configured as digital inputs/outputs.
I think you have to be able to switch between analog input and digital output for the sensor.

There are no analog outputs, but some digital outputs can be used with PWM to be able to dim leds, lights, motors, etc. What is PWM ?, see Wikipedia: http://en.wikipedia.org/wiki/Pulse-width_modulation

If a digital output is low, it's output is 0V. That's ground level.

A high impedance is a high resistance. If a pin of the Arduino is set as an digital or analog input, it's input resistance is extremely high. That's called "high impedance".

The 4k6 resistor is a used for a nifty trick to be able to be able to distinguish between position and pressure. It has to do with impedance and charge of the sensor. I don't understand how exactly it is done, but just follow the instructions.
You need only one Arduino. You have to implement both instructions in code to get the position and the pressure. They cannot be measured at the same time, but that's okay. A few milliseconds between them should be no problem I assume.

For example:
sensor pin 1 : connect to Arduino analog input, for example A0.
via Ro of 4k6 : connect to Arduino digital pin, for example 3  (pin 1 and 2 are used for Serial output to the computer).
sensor pin 2 : connect to Arduino digital pin, for example 4.
sensor pin 3 : connect to Arduino analog input, for example A1.
786  Using Arduino / Sensors / Re: MPU6050 SparkFun Breakout to Arduino Uno - No Communication on: June 27, 2012, 07:32:51 pm
Good!

My sketch http://arduino.cc/playground/Main/MPU-6050 should work now without any problem.
If the sketch needs more comment, or more explanation or so, please let me know.
For serious use, you could use Jeff Rowberg's library.
787  Using Arduino / Motors, Mechanics, and Power / Re: HELP 4 motors 1 arduino on: June 27, 2012, 07:30:14 pm
No problem.
The motor and the 'flyback' diode can be connected to 12V.
The ground of the 12V has to be connected to the ground of the Arduino.

The transistor gets it's base current from the Arduino (through a resistor), and it controls the motor which is connected to 12V.

Instead of transistors, resistors and flyback-diodes, you could use a ULN2803. The ULN2803 has the resistors and flyback-diodes build-in.
788  Using Arduino / Sensors / Re: Sonar range finders in ANALOG input pins or DIGITAL pins? on: June 27, 2012, 07:24:09 pm
If you have this: http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor than the output signal of the sensor is digital.
Every analog input can also be configured as an digital input or output.
789  Using Arduino / Sensors / Re: Digital Accelrometer, am I missing something? on: June 27, 2012, 07:21:32 pm
Sure they have I2C, it's pin A4 and A5 : http://arduino.cc/en/Main/ArduinoBoardLilyPad
790  Using Arduino / Motors, Mechanics, and Power / Re: 3 Position Servo (Window motor servo) on: June 27, 2012, 03:32:03 pm
I don't know what your question is.
Can you also provide some links for more information?
791  Using Arduino / Motors, Mechanics, and Power / Re: HELP 4 motors 1 arduino on: June 27, 2012, 03:27:28 pm
They use only little current, so the schematic with the transistor is a good solution.

The Arduino has a number of pins that are PWM capable. You need those pins.
If the motor is full on, and you use it with 12V, the motor gets about 12V (maybe 11.9V because of the voltage drop of the transistor). How fast they would run, depends on the motor.

The PWM output is able to change from 0 (completely off, output pin is 0V) to 255 (completely on, output pin is 5V).
792  Using Arduino / Sensors / Re: Digital Accelrometer, am I missing something? on: June 27, 2012, 01:33:08 pm
You need a better sensor.

This one is only 6 bits. Others are 10 to 16 bits.
You could average a few samples, which will smooth a motion. But for tilt detection, you can't get more than those 6 bits.
793  Using Arduino / Sensors / Re: MPU6050 + arduino nano + raw data over serial on: June 27, 2012, 08:57:40 am
The Wire.write() is a function, which is used during the I2C-communication: http://arduino.cc/en/Reference/WireWrite

In my sketch ( http://arduino.cc/playground/Main/MPU-6050 ) I have already made a function which you can use to write to a register of the MPU-6050, called "MPU6050_write()".
You could try to write a few registers. If you understand how to use it, you might try the library by Jeff Rowberg http://www.i2cdevlib.com/devices/mpu6050#source
794  Using Arduino / Sensors / Re: MPU6050 SparkFun Breakout to Arduino Uno - No Communication on: June 27, 2012, 03:51:42 am
You don't have I2C communication (or the sensor is broken).

I read that you already did the scanner sketch.
As I wrote in the other thread: I used this code by user RandallR for scanning. See here: http://arduino.cc/forum/index.php/topic,96952.msg738703.html#msg738703
Can you try the scanner sketch once more?
Do you have any other I2C device, to test the I2C bus with the scanner sketch ?
I use a I2C EEPROM to test the I2C bus, that chip operates at 3.3V, but also at 5V.

Is your AD0 soldered on the sensor board to either one (ground or 3.3V)? Just as in the photo of Obakemono ?


Meanwhile in the other thread, the pull-up resistors seem critical: http://arduino.cc/forum/index.php/topic,111698.msg840273.html#msg840273

795  Using Arduino / Sensors / Re: MPU6050 + arduino nano + raw data over serial on: June 27, 2012, 02:02:28 am
IT'S ALIVE!!!!!!!!!!!!!!!!!!!!
Congratulations!

Which it's the range of values of the gyro and accel? if it's in 16 bits, one bit for the sign and number between -32767 and 32767
Yes, that is the range.
You have to study the datasheet(s) for the sensitivity and the digital low-pass and high-pass filter.
Pages: 1 ... 51 52 [53] 54 55 ... 68