Hello everyone,
I think I’ve run out of stamina on the search for the answer. I’m so close, but I just can’t make the connection.
I’m trying to make use of the CJMCU-36 analog airspeed sensor with Ardupilot:Plane on the Beaglebone blue.
This sensor offers an analog reading of .5v to 4.5v, which is way higher than the 1.8v maximum permitted by the ADC on the beaglebone (citation here in lower right corner of bullets regarding connections):
Easy connect JST interfaces for adding additional buses and peripherals including: GPS, DSM2 radio, UARTs, SPI, I2C, 1.8V analog, 3.3V GPIOs
I added a 1.5kOhm resistor on the analog signal line between the sensor and the board, and a 1kOhm resistor between the sensor and the board’s ground to reduce the analog output voltage to a max of 1.8v. I used this calculator to figure that out.
I’ve managed to figure out the device name of the ADC in the beaglebone and determine which pin is which:
Physical connection from Numo Silva’s graphic found near the top of this thread:
https://groups.google.com/forum/#!category-topic/beagleboard/ZXSTPIcV4OU
sysfs location of adc inputs
Info on how to find ADC device in linux sysfs
debian@beaglebone:~$ cd /sys/bus/iio/devices/iio\:
debian@beaglebone:/sys/bus/iio/devices/iio:device0$ ll
total 0
drwxr-xr-x 2 root root 0 Jun 1 20:46 buffer
-r--r--r-- 1 root root 4.0K Jun 1 20:46 dev
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage0_raw
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage1_raw
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage2_raw
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage3_raw
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage4_raw
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage5_raw
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage6_raw
-rw-r--r-- 1 root root 4.0K Jun 1 20:34 in_voltage7_raw
-r--r--r-- 1 root root 4.0K Jun 1 20:46 name
lrwxrwxrwx 1 root root 0 Jun 1 20:46 of_node -> ../../../../../../firmware/devicetree/base/ocp/tscadc@44e0d000/adc
drwxr-xr-x 2 root root 0 Jun 1 20:46 power
drwxr-xr-x 2 root root 0 Jun 1 20:46 scan_elements
lrwxrwxrwx 1 root root 0 Dec 31 1999 subsystem -> ../../../../../../bus/iio
-rw-r--r-- 1 root root 4.0K Dec 31 1999 uevent
The software path in linux to see raw values of the ADC shows that values are changing when I blow on the pitot tube (though more than 1 are changing, which seems unusual to me…)
while true; do cat in_voltage* | paste - - - - - - - - ; sleep 1; done
4074 3807 3940 2284 2596 2830 1665 3810
3148 3611 3953 2210 2727 2832 1718 3811
Configuring APM
APM Planner 2 provides a pin selection field and ranges fro 0 - 100:
This pinout table on the beaglebone github page seems to indicate the ADC pins range between 37-40.
Yet none of these pins results in a change of value on the HUD airspeed indicator.
So that’s where I’m stuck. I have analog voltage within spec entering the board and responding to polling, but I haven’t figured out how to tell APM about it.
Does anyone know what I’m missing here?
Thank you!