Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: LED as sensor on: July 09, 2011, 10:19:10 pm
When using an LED as a sensor, my experience has been that the LED will only respond to light from the same wavelength, and it actually has to be fairly close, so matched LEDs work best.  A red LED can be triggered by another red LED of the same wavelength or reflections from its own light, but not from an LED of another wavelength.  This causes problems if the LED acting as a sensor is in direct sunlight as it will produce sporadic results as the sun is full spectrum.  Also as pointed out above steer clear from LEDs with a colored diffuser, you will want a clear LED.

Hope that helps,
2  Using Arduino / Sensors / Re: Arduino locks when magnetic contact sensor is attached on: July 09, 2011, 10:10:32 pm
pwillard,

Thank you for the quick response . . . makes sense in hind sight.  You probably saved me at least a few more hours of troubleshooting something I would not have been able to change.
3  Using Arduino / Sensors / Arduino locks when magnetic contact sensor is attached on: July 09, 2011, 05:56:44 pm
I have connected a honeywell magnetic door contact to pin 10 on the arduino with a pull up resistor configuration.  1k Resistor from 5v through contact sensor to gnd, with pin 10 connected between the resistor and sensor.  Using a multimeter, I can verify logic high and low when the magnet is pulled away and placed near the sensor.  Pin 10 is setup as an INPUT.  I have a simple if pin 10 is low then do this loop.  The problem is anytime the sensor is activated via the magnet the arduino locks up and needs to be reset. If I move the same input to pin 5 there is no problem, everything works as it should.

#define alarmCheck 5//<----- Works when pin 5 does not work when pin 10
#define DATAOUT 11 //MOSI
#define DATAIN  12 //MISO
#define SPICLOCK  13 //sck
#define RTC_CHIPSELECT 7 // chip select (ss/ce) for RTC, active high
#define txPin 4  //Software Serial port for LCD display
#define UDTI 2 //Update Time Interrupt
#define UMEI 3 //Update MEnu Interrupt
#define ENC_A 8 //Rotary Encoder Pin A
#define ENC_B 9 //Rotary Encoder Pin B
#define ENC_PORT PINB

Is the way I defined the pins setting some setting on Pin 10 that I am unaware of?

Any ideas?
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Problems sinking current into digital I/O pins on: January 04, 2007, 07:18:15 am
Daniel,

Thanks for the help. . . works great, now that it is set as an output low.  I've spent days trying to figure this one out.  It would seem non logical (to me at least) to sink into an output, so I never would have thought about trying that.

Once again, thanks, I really appreciate the relief of frustration

Craig
5  Forum 2005-2010 (read only) / Syntax & Programs / Problems sinking current into digital I/O pins. . on: January 03, 2007, 11:12:35 pm
I'm trying to drive an LED from one digital pin and sink it into another however it does not seem to work.  I know this is not how an LED is typically driven, however I need to forward bias and reverse bias the LED so many times per second and this it the only way without additional circuitry.  I know that PIC's can do it and I'm sure the atmega8 can do it as well but not familiar with the code enough.  I read something in the atmega8 data sheet about a digital pin will sink 20ma at 5vcc, so I made sure that the current limiting resistor was large enough to keep me under 20ma.  I have a feeling it has something to do with the commands of the arduino.  Currently I use the pinMode(gndPin, INPUT) command to try to sink the LED into.  

So my question is first of all is it possible to source an LED from one digital pin and sink it into another?
If so, am I correct in saying that it must be under 20ma?
And lastly what commands will allow me to do this?

Thanks for any help in advance!
6  Forum 2005-2010 (read only) / Syntax & Programs / Anyone have or can give a good interupt tutorial? on: October 21, 2006, 05:15:04 pm
I've found what appears might be a tutorial on interupts, unfortunetly its in french (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?action=search2)

If some one has an english tutorial on interupts or can make a small one, it would be greatly appreciated.  I'm not familiar with the syntax enough to make heads or tails of the functions in the interrupt.h file.

Currently I have the arduino set up to listen for an input constantly, which is a waste of power, and poor programing, especially when you are running it for days straight.

Any help would be great, thanx.
7  Forum 2005-2010 (read only) / Interfacing / Re: Simple serial problem. . .hopefully on: June 23, 2008, 10:13:12 am
Thanks for the help.  So if I understand correctly the FTDI chip on the arduino takes care of the TTL to USB conversion.  The serial communications from the atmel can only communicate directly with another serial port using TTL.   Finally I need to convert TTL to RS-232 if I want to use the USB to serial adapter.

So one last question. . .any recommendations for a TTL to RS232 IC?

Thanks

Craig

8  Forum 2005-2010 (read only) / Interfacing / Re: Simple serial problem. . .hopefully on: June 21, 2008, 09:36:31 pm
pins 0 and 1 straight to db9 on the usb/232 adapter.  proper pins are grounded.  I did not use a level converting transceiver. . .didn't think I needed one.  Do I?

Thanks

On second thought the Belkin has a ADM211 chip which is a "+5V CMOS RS-232 200kBPS Transceiver with 4 Drivers, 5 Receivers" so that should take care of the transceiver i would think.

9  Forum 2005-2010 (read only) / Interfacing / Simple serial problem. . .hopefully on: June 21, 2008, 06:24:01 pm
I have two push buttons which when pressed send a set of commands out the serial port.  When the arduino is connected via usb cable and viewing the serial communications in hyperterminal everything looks great.  When I connect the arduino through the tx and rx pins to a usb to serial connector and view in the hyperterminal I get this "_aÖö+Ÿå" or this "_aÖö+™å" depending on which button is pressed.  Any ideas on what is going on here?  Bad usb to serial converter (I just bought it, a Belkin F5U109)?  Here is the code which I think is fine but just in case.

Thanks in advance for any help.  

int sensePin2 = 2;
int sensePin3 = 3;
int value2=0;
int value3=0;  



void setup() {
  Serial.begin(9600);
  // read from the sense pin
  pinMode(sensePin2, INPUT);
  pinMode(sensePin3, INPUT);
 
}

void loop() {
  value2 = digitalRead(sensePin2);
  value3 = digitalRead(sensePin3);
  if (value2==1) {
    Serial.print("A=01 M=0");
    Serial.print("\r");
    value2=0;  
   delay(1000);
  }
  if (value3==1) {
    Serial.print("A=01 M=3");
    Serial.print("\r");
    value3=0;
    delay(1000);
  }
  
}
10  Forum 2005-2010 (read only) / Exhibition / Re: Control Arduino with Universal Remote on: June 26, 2008, 10:38:52 pm
Is there a particular version of the Arduino IDE that this library works with, because I can't run the library with 0010 or 0011 without getting an Error building library "NECIRrcv" then it gives me the following:

In file included from C:\Documents and Settings\User\My Documents\arduino-0011\hardware\cores\arduino/WProgram.h:6,
                 from NECIRrcv.cpp:4:
c:/documents and settings/user/my documents/arduino-0011/hardware/tools/avr/bin/../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete.  Use <avr/interrupt.h>."
NECIRrcv.cpp: In member function 'void NECIRrcv::begin()':
NECIRrcv.cpp:15: error: 'TCCR2A' was not declared in this scope
NECIRrcv.cpp:20: error: 'TCCR2B' was not declared in this scope
NECIRrcv.cpp:25: error: 'TIMSK2' was not declared in this scope

Any ideas what is going wrong?

Thanks for the help in advance.
Pages: [1]