3D scanner v2

This is concept of cheap 3D scanner with lidar ( http://www.benewake.com/en/tfmini.html ), and Ultrasonic senzor HC-SR04  https://components101.com/ultrasonic-sensor-working-pinout-datasheet
I use Arduino Nano with CNC shield + A4988 driver for stepper motor.
Scanner write position (x,y,z) to SD card.

buttons for home H(orizontal), for home V(ertical), scan and stop.





for now:
this is first test build.
NOT work microstep, so 1 step is 1,8° (not good for scanner-working on)
lidar accuracy is not acceptable – see video
project finished…


– Arduino Nano
– CNC shield
– Lidar scanner (http://www.benewake.com/en/tfmini.html , http://wiki.seeedstudio.com/Grove-TF_Mini_LiDAR/ )
– Ultrasonic senzor HC-SR04 (https://components101.com/ultrasonic-sensor-working-pinout-datasheet)
– 2x stepper motor( NEMA 17 for 3D printer) + 2x driver (A4988 or DRV 8255)
– SD card module(https://www.amazon.co.uk/Micro-Adapter-Reader-Module-Arduino/dp/B00NNDBIRK ) + SD card
– 2x limit switch for endstop
– 4x micro buttons
– wires, breadboard, jumpers, …
– screws M3 and M2, nuts, washers
– Source 12V

1. Download files from Thingiverse (https://www.thingiverse.com/thing:3179502 )
Print files…

2. Build scanner, use pictures, video. it’s not complicate

3. Wiring


Item Arduino Pin CNC shield Pin
Motor H – Step D5 (5) Driver X – Step
Motor H – Dir D2 (2) Driver X – Dir
Motor V – Step D6 (6) Driver Y – Step
Motor V – Dir D3 (3) Driver Y – Dir
Enable Pin D8 (8) Driver X,Y – Enable
Button Home H A0 (14) Abort
Button Home V A1 (15) Hold
Button Scan A2 (16) Resume
Button Stop A3 (17) CoolEN
Lidar RX (white) A4 (18) SDA
Lidar TX(green) A5 (19) SCL
Lidar 5V 5V 5V
Endstop H D9 (9) X+
Endstop V D10 (10) Y+
SD card MOSI D11 (11) Z+
SD card MISO D12 (12) D12
SD card SCK(CLK) D13 (13) D13
SD card CS D4 (4) Driver Z, pin Direction
SD card VCC 5V 5V
Jumper switch(Lidar, or Ultrasonic) D7(7) Driver Z, pin Step


CNC shield is wrongly designed for microstepping. You need modify it:

4. test motors, if move to wrong direction, rotate cable to CNC shield.
Button Home H and Home V setup to default position.

When motors has wrong direction, rotate connector for 180°.


5. setup LIDAR
in rar archive is TF mini updater. connect only lidar to arduino as TTL (https://create.arduino.cc/projecthub/PatelDarshil/ways-to-use-arduino-as-usb-to-ttl-converter-475533 . only +5, GND, TX and RX to arduino. Run updater and update. Run WINCC_TF.exe , connect with serial and run config seqenction.

– send 42 57 02 00 00 00 01 02 to config mode
– send 42 57 02 00 00 00 00 1A for distance in mm
– send 42 57 02 00 00 00 03 11 for distance mode 0,5-5m
– send 42 57 02 00 00 00 00 02 for exit config mode

more info and config parameters is here: https://www.elecrow.com/download/TF-MINI-LIDAR-USER-MANUAL.pdf

6. SD card

Format card with SD formater https://www.sdcard.org/downloads/formatter_4/

7. Power up
Connect 12V to CNC shield, i use 3S lipol Accu or power source 12V.
after few second(initializing LIDAR and SD card), can you push buttons for homing. Button Scan start scanning and write position to SD card.

8. Ultrasonic senzor

Connect to board to position 18 a 19. you need connect jumper-head (pin 7). This activate ultrasonic mode in Arduino.

9. Arduino code and files

all files are here: scannerv2

code is commented, be carefully  and check the definitions twice, or arduino burn…





Komentáře jsou uzavřeny.