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

How often did you look at your sprinkles cake decoration, wondering how many pearls are left in the box? More seriously, did you even try to count how many mustard, basil, or pepper plant 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, leftover cardboard, a strip of LEDs, and a Raspberry P Zero with a camera might help satisfy your burning mathematical desire to enumerate minuscule objects.

This Instructable will share our en-lighting 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.

Supplies

  • Packaging cardboard. We have recycled the packaging from an Ikea furniture delivery.
  • Bricolage paper.
  • Glue: PVA glue or strong glue suitable for paper bricolage.
  • Scissors, cutting knife.
  • A Metallic ruler.
  • An Acrylic Perspex® Opal 050 Gloss sheet with a thickness of 3 mm and 148x105 mm in size.
  • A white LED strip 1 meter long 12 Volts. We have used one with three led x units, but other types should also work fine.
  • A 12V DC Male and Female Power Connector Adapter.
  • A PWM Speed Controller 3V-35V LED Dimmer with switch.
  • Electric wires and solder connect the led strip and the other electric parts.
  • Aluminium tape
  • Plastic tapes.
  • Raspberry Pi Zero W.
  • Raspberry Pi camera V1.2.
  • Power bench for the Raspberry Pi.
  • 3D printer.

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 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 with coloured tape to give a better, more esthetic appearance. Finally, the plastic diffuser has been fitted on the top of the LED cavity, as shown in the figure.

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 making one. This will prevent the slippery of the tweezer can damage the lens surface (as happened to us!).

When you rotate the lens clockwise, 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.

We have also used cardboard for the bridge. Figure 1 shows how the bridge was assembled with the sizes used for our prototype. You can adapt these sizes according to the focus of your modified Picamera. A hole with sharp edges is cut in the centre of the camera. The bridge's bottom part is lined with aluminium tape, as shown in Figure 2.

Step 6: 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, 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 might also need to check with a level if the camera is ideally in a 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 connected to a male power plug also powers them if used for a short period.

Step 7: 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 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 8: 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, which can be done by moving the bridge and the tray. The Xborder and Yborder sliders modify the marking 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 fine named as in the Filename entry.

The button Counting allows you to count the spherical objects in the tray. It is just an example of the possible use of computer vision to analyze the thing on the tray, and it is not difficult to implement other functions. Figure 3 shows an example of the use of the Analyze button to count the cake springles pearls.



Step 9: 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 realisation as we did!