🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    TOF CAM Sensor

    Arduino
    4
    10
    11.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      cepics
      last edited by

      Hi all,

      can M5Stack "talk" serially with this sensor?

      datasheet say it needs a TTL UART interface:

      Baud rate 10 Mbit/s 1 bit = 0.1 µs
      Start bits 1 Bit low active
      Data 8 Bit
      Stop bits 1 Bit high active
      Parity No
      Voltage level LVTTL 3.3 V

      happy new year!!!

      ajb2k3A 1 Reply Last reply Reply Quote 0
      • lukasmaximusL
        lukasmaximus
        last edited by

        Hi just want to clear up if you are talking about the tof hat for stick c or the tof unit?

        C 1 Reply Last reply Reply Quote 0
        • T
          Thrasher
          last edited by

          Hi, according to datasheet it can.
          I mean, ESP32 which is M5stack based on can

          However, it needs to be tried with UIFlow.

          Can do with Arduino / Micropython most likely

          C 1 Reply Last reply Reply Quote 0
          • ajb2k3A
            ajb2k3 @cepics
            last edited by

            @cepics code probubly doesn't exist for it as the tofs are VL53 based.

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            C 1 Reply Last reply Reply Quote 0
            • C
              cepics @lukasmaximus
              last edited by

              @lukasmaximus I'm talking about this sensor module: TOF>cam 635 I need to talk with it serially. is it possible?

              1 Reply Last reply Reply Quote 0
              • C
                cepics @Thrasher
                last edited by

                @thrasher I'm in Arduino environment ..

                How can I set up a serial communication with this sensor?

                tnks a lot

                T 1 Reply Last reply Reply Quote 0
                • C
                  cepics @ajb2k3
                  last edited by

                  @ajb2k3 tnks for answering ..

                  for the moment I need just to send/receive commands/response serially....

                  1 Reply Last reply Reply Quote 0
                  • T
                    Thrasher @cepics
                    last edited by

                    @cepics should work with serial.begin(params)
                    Then use any com port software, teraterm or termite and try to "talk" with sensor

                    1 Reply Last reply Reply Quote 0
                    • C
                      cepics
                      last edited by

                      the sensor want:

                      Baud rate 10 Mbit/s 1 bit = 0.1 µs
                      Start bits 1 Bit low active
                      Data 8 Bit
                      Stop bits 1 Bit high active
                      Parity No
                      Voltage level LVTTL 3.3 V

                      can I try something like that?

                      
                      #include <M5Stack.h>
                      
                      #define RXD2 16
                      #define TXD2 17
                      
                      
                      void setup() {
                      
                        Serial.begin(115200);
                        Serial2.begin(10000000, SERIAL_8N1, RXD2, TXD2); 
                        Serial.println("Serial Txd is on pin: " + String(TX));
                        Serial.println("Serial Rxd is on pin: " + String(RX));
                      
                      }
                      
                      void loop() { 
                        while (Serial2.available()) {
                          Serial.print(char(Serial2.read()));
                        }
                        }
                      
                      
                      
                      
                      1 Reply Last reply Reply Quote 0
                      • T
                        Thrasher
                        last edited by

                        You need just one Serial;
                        Serial.begin(10000000);
                        //connect to proper TX<>RX pins of M5Stack

                        For proper debug you can connect sensor with any USB<>UART board and try to run it with any terminal software (I use TeraTerm)

                        If you want to debug derictly with M5Stack you will need Serial2 as your example shows, but keep in mind that if its a software serial, such high speed wont work properly most likely

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post