Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. How can I change a variable value 'on board'...

How can I change a variable value 'on board'...

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 2.4k Views 1 Watching
  • 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.
  • marceltrapmanM Offline
    marceltrapmanM Offline
    marceltrapman
    Mod
    wrote on last edited by
    #1

    I finally have all that I need to move on with my boards.

    One of my first desired sensors is my waterflow project to enable/disable a warm water pump.

    However, there is one very important variable that I need to fine-tune over time.
    Instead of having to attach my laptop each time I would like to do that 'on-board'.

    I was thinking about adding a double dip switch.

    switch 1 to enable a led to blink to help me when fine-tuning.
    switch 2 to enable changing the value.

    Question: what do I need?
    Is it a pot meter?
    If so how do I program it to change the value and what resistance do I need?

    I hope someone can help me to figure this out :)

    Fulltime Servoy Developer
    Parttime Moderator MySensors board

    I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
    I have a FABtotum to print cases.

    marceltrapmanM 1 Reply Last reply
    0
    • marceltrapmanM marceltrapman

      I finally have all that I need to move on with my boards.

      One of my first desired sensors is my waterflow project to enable/disable a warm water pump.

      However, there is one very important variable that I need to fine-tune over time.
      Instead of having to attach my laptop each time I would like to do that 'on-board'.

      I was thinking about adding a double dip switch.

      switch 1 to enable a led to blink to help me when fine-tuning.
      switch 2 to enable changing the value.

      Question: what do I need?
      Is it a pot meter?
      If so how do I program it to change the value and what resistance do I need?

      I hope someone can help me to figure this out :)

      marceltrapmanM Offline
      marceltrapmanM Offline
      marceltrapman
      Mod
      wrote on last edited by
      #2

      OK, part of this was too simple to even think of asking for an answer.

      The pot meter is implemented and it works as expected.
      The led is added with the dip switch for on/off (save current).

      Now a more important question:
      Will checking the value of the pot meter in the loop use (much) current?

      How would I reliably measure this?

      Fulltime Servoy Developer
      Parttime Moderator MySensors board

      I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
      I have a FABtotum to print cases.

      1 Reply Last reply
      0
      • hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by
        #3

        @marceltrapman said:

        Will checking the value of the pot meter in the loop use (much) current?

        If you have a multimeter you should be able to measure it.

        1 Reply Last reply
        0
        • C4VetteC Offline
          C4VetteC Offline
          C4Vette
          wrote on last edited by
          #4

          Or calculate: I=U/R
          Take care about how the pot is connected. If it is possible to turn it to zero it will become a shorted output pin!
          Found on the internet: "The microcontroller datasheet specifies an absolute maximum per-pin current of 40mA. With a typical internal resistance of only 25 ohms per pin, a dead short to ground can allow as much as 200mA of current to flow, more than enough to destroy the microcontroller output".

          marceltrapmanM 1 Reply Last reply
          0
          • C4VetteC C4Vette

            Or calculate: I=U/R
            Take care about how the pot is connected. If it is possible to turn it to zero it will become a shorted output pin!
            Found on the internet: "The microcontroller datasheet specifies an absolute maximum per-pin current of 40mA. With a typical internal resistance of only 25 ohms per pin, a dead short to ground can allow as much as 200mA of current to flow, more than enough to destroy the microcontroller output".

            marceltrapmanM Offline
            marceltrapmanM Offline
            marceltrapman
            Mod
            wrote on last edited by
            #5

            @C4Vette The one I am testing with can not be turned to 0 as far as I have seen but I will certainly check this with the ones for production.
            Can I simply add a resistor or do I have to do something else?

            Fulltime Servoy Developer
            Parttime Moderator MySensors board

            I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
            I have a FABtotum to print cases.

            C4VetteC 1 Reply Last reply
            0
            • marceltrapmanM marceltrapman

              @C4Vette The one I am testing with can not be turned to 0 as far as I have seen but I will certainly check this with the ones for production.
              Can I simply add a resistor or do I have to do something else?

              C4VetteC Offline
              C4VetteC Offline
              C4Vette
              wrote on last edited by
              #6

              @marceltrapman
              I would use a 10K pot.meter and connect the outer pins to +5 and gnd. Connect the pin in the middle to an analogue pin and use:
              val = analogRead(potPin) which will give you a value between 0 and 1023.

              marceltrapmanM 1 Reply Last reply
              0
              • C4VetteC C4Vette

                @marceltrapman
                I would use a 10K pot.meter and connect the outer pins to +5 and gnd. Connect the pin in the middle to an analogue pin and use:
                val = analogRead(potPin) which will give you a value between 0 and 1023.

                marceltrapmanM Offline
                marceltrapmanM Offline
                marceltrapman
                Mod
                wrote on last edited by
                #7

                @C4Vette Thank I will order one :)

                Fulltime Servoy Developer
                Parttime Moderator MySensors board

                I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
                I have a FABtotum to print cases.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                29

                Online

                11.7k

                Users

                11.2k

                Topics

                113.1k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • MySensors
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular