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.
    • tiralonghipolT
      tiralonghipol
      last edited by

      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!

      ModeratorM 1 Reply Last reply Reply Quote 0
      • ModeratorM
        Moderator ModalAI Team @tiralonghipol
        last edited by

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

        tiralonghipolT 2 Replies Last reply Reply Quote 0
        • tiralonghipolT
          tiralonghipol @Moderator
          last edited by tiralonghipol

          @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

          tiralonghipolT 1 Reply Last reply Reply Quote 0
          • tiralonghipolT
            tiralonghipol @tiralonghipol
            last edited by

            @Moderator
            Solved using the J5 connector instead!

            1 Reply Last reply Reply Quote 0
            • tiralonghipolT
              tiralonghipol @Moderator
              last edited by tiralonghipol

              @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

              Eric KatzfeyE 1 Reply Last reply Reply Quote 0
              • Eric KatzfeyE
                Eric Katzfey ModalAI Team @tiralonghipol
                last edited by

                @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.

                tiralonghipolT 1 Reply Last reply Reply Quote 0
                • tiralonghipolT
                  tiralonghipol @Eric Katzfey
                  last edited by tiralonghipol

                  @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
                  
                  Eric KatzfeyE 1 Reply Last reply Reply Quote 0
                  • Eric KatzfeyE
                    Eric Katzfey ModalAI Team @tiralonghipol
                    last edited by

                    @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
                    • First post
                      Last post
                    Powered by NodeBB | Contributors