Pages: 1 2 [3]   Go Down
Author Topic: Circuit Troubles  (Read 2802 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, after a quick bit of playing around, the only way I can get one device to work is if I touch the two legs of the Phototransistor together, which changes the RGB to blue, then if I let the legs come apart again, the RGB changes back to red.

I'm not quite sure what this means, however. Is the signal too strong for the Phototransistor? Or, do I need to find a matched pair of Phototransistor and Emitters and fit them in opposite circuits?

Bear in mind this is only a prototype and I'll be happy if only two devices work against each other smiley.



EDIT: Would something like 2 sets of these do?  smiley-confuse http://www.rapidonline.com/productinfo.aspx?tier1URL=Electronic-Components&tier2URL=Optoelectronics&tier3URL=Infrared-Devices&tier4URL=Matched-T1-infrared-emitter-and-phototransistor-pair&moduleno=29405



EDIT 2: Okay, so to test something out I removed the Emitter from one of the devices (the other device was switched off) and the Phototransistor was still detecting IR light, even when in a dark, secluded room. After this, and to ensure that the red light was not on constantly and was actually working using the IR light detection, I removed the Phototransistor from the circuit. After removal of both of the components from one device, the RGB LED did indeed glow blue. This leads me to believe that there is either a fault with the Phototransistor itself or with the detection code. Any ideas? smiley
« Last Edit: May 19, 2011, 06:30:17 pm by KugarWeb » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33374
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK now to plan B, like I said before:-
Connect your photo transistor not to pin 5 but to analogue input 0 (sorry don't know the pad number)
Then change this line of code:-
eye = digitalRead(sensorPin);
to
eye = analogRead(0);    // set eye to the light value we "see"
Serial.println(eye);    // look at the value
and finally change:-
  if (eye) {
to
  if (eye < 1000) {

Now run the code and see what numbers you get out of your sensor. Change the 1000 in the last line to a value between the maximum and minimum numbers you get or adjust it until it is as sensitive as you like.
Off for the weekend, catch up on Monday.
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK now to plan B, like I said before:-
Connect your photo transistor not to pin 5 but to analogue input 0 (sorry don't know the pad number)
Then change this line of code:-
eye = digitalRead(sensorPin);
to
eye = analogRead(0);    // set eye to the light value we "see"
Serial.println(eye);    // look at the value
and finally change:-
  if (eye) {
to
  if (eye < 1000) {

Now run the code and see what numbers you get out of your sensor. Change the 1000 in the last line to a value between the maximum and minimum numbers you get or adjust it until it is as sensitive as you like.
Off for the weekend, catch up on Monday.

Excellent! smiley-grin. It is now working as it should and I just need to make a couple of tweaks to the sensitivity and it'll be perfect smiley. Thank you so much for your help Grumpy_Mike! I'd still be banging my head against a brick wall I think  smiley-lol.
Logged

Pages: 1 2 [3]   Go Up
Jump to: