electronic වැඩ්ඩ්නි, උදව්වක් දෙන්න.

ChamodhK

Well-known member
  • May 22, 2022
    2,068
    2,382
    113
    22
    මට raspberry pi pico එකකින් මෙන්න මේ joystick : https://www.duino.lk/product/joystick-breakout-module-game-controller/ එකෙන් දෙන output එක කියවන්න ඕනේ

    joystick එක 5 V වල ඔපෙරටේ වෙනව කියල තියෙන්නේ. ඒ වුනාට pi pico එකෙන් දෙන්නේ 3.3V, read කරන්න දෙන්න පුළුවන් max එකත් 3.3 V. මම බැලුවේ 5 V දෙන්නේ නැතුව 3.3 V දෙන්න. (read කරන්නේ voltage ඒක නිසා ප්‍රශ්නයක් වෙන එකක් නෑ කියල)

    ඒ වුනාට pico එකෙන් value ඒක හරියට read වෙන්නේ නැහැ. ( center position eke value eka 0 kiyala denne)

    මේ error එකට හේතුව joystick එකට 5V දුන්නේ නැති එකද?

    multimeter එකක් නැතුව විසදුමක් හොයන්න බැරි වෙයිද
    @tharakaf @AnuradhaRa @dilann
     
    • Like
    Reactions: eksudda

    tharakaf

    Well-known member
  • Oct 19, 2020
    36,364
    74,960
    113
    මට raspberry pi pico එකකින් මෙන්න මේ joystick : https://www.duino.lk/product/joystick-breakout-module-game-controller/ එකෙන් දෙන output එක කියවන්න ඕනේ

    joystick එක 5 V වල ඔපෙරටේ වෙනව කියල තියෙන්නේ. ඒ වුනාට pi pico එකෙන් දෙන්නේ 3.3V, read කරන්න දෙන්න පුළුවන් max එකත් 3.3 V. මම බැලුවේ 5 V දෙන්නේ නැතුව 3.3 V දෙන්න. (read කරන්නේ voltage ඒක නිසා ප්‍රශ්නයක් වෙන එකක් නෑ කියල)

    ඒ වුනාට pico එකෙන් value ඒක හරියට read වෙන්නේ නැහැ. ( center position eke value eka 0 kiyala denne)

    මේ error එකට හේතුව joystick එකට 5V දුන්නේ නැති එකද?

    @tharakaf @AnuradhaRa @dilann
    මගේ සබ්ජෙක්ට් එක නෙවී කොල්ලො, ඒත් bump එකක් මගෙන්
     
    • Love
    Reactions: ChamodhK

    AnuradhaRa

    Well-known member
  • Dec 25, 2010
    62,061
    1
    43,470
    113
    මල්ටි මීටරයක් තිබුණ නම් ලේසියි නේද

    3.3 වඩා වැඩි අගයක් එන්නෙ නෑනෙ ඉතිං...

    3.3 වත් පෙන්නන්නෙ නැද්ද?
    කීයද උපරිමේ පෙන්නන්නෙ?

    මැදට 1.65 වගේ එනව ඇති

     
    Last edited:

    NEMISIS

    Well-known member
  • Nov 13, 2013
    11,400
    19,550
    113
    Colombo
    joystick එක 5 V වල ඔපෙරටේ වෙනව කියල තියෙන්නේ. ඒ වුනාට pi pico එකෙන් දෙන්නේ 3.3V, read කරන්න දෙන්න පුළුවන් max එකත් 3.3 V. මම බැලුවේ 5 V දෙන්නේ නැතුව 3.3 V දෙන්න. (read කරන්නේ voltage ඒක නිසා ප්‍රශ්නයක් වෙන එකක් නෑ කියල)

    above assumption is correct. this module should work regardless of the voltage.

    this is just two potentiometers, worst case you should be able to read these values with the ADC. however reading this with the ADC could become complicated because you might want to implement some normalization logic, as these are not very precise.

    how did you try to read this?
    any library/code samples?
     

    AnuradhaRa

    Well-known member
  • Dec 25, 2010
    62,061
    1
    43,470
    113
    joystick එක 5 V වල ඔපෙරටේ වෙනව කියල තියෙන්නේ. ඒ වුනාට pi pico එකෙන් දෙන්නේ 3.3V, read කරන්න දෙන්න පුළුවන් max එකත් 3.3 V. මම බැලුවේ 5 V දෙන්නේ නැතුව 3.3 V දෙන්න. (read කරන්නේ voltage ඒක නිසා ප්‍රශ්නයක් වෙන එකක් නෑ කියල)

    above assumption is correct. this module should work regardless of the voltage.

    this is just two potentiometers, worst case you should be able to read these values with the ADC. however reading this with the ADC could become complicated because you might want to implement some normalization logic, as these are not very precise.

    how did you try to read this?
    any library/code samples?
    මැදට 1.65V වගේ එනව ඇති
     
    • Like
    Reactions: ChamodhK

    S.GUNE

    Well-known member
  • Feb 21, 2019
    3,776
    5,750
    113
    උබ mention කරලා තියන එකෙක්වත් ඔය field එක ගෑන දන්න උන් නෙමේ.
    @NEMISIS මතක් කරන්න හැදුවා විතරයි.

    මම cording පට්ට එක ලොකුවට ම කරලා නැහැ බන්. Pin ටික හරියට සෙට් උනානම් signal එක read කරන්න ඕනේ. හැබයි cording හින්දා නොහිතන error එන්න පුළුවන්. සමහර විට ආයේ දාලා බලපන් කෝඩ් ටික. හරි යයි.

    මැදට 1.65V වගේ එනව ඇති
    උබ verac එකක් වැඩ කරන හැටි වත් දන්නවාද මෙතන ඔපීනියන් දෙන්නේ?
    ------ Post added on Jul 19, 2025 at 2:10 PM
     

    AnuradhaRa

    Well-known member
  • Dec 25, 2010
    62,061
    1
    43,470
    113
    උබ mention කරලා තියන එකෙක්වත් ඔය field එක ගෑන දන්න උන් නෙමේ.
    @NEMISIS මතක් කරන්න හැදුවා විතරයි.

    මම cording පට්ට එක ලොකුවට ම කරලා නැහැ බන්. Pin ටික හරියට සෙට් උනානම් signal එක read කරන්න ඕනේ. හැබයි cording හින්දා නොහිතන error එන්න පුළුවන්. සමහර විට ආයේ දාලා බලපන් කෝඩ් ටික. හරි යයි.


    උබ verac එකක් වැඩ කරන හැටි වත් දන්නවාද මෙතන ඔපීනියන් දෙන්නේ?
    ------ Post added on Jul 19, 2025 at 2:10 PM
    ඔව් බං මං මොකුත් දන්නෙ නෑ
    උඹ තමා සේරම දන්නෙ :ROFLMAO:
     
    • Like
    Reactions: ChamodhK

    ChamodhK

    Well-known member
  • May 22, 2022
    2,068
    2,382
    113
    22
    joystick එක 5 V වල ඔපෙරටේ වෙනව කියල තියෙන්නේ. ඒ වුනාට pi pico එකෙන් දෙන්නේ 3.3V, read කරන්න දෙන්න පුළුවන් max එකත් 3.3 V. මම බැලුවේ 5 V දෙන්නේ නැතුව 3.3 V දෙන්න. (read කරන්නේ voltage ඒක නිසා ප්‍රශ්නයක් වෙන එකක් නෑ කියල)

    above assumption is correct. this module should work regardless of the voltage.

    this is just two potentiometers, worst case you should be able to read these values with the ADC. however reading this with the ADC could become complicated because you might want to implement some normalization logic, as these are not very precise.

    how did you try to read this?
    any library/code samples?
    Thank you so muchh..

    I just tested with a normal linear potentiometer (B5K) and the result is not linear for that as well. I used both Micropython and C/C++ SDK to test this and most of the times it returns the maximum value (65535). So I guess I have messed up soldering and probably the ADC unit is damaged.

    Here is the Micropython code and the result. Similar result with C/C++ sdk too : (

    Code:
    Python:
    from machine import ADC
    >>> adc = ADC(1)
    >>> import time
    >>> while True:
        print(adc.read_u16())
        time.sleep(0.5)


    result (left to right) - (B5k Potentiometer)

    65535
    65535
    59214
    53052
    49868
    51964
    52908
    32759
    32759
    16371
    49164
    49164
    65535
    65535
    65535
    65535
    65535
    65535


    I am trying to implement a pitch bend for a MIDI Keyboard with the joystick.

    PS : I soldered the pin headers myself and I am not very sure about the way I soldered but there is no apparent bridges between the headers.
    ------ Post added on Jul 19, 2025 at 2:24 PM
     
    • Like
    Reactions: Asmodeus

    AnuradhaRa

    Well-known member
  • Dec 25, 2010
    62,061
    1
    43,470
    113
    රාස්බෙරි සීන් මම දන්නෙ නෑ මල්ලි, මං ඕව යූස් කරල නෑ
    කෝඩ් දැනුමත් ලොකුවට නෑ මට

    ඒ වුණාට මල්ලි කරන වැඩේ ගැන බලන්න ආස හිතුණ

    A B5k potentiometer, when used with a Raspberry Pi, provides a variable resistance ranging from 0 to 5000 ohms. This resistance can be used as an input to the Raspberry Pi's analog-to-digital converter (ADC) to control various aspects of a project, such as volume, brightness, or motor speed.
     

    aruna1

    Well-known member
  • Apr 22, 2008
    10,896
    6,767
    113
    38
    Galle
    Thank you so muchh..

    I just tested with a normal linear potentiometer (B5K) and the result is not linear for that as well. I used both Micropython and C/C++ SDK to test this and most of the times it returns the maximum value (65535). So I guess I have messed up soldering and probably the ADC unit is damaged.

    Here is the Micropython code and the result. Similar result with C/C++ sdk too : (

    Code:
    Python:
    from machine import ADC
    >>> adc = ADC(1)
    >>> import time
    >>> while True:
        print(adc.read_u16())
        time.sleep(0.5)


    result (left to right) - (B5k Potentiometer)

    65535
    65535
    59214
    53052
    49868
    51964
    52908
    32759
    32759
    16371
    49164
    49164
    65535
    65535
    65535
    65535
    65535
    65535


    I am trying to implement a pitch bend for a MIDI Keyboard with the joystick.

    PS : I soldered the pin headers myself and I am not very sure about the way I soldered but there is no apparent bridges between the headers.
    ------ Post added on Jul 19, 2025 at 2:24 PM
    check if there are pullups in the rasp board
     

    ChamodhK

    Well-known member
  • May 22, 2022
    2,068
    2,382
    113
    22
    joystick එක 5 V වල ඔපෙරටේ වෙනව කියල තියෙන්නේ. ඒ වුනාට pi pico එකෙන් දෙන්නේ 3.3V, read කරන්න දෙන්න පුළුවන් max එකත් 3.3 V. මම බැලුවේ 5 V දෙන්නේ නැතුව 3.3 V දෙන්න. (read කරන්නේ voltage ඒක නිසා ප්‍රශ්නයක් වෙන එකක් නෑ කියල)

    above assumption is correct. this module should work regardless of the voltage.

    this is just two potentiometers, worst case you should be able to read these values with the ADC. however reading this with the ADC could become complicated because you might want to implement some normalization logic, as these are not very precise.

    how did you try to read this?
    any library/code samples?

    check if there are pullups in the rasp board

    use voltage divider,


    ADC unit eke VREF eke prashnayak thiyee (soldering ප්‍රශ්නයක් වෙන්න ඕනේ බොහෝ දුරට) බෝඩ් එකේ VREF එක පිටින් දෙන්න පින් එකක් තිබ්බ මන් ඒකට 3.3V දුන්නම හරි ගියා (20 -4085 range එකේ linearවිදියට වෙනස් වෙනවා axes දෙකම )


    Reply කරපු හැමෝටම ගොඩක් ස්තුතියි....
     
    • Love
    Reactions: NEMISIS