Introducing the Mini LED Table: Compact, Affordable, and Enhanced With Computer Vision

1.2K102

Intro: Introducing the Mini LED Table: Compact, Affordable, and Enhanced With Computer Vision

How often did you look at your sprinkles, wondering how many pearls are left in the box? More seriously, did you even try to count how many mustard, basil, or pepper plants you can grow from your seed bank? And what about the burning urge to know the exact number of one-millimetre stainless steel bearing balls you recently bought in your favourite DIY shop?

For this purpose, some leftover cardboard, a strip of LEDs, and a Raspberry P Zero with a camera might help satisfy your burning mathematical desire to enumerate these minuscule objects.

This Instructable will share our enlightening experience and the building details of a compact, battery-powered, easy-to-use, affordable mini LED table (MLT). We will also provide software for image acquisition and simple image elaboration for possible applications.

STEP 1: Cardboard Base

The device was built around the A6 perspex sheet used as a diffuser for the light table of the device. We have used cardboard sheets of different sizes recovered from Ikea furniture packaging to prototype the LED strip container and the support for the diffuser of the LED table. In the first Figure, the size of the cardboard sheet and the assembly orientation are provided. First, we used a cutting knife to get sharp edges. Then we used PVA glue to glue together the different parts. The rectangular cavity in the centre that accommodates the LED strips is lined using thin aluminium tape to make the surfaces reflective.



STEP 2: LED Lighting

We have used a 12 V LED strip to prepare the floodlights. First, we cut the strip into six segments composed of 4 units with three 3 LEDs each and stuck, as shown in the Figure, to the bottom of the cavity. The high number of LEDs per unit provides uniform lighting, but a different LED strip can also work. Next, as shown in the Figure, we connected the six parts by wiring the ends. A strip of transparent tape was stuck in correspondence with both ends of the segments to isolate the LED from the conducting aluminium tape tapering the bottom of the box. Finally, it connected one of the ends of the edging strip to two long wires. Then we covered the two ends of the strips with transparent tape to improve the adherence of the strips with the aluminium tape of the cavity bottom.

STEP 3: LED Dimmer and Power Supply Plug

The dimmer regulator was placed in a 3D-printed PLA box with a lid and an opening for the potentiometer and the connections to the LED strip and power connector wires.

STEP 4: Refining Light Table Surfaces

The cardboard on the surface of the light table has been covered with black bricolage paper, while the border is lined with coloured tape to give a better, more aesthetic appearance. Finally, the plastic diffuser has been fitted on the top of the LED cavity, as shown in the figure above.

STEP 5: The PiCamera and the Support Bridge

The Raspberry Pi Camera (version 1.1) we used must be modified to decrease the focus distance. This can be achieved by carefully rotating the lens.

The rotation can be accomplished using tweezers. However, we recommend covering the lens with plastic protection like the one in a newly bought camera or by making one. This will prevent the tweezer from damaging the lens surface (as happened to us!).

When you rotate the lens clockwise (as shown by the yellow arrow in the Figure), the focus distance will decrease so that the camera can focus on objects closer to the lens.

Conversely, when you rotate the lens in a counterclockwise direction, the focus distance will increase, which means that the camera can focus on objects farther away from the lens. A less than one turn rotation is sufficient for this device to reduce the focal to ~12-15 cm. However, I suggest operating with trial and error. If you do it carefully, you can modify this when it is in function and check the approximate focus distance with a ruler. Once you have determined the focal distance, you can scale the length of the camera-supporting bridge's height.

Then, you must first 3D-print the camera support file (CameraHolderOnly.stl). The camera is then screwed into the 3D-printed support to be inserted into the hole in the horizontal beam of the bridge.

STEP 6: The Support Bridge

We have also used cardboard for building the two later vertical piers and the horizontal beam of the bridge. The latter is joined to the piers using two 3D-printed supports. Figure 1 shows how the bridge was assembled with the sizes used for our prototype. The supports allow the horizontal beam to slide up and down to the focus of your modified Picamera.

To facilitate the beam's position, you can stick the rulers (print the file ruler.pdf and cut to match the shape of the cardboard) provided on the external surface of the piers, as shown in Figure 2.

A two cm diameter hole with sharp edges is cut in the centre of the horizontal beam, and the cylindrical guide of the camera is then inserted into the cardboard beam. A bubble level can be used to keep the horizontal beam's plane horizontal.

STEP 7: Adding Raspberry Pi and Battery Support

The Raspberry Pi Zero can be docked to the outer part of the bridge, as shown in Figures 1 and 2 and connected to a small power bank (e.g. 2000mA) for short-time usage. The Picamera, with a 3D case (the STL files can be found in our previous Instructables), is fixed on the top of the bridge in correspondence to the hole using some tape.

You should also check with a level if the camera is in a horizontal plane, correcting any dishevelling before calibrating the position of the field of view.

Once the camera is set in position, the field of view can be centred by moving the bridge while monitoring the image captured by the camera till it gives a centred picture, as shown in the next step.

Although the LED strips we have used are rated for a 12 V power supply, a small 9 V battery or a battery power bank connected to a male power plug also powers them if used for a short period.

STEP 8: Preparing a Tray for Holding Objects

We have prepared a tray to hold small objects. For this purpose, we printed a plastic squared frame and glued a transparent plastic sheet. Then, we added a black paper frame using cardboard to keep the tiny pearls in the centre of the frame. If the objects are small spheres, as are the sprinkles used in our experiments, you can add a piece of rectangular paper on top of the transparent plastic to increase the friction and reduce the rolling.

STEP 9: Computer Vision

We have developed a Tk-Python program (LEDtableV1.1.py) to interface for the Raspberry Pi to control the camera. The program uses the OpenCV library. Information on installing the library can be found in our previous Instructable and on the Internet. You can run it from the command line using the command:

python3 LEDtableV1.1.py

The interface shown in Figure 1 should appear if all the libraries are correctly installed.

By pressing the VideoMod button, it is possible to have continuous monitoring of the Picamera. To adjust its field of view, move the bridge and the tray. The Xborder and Yborder sliders modify the mark lines to help centre the camera's field of view (see Figure 2).

The sliders on the left side adjust the Picamera brightness, contrast and saturation.

The Capture button saves a snapshot in a file whose name can be assigned using the Filename entry of the interface.

The button Counting allows you to count the spherical objects in the tray. It is just an example of the possible uses of computer vision to analyse the object on the tray, and it is easy to implement it in other functions. Figure 3 shows an example of the use of the Analyze button to count the cake sprinkle pearls.


STEP 10: Conclusions

The MLT is a compact, portable, and inexpensive device. It is also an easy-to-build project that can be used to develop an educational tutorial to introduce construction, simple electronics, optics, and programming. The software provided can be easily improved by introducing other image-processing features that can be used for specific applications.


We hope you want to try to build one and enjoy the project as we did!



STEP 11: UPDATE

You might be interested in the new Polariser MLT accessory project:

https://www.instructables.com/Exploring-the-Material-Rainbow-Enhancing-the-Mini-/

Comments