Show Posts
Pages: 1 ... 40 41 [42] 43 44 ... 68
616  Using Arduino / Networking, Protocols, and Devices / Re: Need help deciding which wireless connection to use! on: August 05, 2012, 04:50:18 am
433MHz or 2.4GHz.

Do you want to send and receive both ways, then I would use one of those small 2.4GHz boards.
I don't know if some of them can be placed in sleep mode.
617  Using Arduino / Networking, Protocols, and Devices / Re: Question about SDA/SCL settings in twi library on: August 05, 2012, 04:46:05 am
For I2C (using the Wire library) pull-up resistors are needed to make the I2C-bus work.
So the internal pull-up resistors are activated, although they are very weak (20k).

This is however a problem for 3.3V I2C devices, which can't have a pull-up to +5V.
So the most common solution is to use 4k7 external pull-up resistors to 3.3V for 3.3V devices.

But I would like to have to internal pull-up resistors removed.....
618  Using Arduino / Networking, Protocols, and Devices / Re: Leonardo communicate with Pro Mini 3.3v on: August 05, 2012, 04:42:32 am
If you use 4k7 pull-up resistors to 3.3V, it should work with I2C.
There is some information here: http://arduino.cc/playground/Main/I2CBi-directionalLevelShifter

I2C is not very fast, but since both SDA and SCL are used with open-collector, the 5V versus 3.3V is less of a problem than with other solutions.
619  Using Arduino / Sensors / Re: Sensor Calibration Scan after a Button Input on: August 05, 2012, 04:36:44 am
There are a lot possibilities. You could use a hardware timer, interrupts, interrupt service routines, etc.

But let's start to make it easy.
First of all, this code "while (millis() < 5000)" will only work if millis() starts at 0, so it is only valid at startup.
Make that code work at any moment:
Code:
unsigned long millis_now = millis();
while (millis() < (millis_now + 5000))

How do you set the initial values for  sensorMax0 and sensorMin0.
You could do it like this:
Code:
// set initial values
sensorValue0 = analogRead(sensorPin0);
sensorMax0 = sensorMin0 = sensorValue0;

// Find min and max
unsigned long millis_now = millis();
while (millis() < (millis_now + 5000))
{
  ...

Next, place the calibration in a function.
Code:
int sensorMin0, sensorMax0;
void Calibrate(void)
{
  ...
}

The sensorMin0 and sensorMax0 are globally, and can be used anywhere.
If you want the function to return them, you have to use parameters with pointers to integers.

Call the function at start, en when the butten is pressed.
620  Using Arduino / Programming Questions / Re: Arduino refrence example program on: August 05, 2012, 04:21:18 am
A boolean can be true or false, that's all.

Like this:
Code:
boolean sensor_active = true;
...
if (sensor_active)
{
  // the sensor is active
}

There a operators, which can be used. Like the NOT-operator (the '!').
Code:
if (!sensor_active)
{
  // the sensor is not active !
}

It is even allowed to make true false, and false true, using the NOT-operator.
Code:
sensor_active = !sensor_active;

So all you have to do, it say "NOT", if you see an exclamation mark.


621  Using Arduino / Programming Questions / Re: Dimming - what equation do you use to make dimming look linear to human eye? on: August 04, 2012, 01:12:12 pm
As far as I know, the human eye has a log10 for light intensity.
I think that's in the formula by x^10.

But there is a lot written about, with a lot of different calculations.
Even in this forum:
http://arduino.cc/forum/index.php?topic=69083.0
I looks to me that at the end, it's all in the eye of the beholder.
622  Using Arduino / Sensors / Re: Help needed with the MPU-6050. on: August 04, 2012, 04:37:41 am
The sketch compiles for a Duemilanove (both ATmega328 and ATmega168), but you have to update to the new Arduino 1.0.1 !

If you are new to I2C, try the i2c_scanner first : http://arduino.cc/playground/Main/I2cScanner
623  Using Arduino / Sensors / Re: Help needed with the MPU-6050. on: August 04, 2012, 03:43:48 am
The 'F()' only places the string in code memory (in flash), instead of RAM.
So if it is not working, just remove it like this: Serial.println("InvenSense MPU-6050");

If there is a problem with my sketch, I want to fix it!
Have you changed something in the sketch ?
Which Arduino board do you use ?
Are you using the newest Arduino. Version 1.0.1 ?
624  Using Arduino / Sensors / Re: Arduino and 433mhz receiver on: August 03, 2012, 06:38:36 am
I don't know, but I ordered that same receiver a few days ago for the same purpose. I also want to know the status of our alarm sensors.
625  Using Arduino / Sensors / Re: Arduino and 433mhz receiver on: August 02, 2012, 04:30:37 pm
There are chips for that with a certain protocol.
I doubt if the Arduino is able to recognize that.
I have looked for it myself, but have not found it yet.
626  Using Arduino / Sensors / Re: TCRT5000 + TLC5940 + Beer Pong on: August 02, 2012, 04:27:29 pm
You moved the sensor also to 12V, that's good. According to the datasheet the TCRT5000 can have 70V at the collector.

Resistor R3 and R4 don't have to be 6k1. They could be 10k or 22k or so.

I'm still not happy with it that the Op Amp is used to drive a rather large current.
At 12V, you could use CMOS logic, like the CD40106, instead of the Op Amp. In that case you would not need R3 and R4.
The CD40106 could drive a P-channel MOSFET for the leds.

627  Using Arduino / Sensors / Re: TCRT5000 + TLC5940 + Beer Pong on: August 02, 2012, 07:15:05 am
The voltage over a blue led is mostly about 2.8 to 3.6 Volt.
If you use 3 blue leds in series, you can't use +5V anymore.
Do you also have +12V ?
With +12V a single PNP transistor to supply current to the leds can't be used anymore. You need two transistors. And if you have two transistors, you could remove the Comparator.
628  Using Arduino / Sensors / Re: TCRT5000 + TLC5940 + Beer Pong on: August 02, 2012, 04:10:54 am
I hope someone else have a good idea how to do this easier.
My idea is to use an ATtiny per cup and with resistors for the leds.

Your explanation is even more confusing for me.
3 leds per TLC input -> output ?
Cathode to sensor -> anode ?
http://en.wikipedia.org/wiki/Light-emitting_diode
Perhaps adding a PNP transistor (and a resistor to the base) after the comparator will be enough to make it work. Although I still don't understand what you want the result to be.
629  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.
630  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).
Pages: 1 ... 40 41 [42] 43 44 ... 68