BlueWave Studio forum
Roadivox buttons and the ADS1115 - Printable Version

+- BlueWave Studio forum (https://bluewavestudio.io/community)
+-- Forum: OpenAuto Pro (https://bluewavestudio.io/community/forum-86.html)
+--- Forum: General (https://bluewavestudio.io/community/forum-81.html)
+--- Thread: Roadivox buttons and the ADS1115 (/thread-3043.html)

Pages: 1 2 3


Roadivox buttons and the ADS1115 - Daniel_BlueWave - 11-01-2021

We have this:
https://www.aliexpress.com/item/32996118505.html?spm=a2g0s.9042311.0.0.9e1d5c0fLxFMfS


RE: OpenAuto Pro version 14 is available - rpg100 - 11-16-2021

I already received the Roadivox buttons and the ADS1115  Smile

What is unclear to me is the wiring. I understand the box is connected to +12VDC  in the car and KEY 1 and KEY 2 to A0 and A1 respectively in the ADS 1115. Is it correct ?
Address to GND ?

Thanks for your support

Rafa


RE: OpenAuto Pro version 14 is available - BlueWave - 11-16-2021

This is how we wired buttons in our setup:

ADS1115 is connected to the Raspberry PI via I2C (SDA, SCL, +3V3, GND)
Receiver is connected to the +12V.
Key1 and Key2 of the receiver are connected to the A0 and A1 of the ADS1115. There is also 3V3 connected to the A0 and A1 via voltage divider (as ADS1115 measures voltage in fact) https://en.wikipedia.org/wiki/Voltage_divider.
GND of +12V is also connected to the GND of 3V3 (Raspberry PI) - common ground.


RE: OpenAuto Pro version 14 is available - Tremws - 11-17-2021

(11-16-2021, 09:25 PM)BlueWave Wrote: This is how we wired buttons in our setup:

ADS1115 is connected to the Raspberry PI via I2C (SDA, SCL, +3V3, GND)
Receiver is connected to the +12V.
Key1 and Key2 of the receiver are connected to the A0 and A1 of the ADS1115. There is also 3V3 connected to the A0 and A1 via voltage divider (as ADS1115 measures voltage in fact) https://en.wikipedia.org/wiki/Voltage_divider.
GND of +12V is also connected to the GND of 3V3 (Raspberry PI) - common ground.

Could you provide a diagram?  Seems simple enough...


RE: Roadivox buttons and the ADS1115 - Daniel_BlueWave - 11-17-2021

You can follow guide of the ADS1115 manufacturer: https://www.adafruit.com/product/1085


RE: Roadivox buttons and the ADS1115 - rpg100 - 11-18-2021

This is my initial investigation :
   

These are the resistances I could meassure.

Next steps :

- Identify expected voltages to be read in ADS1115 to estimate the values of the voltage dividers resistors.
- How initiate the controller service and read the voltage values
- Where is the configuration file to map voltages & keystrokes. Is it hardcoded ?

I´ll continue....

Raf

More info. This is the schematic as far as I can understand. Still need more data to calculate R1 and R2.  R3 is the resistance of the key pressed in the Roadivox devices. It could be a better choice to make the R3 parallel to R1 or remove R2.... I need more time.

CAUTION : I´ve not tested it . V+ is 3.3V in Raspi

I´ll make the drawing better once I have time to do. Could be a temporal solution meanwhile the investigation continues.

Raf


RE: Roadivox buttons and the ADS1115 - rpg100 - 11-24-2021

Almost there ... but still not working.

I did the connections  and had the readings attached. Openauto reacts but in an erratic mode. It is very close.....

What is the next ??
Any help ??
Attaching the config file in next post.

Raf

Crtl+F11 and p works.....

This is the conf file

Raf



[Controller]
; Type of the input device
; 1 - Audi MMI 2G panel
; 2 - BMW iDrive Gen 1 controller
; 3 - BMW IBUS
; 4 - Audi RNSE
; 5 - Rotary Encoder
; 6 - GPIO
; 7 - ResistiveButtons
Type=7

; Interface of the ADS11x5 converter
Interface=/dev/i2c-1

[ResistiveButtons]
; Type of the ADS converter
; 0 - ads1105; 1 - ads1115
AdsType=1

; Gain of the ADS converter
; 0 - Twothirds (6.144V);  1 -  One (4.096V); 2 - Two (2.048V); 3 - Four (1.024V); 4 - Eight (0.512V); 5 - Sixteen (0.256V)
AdsGain=0

; Sleep duration [ms] after each conversion (read) of the ads11x5 converter
AdsSleepTime=10

; Count of configured buttons
Count=2

; Configuration of first button
; Channel from which value of the button should be read
; 0 - A0; 1 - A1; 2 - A2; 3 - A3
Button_0_Channel=1

; Minimum value to consider button as pressed
Button_0_Min=8550

; Maximum value to consider button as pressed
Button_0_Max=16075

; Key stroke to trigger after detection of button press
Button_0_Key=Ctrl+F11

; Configuration of second button
Button_1_Channel=2
Button_1_Min=8520
Button_1_Max=17555
Button_1_Key=p


RE: Roadivox buttons and the ADS1115 - BlueWave - 11-24-2021

Quote:Button_1_Min=8520
Button_1_Max=17555

That does not look like proper config. In our case, the differences between min and max for particular button were around 10 units. If your ADS1115 reads e.g. 8550 value after press of + button, then you should set Min to e. g. 8530 and Max to 8570 - margin (20 units in the example) depends on e.g. stability of the voltage.

Try to change your config file as below (margin is 50 units for each button) and check if that helps

[ResistiveButtons]
; Type of the ADS converter
; 0 - ads1105; 1 - ads1115
AdsType=1

; Gain of the ADS converter
; 0 - Twothirds (6.144V);  1 -  One (4.096V); 2 - Two (2.048V); 3 - Four (1.024V); 4 - Eight (0.512V); 5 - Sixteen (0.256V)
AdsGain=0

; Sleep duration [ms] after each conversion (read) of the ads11x5 converter
AdsSleepTime=10

; Count of configured buttons
Count=2

; Configuration of first button
; Channel from which value of the button should be read
; 0 - A0; 1 - A1; 2 - A2; 3 - A3
Button_0_Channel=1

; Minimum value to consider button as pressed
Button_0_Min=8470

; Maximum value to consider button as pressed
Button_0_Max=8570

; Key stroke to trigger after detection of button press
Button_0_Key=Ctrl+F11

; Configuration of second button
Button_1_Channel=2
Button_1_Min=16680
Button_1_Max=16780
Button_1_Key=p



RE: Roadivox buttons and the ADS1115 - rpg100 - 11-24-2021

Thanks for your prompt response. If you open the attached file I embedded in the post, the ads1155 readings I included, are the readings I got with the ads11x5 reader tool included in your distribution. There is a huge multiplication factor....
The gain multiplier of the tool does not have any effect.... If I am not mistaken

I am using ads1115, where multiplying factors are quite different from ads1105, type 0 or 1 in the command line.

Comments welcome... And thanks


RE: Roadivox buttons and the ADS1115 - BlueWave - 11-24-2021

(11-24-2021, 08:49 PM)rpg100 Wrote: Thanks for your prompt response. If you open the attached file I embedded in the post, the ads1155 readings I included, are the readings I got with the ads11x5 reader tool included in your distribution. There is a huge multiplication factor....
The gain multiplier of the tool does not have any effect.... If I am not mistaken

I am using ads1115, where multiplying factors are quite different from ads1105, type 0 or 1 in the command line.

Comments welcome... And thanks

The value read by ads11x5reader is raw value. In order to convert convert it to the voltage, the below formula needs to be applied:

V = (RAW_VALUE * GAIN_VOLTAGE) / 32767
V = (17555 * 6.144) / 32767 = 3.29V
V = (8550 * 6.144) / 32767 = 1.6V
V = (13165 * 6.144) / 32767 = 2.47V

and so on. You do not need to convert it but just put raw value read from ads11x5eader for particular button to the ini file.