2017年2月13日星期一

LDR camera in week 2


This week, we started to build the circuit and test the codes to generate one black-and-white pixel and then six pixels. The schematic diagram for a single pixel is given in Figure 1. From the diagram, it can be seen that the value of LDR will alter as light intensity changes, which in turn will contribute to the variation of output voltage. Besides, the circuit we built on the prototype board is shown in Figure 2, on which there are three pair of LDR and resistor.

Figure 1
 
Figure 2

Arduino here is applied to transfer and integrate these voltage variations into a txt file, and then output to the software UNITY. The detailed Arduino program is shown in Figure 3. 

Figure 3
Further, UNITY takes the parameters in the txt file as inputs and transfers the voltage variation into colour black, grey and white. The principle under this is that we divide the variation range into three parts and assign every part a specific colour, for example, the maximum value 5V representing black while the minimum value 0V representing white. The screenshot of UNITY major menu can be seen in Figure 4.

Figure 4 UNITY menu

Here we chose Black & White Mode to test four pixels on the prototype board, and the corresponding results for the pixel 0-4 can be observed below in Figure 5, 6, 7, 8, respectively.

Figure 5
Figure 6
Figure 7
Figure 8


While when the board was placed in the environmental light (no cover over the LDRs), the output image is shown in Figure 9, from which it can be seen all pixels at this time present approximately the same colour.

Figure 9

Hence, what we have achieved in this week was a simple black and white camera. We then decided to make some development, expanding it a 4*4 pixel array and also try to detect other colors based on RGB 3-element principle. However, We need to obtain some multiplexers first since six analogue ports of Arduino Uno are far from enough. 



1 条评论: