element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Smart Spaces Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Smart Spaces Design Challenge
  • More
  • Cancel
Smart Spaces Design Challenge
Forum DDS Elevator - Measuring up
  • Forum
  • Projects
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join Smart Spaces Design Challenge to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 39 subscribers
  • Views 52 views
  • Users 0 members are here
  • esp32
  • vl53l0x
  • FRDM-MCXN236
Related

DDS Elevator - Measuring up

balajivan1995
balajivan1995 2 days ago

Table of Contents

  • Introduction
  • TOF sensor
  • Interfacing multiple TOF sensor
  • Using ESP32 for interfacing with i2c
  • Failed Communication attempts
    • SPI interface
    • CAN interfacing
  • Conclusion

Introduction

Once the elevator starts moving, we need to know at which point the elevator should land and for that we need to measure the distance of the elevator from a fixed point. Since we will be designing for three elevators that will run side by side, we should aim to reduce the number of wirings as well. In this post, I will cover how we are going to measure the distance and the sensor arrangement.

TOF sensor

Typically, we could use Ultrasonic sensor, but I felt they are slightly bulky for this project and it needs a separate 5v for each node. So, I decided to use ToF sensors. ToF sensors are lot smaller, consumes less power and can be operated over I2C.

image

ToF sensors works in a way similar to ultrasonic sensor, except it measures the time it takes for IR/light to strike the target and reflect back.

image

In this project we will be using a VL530x based ToF sensor which can measure up to 200cm. We just need the sensor to read the distance accurately up to 40cm.

Interfacing multiple TOF sensor

Since we need 3 ToF sensors, we can’t interface them all directly we won’t have enough FlexComm peripheral for UART. So, I decided to use an I2C multiplexer. Using which we can connect up to 8 I2C devices.

image

image

My initial plan was to interface the I2C multiplexer with A153 board, unfortunately I could not establish the I2C communication between them. I have tried to port different libraries available, but none of them seemed to work.

Using ESP32 for interfacing with i2c

Since I have already planned to use ESP32 to transmit lift telemetry, I have decided to expand the scope of ESP32 by interfacing it with ToF sensors and transmit the distances to N236 board using UART.

image

image

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Failed Communication attempts

SPI interface

Even though I know it will take lots of wiring, I decided to give a try for SPI communication between N236 (master) and A153 (slave) boards. Although I could get the communication working between them, there was a lot of workarounds and required master to initiate the conversation always. Which became a bothersome point, I decided to drop A153 altogether. N236 is powerful enough to do the work of A153 board which originally just required monitoring sensors and GPIOs.

CAN interfacing

N236 board comes with a CAN transceiver. Since ESP32 supports CAN communication, I wanted to interface them together. I was actually surprised to see that I could recreate the "LoopBack example" provided by NXP. Unfortunately, I ran into issue with ESP32 this time. ESP32 has introduced some breaking changes with their latest release and my old which I used as reference started throwing multiple build errors. At the end, I decided to keep the communication simple and decided to go with UART interface.

Conclusion

This is my final forum post. So far, we have seen how the boards work, what are all the issues I have faced, and how to mitigate them. Throughout these trials and errors, I have to make changes in the original architecture I planned and adapt according to the new issues. In the last project article, we will conclude with our final demo model.

  • Sign in to reply
  • Cancel

Top Replies

  • colporteur
    colporteur 21 hours ago +1
    What are your plans for I2C from the sensor to the ESP32. I assume they will be some distance apart. I2C doesn't travel well if I recall Clems video How Far Can I2C Go? -- Episode 666
  • colporteur
    colporteur 21 hours ago

    What are your plans for I2C from the sensor to the ESP32. I assume they will be some distance apart. I2C doesn't travel well if I recall Clems video  How Far Can I2C Go? -- Episode 666 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube