To make it, you need the following
Tools and materials:
– LCD display 20×4 characters with i2C serial interface;
– OPL550 optosensor – 2 pcs; – IR LED OP240A – 2 pcs; – Suitable plastic box; – Arduino Nano; – Arduino expansion board Nano;
-Battery connector MN1604;
-Battery MN1604; -Two 5 mm push-button switches SPST N/O4; -SPST switch; -4-pole plug; -Wire; -Double-sided tape; -Heat shrink film; Step one: preparation of parts
First you need to prepare the parts for assembly. In the lid of the box, you need to cut a window for the LCD screen. Then you need to make several holes and install two buttons, a switch, a connector.
Step two: soldering
Now you can connect all the components. Solder the pins to the Arduino Nano and install the terminal block module.
Connect the battery connector and the power pushbutton switch following the diagram. Connects the battery power wires to the Vin screw terminal on the Arduino.
Connects buttons to the Arduino Nano module, A0, A1 and GND.
The plug has a 4-core cable. The cable must be pulled through the hole in the case and connected to the screw terminals, which are connected to the Arduino in the following order: green to the + 5V terminal, white to D11, yellow to D10 and black to the GND terminal.
Connects LCD to Arduino: GND – GND, Vcc – + 5V, SDA – A4, SCL – A5.
Step third: programming
Downloads the Chrono sketch to your computer. Connects the Nano to it. Selects the “old bootloader” option and the correct COM port for the board.
Before downloading, you need to check the installation of the libraries and line 177 of the sketch. If necessary, you need to change the distance between the sensors (default 60 mm).
Next downloads the sketch.
The module and battery can now be fixed in the case with double-sided tape, a 9-volt battery installed and the device turned on to test operation.
You may need to adjust the contrast using potentiometer on the LCD board.
By holding down the “up” button while turning on, you can enter the actual bullet weight.
Step fourth: sensor body
Now you need to assemble the sensor, which is attached to the barrel of the weapon. You can adapt this part as needed, the only criterion is to maintain a distance of 60 mm between the two infrared sensors (unless the sketch of the program has not been changed).
The diagram for the assembly of the sensor can be downloaded below.
The video shows the results device testing.