I'm working on a photocell project and having some trouble with a sensor.
I'm using this sensor: AMBI Light Sensor – Modern Device to catch visible light.
The fact is that the output that I read from the analog connected to the output of the sensor seems insensitive to the variation of light.
It remains almost constant even with sharp changes (from total dark to light).
Since I'm a newbie in electronics, I think I'm doing something wrong in this issue.
Another problem is that the magnitude of the value may change whenever I move the entire system: sometimes around 600, sometime around 400.
Could it depend on the fact that i didn't soldered the sensor with the header pins provided in the package?
I mean: I used the pins provided in the package but didn't soldered them (thanks to Bill0 who made me notice that the previous sentence was not clear)
However I think that, once I keep the system stuck on a surface,the output should significantly change when I change the lighting.
Moreover the header pins themselves shake at the minimum touch.
Below the correspondence between the pins of the sensor and the analog pins of the arduino:
I also tried the code with the aliases of the sensor numbers A3, A4 and A5.
Moreover I measured the voltage at the pins: ground and power (+5V) look ok, even if at pin 4 I measured a Voltage of about 4.70V (little bit less than the nominal "HIGH" value 5V).
Can't understand if the issue is a different scale of voltage between the sensor and the arduino board.
Everything seems ok, at least in the configuration. Any idea on how to solve this problem?
I'm not using a photocell sensor like the one shown in the link.
Is your answer still valid for the sensor that I showed in the post AMBI Light Sensor – Modern Device ?
(I'm quite slow in understanding answer, please be patient )
I agree. He is assuming (I guess) plated through holes which may not be the case. Solder those header pins to the module.
Lefty
The pictures are taken from modern device website, however I think they should be clear.
I have a sensor and a three-header pin as shown in picture 1_STARTING_CONFIG.png (and, of course, an Arduino Uno rev. 3 board)
Should i solder the pins and the sensor as shown in picture 2_SOLDERED.png?
And then obtain something like what shown in 3_MOUNTED_ON_ARDUINO_BOARD.png? (even if the pictures shows an arduino 2009?)
At the moment I use the three header inserting their longer part in the holes of the sensor and then fitting them into the pins of the arduino each time I need it.
Yes, for sure. Solder the short end of the pins into the sensor board, then you can plug it into the Arduino properly as the longer end of the pin will make better contact with the Arduino socket.
Thanks to everyone. Now that I know the issue, I would like to ask if there are specific advices on soldering pins on boards of such a small size (around 1 cm^2) or if I can follow common guidelines found on the web. I have 4 sensor and would like to save each of them
Sure. Soldering through-hole with 0.1" (2.5mm) spacing should not be a problem with a small iron and solder.
Should i solder the pins and the sensor as shown in picture 2_SOLDERED.png?
If you achieve to get something similar, you're perfect. You'll probably have more solder around the pins
The usual web guidelines are rather about more difficult stuff like SMD soldering.
BTW: You are aware that you "abuse" two Analog Pins as GND and +5V supply; which is no problem with this sensor, if you do not need those analog pins for anything else.
michael_x:
BTW: You are aware that you "abuse" two Analog Pins as GND and +5V supply; which is no problem with this sensor, if you do not need those analog pins for anything else.
Actually I didn't consider this aspect, however for my project I need only that sensor on my board. Just in case of a "pin -demanding" project could I use an external power supply, connecting, for instance, the arduino to a demo board?
You can use the Arduino 5V, of course, just put your 3 pin sensor on a breadboard ( or wherever you have the other demanding hardware),
and connect the 3 pins individually to GND, 5V, and any Analog Pin.
I think a general guide line would be to always properly solder the appropriate connectors to any size board. The only time connections should not be soldered is when proper connectors, sockets or solderless breadboard are being used.