2017年2月24日星期五

LDR Camera in week 4

Having achieved single pixel camera for black-and-white and colour during the past several weeks, our goal this time was expanding the camera to 16 black-and-white pixels. At first, the multiplexer was needed given that 6 analogue ports in Arduino UNO was not enough. The testing circuit for 8-CHANNEL ANALOGUE MUX 4051 was shown in Figure 1, which was aimed to ensure the multiplexer to work as expected. 

Figure 1
Then, a 4*4 LDR array was built on the prototype board, together with 16 corresponding resistors and two 8-1 multiplexers. The surface and connection were shown in Figure 2 and Figure 3, respectively.  

Figure 2

Figure 3
Codes of Arduino and UNITY were modificated for this 4*4 pixels colour sensor circuit. In theory, when all 16 LDRs were covered, a black image conprised of 4*4 black blocks should appear on the screen while a white one is expected when all LDRs were exposed. The preliminary results were illustrated below in Figure 4. The left 8 LDRs were exposed and the right 8 LDRs were covered. It can be seen that the left 8 pixels on the screen presenting white while the right 8 pixels appearing to be approximately black.

Figure 4



However, there existing some differences between the pixels, for example, the black presented by 8 pixels on the right was not exactly same. There are multiple potential factors contributing to this error and one of them can be that the surface of 16 LDRs were not parallel to the prototype board perfectly. Thus, light intensity detected by every LDR varied when the light from one specific direction was placed. Hence, further calibration was necessary to reduce this error. 

2017年2月17日星期五

LDR Camera in week 3



We have finished black-and-white part last week and this time we continued to generate colour pixels based on RGB colour mode, which is an additive colour model where red, green and blue lights are mixed in various ways to produce colours. The circuit was constructed by multiple arrays of colour sensors, each of which was built by 3 LDRs covered with a single colour filter. By utilizing the colour filters, the LDR was able to detect light intensity of specific colours. In theory, zero intensity for every component contributes to the darkest colour (black) while full intensity of all gives a white. We started from one single colour image and used three different colour filters to cover the LDRs. The circuit built is shown in Figure 1. The cardboard here was used for fixing the filters and ensuring that LDRs were covered entirely. 

Figure 1
Some modifications were made to our Arduino and UNITY codes and the resulting primary colour camera was shown below.  It can be seen in Figure 2 that when we covered pixels for blue and green while only permitted light to pass through red filter, the colour displayed on UNITY screen was red. The same testing was conducted for colour blue and green, with the result shown in Figure 3 and 4, respectively. 
Figure 2-Red
Figure 3-Blue
Figure 4-Green
The test for single colour element was successful and we continued to examine mixed colour elements. It is known that addition of red and blue gives purple while red and green products yellow, according to RGB colour mode. Our testing results were within expectation and are shown in Figure 5 and 6.

Figure 5-Purple
Figure 6-Yellow
Furthermore, we decided to generate one more colour image. However, in practical experiment, we found that when the camera was used to detect one colour, the two output image in UNITY was not exactly the same. This can be caused by environment effects since the quality of “white” relies on the nature of primary light sources. Hence, we need to properly calibrate and balance to obtain a neutral white matching the system's white point. After the primary calibration, the results became a step closer to our expectation. However, it seemed that this calibration was still not effective enough since there were still some distinctions of two colour displayed. 

Hence, our plan for next week is to explore the calibration method further, meanwhile, apply the multiplexer CD4051 to expand analogue ports.

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. 



2017年2月5日星期日

LDR camera in week 1


Welcome to our project of exploring the ability to use LDR (light-dependent-resistor) as a camera. The basic principle is that the value of LDR alters with the variation of light intensity, hence, this variation can be detected and integrated to generate pixels (black-and-white or colour).

In this week, we collected the major materials we are going to use which are illustrated in Figure 1 and then figured out the principle of every component, including corresponding pin connection.


Figure 1
The first problem we encountered was how to transfer analogue variation of voltages into images, namely, how to present the colour to observers. We finally chose to use the software UNITY. The flow chart of this overall procedure is shown below in Figure 2. 

Figure 2
It is known that a real camera has many pixels for quality images. It is not practical for us to achieve so many pixels, hence, we decided to start from one black-and-white pixel in next week and then develop it gradually to generate more colour pixels.