-
1Gather the components; decide on a mounting.
Once you have the modules for the project (see the component list) actual assembly should be easy. You can use the frame I provide; or design something of your own, there is no reason why this has to be 3D printed, a perfectly viable chassis could come from cardboard and sticky tape.
The 5V motor is a very standard component, as is the H-Bridge driver it comes with. But ESP32 NodeMCU boards can vary a bit in size. The provided SCAD file allows easy adjustment for the board size + mount hole positions; the offset (gap) between adjacent components can also be adjusted . The ESP32 Board I currently use comes from Joy-IT and has holes on a 23.5mm x 47mm grid, with a board size of 29mm x 52mm.
The press fit for the sensor mount was a bit tight when I printed it, but dipping the PLA in some hot water softened it enough to make a good fit.
-
2Wire Up
Connect the units together as per the wiring in the description, I used Dupont connectors for ease of maintenance, take care with the wiring for the sensor.
This design does not use any sort of slip-ring, you need to leave a big enough loop to allow the cable to freely twist and bend as the sensor scans back and forth. It is a good idea to allow enough slack that forgetting to centre the sensor and having it twist a full turn should not break or stress anything.
ESP32 NodeMCU CMJU-531 (or equivalent) Comments D21 (GPIO21, I2C SDA) SDA I2C data D22 (GPIO22, I2C SCL) SCL I2C clock D5 (GPIO5) XSHUT Shutdown, Optional! D18 (GPIO18) GPIO1 Interrupt, Optional! 3v3 VCC Power GND GND Ground ESP32 NodeMCU H-Bridge Comments D27, D25, D26, D33
(GPIO27/25/26/33))Inputs 1,2,3,4 Any 4 available digital pins
will work for this.5V (USB) VIN + VMOT USB Power GND GND Ground I used some nice flexible ribbon cable, and used some colourful heat-shrink for effect.
Close the Logic/Power jumper on the Stepper Motor Driver if needed. Or you can drive the motor itself from an external 5V (or whatever) supply.
-
3Program the ESP32
The code is in the Github Repo, as are some requirement notes in the README.
I use the Arduino IDE for my development, but this will all work with other development environments, eg Expressif's own IOT development environment.
The three basic software requirements are:
- ESP development libs installed in a viable development environment: see https://github.com/espressif/arduino-esp32
- For the Arduino IDE the instructions are here.
- Sparkfun VL53L1X library: https://github.com/sparkfun/SparkFun_VL53L1X_Arduino_Library/
- ArduinoJson library (v1.6+): https://arduinojson.org/
There are no special requirements for memory etc when selecting the ESP board in the IDE.
For more please check the README on Github,
- ESP development libs installed in a viable development environment: see https://github.com/espressif/arduino-esp32
-
4Use
As the unit boots up it will dump some debug, sensor and WiFi status on serial. You can check the IP address and wifi status there.
By default you will have a password-less WiFi access point called VL53L1X-demo, and the WebUI will be on 192.168.4.1.
If needed; manually set the Sensor head to 'zero' before powering up, or after re-booting.
Press some controls, see what happens. :-)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.