• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
ModalAI Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
    • Register
    • Login

    Voxl2 analog sensor interface

    Ask your questions right here!
    3
    8
    429
    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.
    • T
      tiralonghipol
      last edited by 19 Oct 2023, 09:22

      Hi,
      I do not see an ADC or similar pin on the Voxl2 to read an analog signal coming from a flex sensor
      is there any other way to achieve this? maybe the gpio pins on J19 ?

      thank you!

      M 1 Reply Last reply 19 Oct 2023, 14:20 Reply Quote 0
      • M
        Moderator ModalAI Team @tiralonghipol
        last edited by 19 Oct 2023, 14:20

        @tiralonghipol Correct, there is not an ADC input on VOXL 2

        T 2 Replies Last reply 23 Oct 2023, 10:19 Reply Quote 0
        • T
          tiralonghipol @Moderator
          last edited by tiralonghipol 23 Oct 2023, 10:20 23 Oct 2023, 10:19

          @Moderator awesome!
          I saw in the px4 drivers that the module i'm trying to read (ADS1115) is already supported
          what I plan to do, since I am not using pin 4 and 5 on J19 (sda,scl) is to read the adc instead of the gps.

          now the problem is that when I plug the ADC breakout board

          and i

          voxl2:/$ i2cdetect -r -y 0
               0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
          00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
          10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
          20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
          30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
          40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
          50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
          60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
          70: -- -- -- -- -- -- -- --  
          

          there is nothing on i2c-0.
          actually there is no register detected on 0,1,2 (3 should not be used)

          what am I doing wrong?

          the physical connection is [J19 <-> adc board]:
          pin 1 (5V) <-> Vin
          pin 4 (SCL) <-> scl
          pin 5 (SDA) <-> sda
          pin 12 (GND) <-> gnd

          T 1 Reply Last reply 24 Oct 2023, 07:01 Reply Quote 0
          • T
            tiralonghipol @tiralonghipol
            last edited by 24 Oct 2023, 07:01

            @Moderator
            Solved using the J5 connector instead!

            1 Reply Last reply Reply Quote 0
            • T
              tiralonghipol @Moderator
              last edited by tiralonghipol 24 Oct 2023, 09:03 24 Oct 2023, 09:01

              @Moderator
              so I am able to correctly read 2 flex sensors using a python library.

              But is it possible to achieve the same via the px4 driver itself? if yes, where should I look into?
              should I rebuild the voxl-px4 image enabling the ads1115 driver?
              I believe it is disabled by default, if I understood correctly

              just to give some context:
              let's say the arms of my quad are able to passively flex and I read the 4 deflection angles via this ADC.
              the ultimate goal I am trying to achieve is to send this analog information to the control actuator matrix and adapt it real time, taking into account the deflection

              Any help is highly appreciated thanks

              E 1 Reply Last reply 24 Oct 2023, 15:54 Reply Quote 0
              • E
                Eric Katzfey ModalAI Team @tiralonghipol
                last edited by 24 Oct 2023, 15:54

                @tiralonghipol That driver is not built or included in the px4 dsp build. So you would need to add that and then add it's start command to the /usr/bin/voxl-px4-start script file. You would need to specify -b 4 as an option to that start command to choose the proper bus.

                T 1 Reply Last reply 24 Oct 2023, 19:55 Reply Quote 0
                • T
                  tiralonghipol @Eric Katzfey
                  last edited by tiralonghipol 24 Oct 2023, 19:59 24 Oct 2023, 19:55

                  @Eric-Katzfey thank you Eric!
                  I figured out during our time-zone difference!
                  I was actually able to use the pins reserved for the mag
                  so I built the docker, added the driver, modified the start on the correct bus but now I am unsure: where are these values published? lol

                  ========== Starting ads1115 ADC ===========
                  INFO  [qshell] Send cmd: 'ads1115 start -X -b 1'
                  INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
                  INFO  [muorb] SLPI: qshell gotten: ads1115 start -X -b 1
                  INFO  [muorb] SLPI:   arg0 = 'ads1115'
                  
                  INFO  [muorb] SLPI:   arg1 = 'start'
                  
                  INFO  [muorb] SLPI:   arg2 = '-X'
                  
                  INFO  [muorb] SLPI:   arg3 = '-b'
                  
                  INFO  [muorb] SLPI:   arg4 = '1'
                  
                  INFO  [muorb] SLPI: *** I2C Device ID 0x904809 9455625
                  INFO  [muorb] SLPI: ads1115 #0 on I2C bus 1
                  INFO  [muorb] SLPI:  (external)
                  INFO  [muorb] SLPI:  address 0x48
                  INFO  [muorb] SLPI: 
                  
                  INFO  [muorb] SLPI: Ok executing command: ads1115 start -X -b 1
                  INFO  [qshell] qshell return value timestamp: 791748467, local time: 791750038
                  INFO  [uORB] Advertising remote topic sensor_baro
                  INFO  [qshell] Send cmd: 'sensors start'
                  INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
                  INFO  [muorb] SLPI: qshell gotten: sensors start
                  INFO  [muorb] SLPI:   arg0 = 'sensors'
                  
                  INFO  [muorb] SLPI:   arg1 = 'start'
                  
                  
                  

                  could be this one?

                  INFO  [uORB] Advertising remote topic adc_report
                  
                  E 1 Reply Last reply 25 Oct 2023, 15:55 Reply Quote 0
                  • E
                    Eric Katzfey ModalAI Team @tiralonghipol
                    last edited by 25 Oct 2023, 15:55

                    @tiralonghipol I have never used that sensor but from the code it looks like adc_report is indeed the data it is publishing.

                    1 Reply Last reply Reply Quote 0
                    1 out of 8
                    • First post
                      1/8
                      Last post
                    Powered by NodeBB | Contributors