Show Posts
Pages: 1 ... 41 42 [43] 44 45 ... 68
631  Using Arduino / Sensors / Re: TCRT5000 + TLC5940 + Beer Pong on: August 02, 2012, 02:06:42 am
The TLC5940 has a BLANK input, to switch off the leds. That should be used to switch the leds on and off.

Allthough the LM324N can output about 40mA, it is not ment to do that.
It is also a Op Amp, and you need a comparator instead of a Op Amp.
If you need to drive current, I think you better use a comparator with transistors. Or use only 1 or 2 transistors, without comparator.

But if you use the BLANK input, just a comparator (or even the LM324N) is okay.

The TCRT5000 can have 60mA for the led (IF), but the normal forward current for the the led of the TCRT5000 is 10mA. The forward voltage drop is 1.1V at 10mA. So (5V - 1.1V) / 10mA = 390 Ohm.
With the 100 Ohm in the schematic, the IF current for the TCRT5000 led is about 39mA, so that's okay.
632  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 :,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: (in the "Measurements" section).
633  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.
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.
634  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 ?
635  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.
636  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)
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:
637  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 :
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.
638  Using Arduino / Sensors / Re: MPU-6050 on: July 31, 2012, 11:45:28 am
The first picture in this page shows how :

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.
639  Using Arduino / Programming Questions / Re: Blink without delay for a set period on: July 31, 2012, 03:15:04 am
This a long thread:,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.
640  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.
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.
641  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) :*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 :
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.
642  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.
643  Using Arduino / Sensors / Re: pimg/sonar on: July 30, 2012, 12:14:42 am
A few links:

Parallax ping sensor :
The instructable you use :
HC-SR04 datasheet :
ID-10T :
Ping tutorial :

The 'New Ping' is compatible with both sensors :
I don't know if the sensors are compatible, but you could just test it.
Or you could use code like in this page :
644  Using Arduino / Sensors / Re: MPU-6050 on: July 30, 2012, 12:03:16 am
Is this your sensor board :
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.
645  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:

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 ?
Pages: 1 ... 41 42 [43] 44 45 ... 68