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. V_VOLTGEM EXAMPLE

V_VOLTGEM EXAMPLE

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 111 Views 2 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.
  • A Offline
    A Offline
    amkochaki
    wrote on last edited by
    #1

    Hello guys, I use mysensors with the home assistant and I'm having trouble using the library to read voltage. I have motion sensors connected to the analog ports of the mega arduino. I can't read the doors. Would anyone have an example?

    1 Reply Last reply
    0
    • TRS-80T Offline
      TRS-80T Offline
      TRS-80
      wrote on last edited by
      #2

      I am not sure I understand the problem. Are you saying that all the pins on your Arduino Mega are occupied ("I have motion sensors connected to the analog ports of the mega arduino") and thus you cannot access the analog pins?

      As far as examples, have you looked at Build main link in header?

      I am not sure how "I can't read the doors" factors in?

      1 Reply Last reply
      0
      • A Offline
        A Offline
        amkochaki
        wrote on last edited by
        #3

        Hello
        Let me explain further. I was using the mqtt protocol for communication between Arduino and HA, the digital ports I use for relays and switches, the analog ports I use for motion sensors. I decided to change my automation and use the mysensors library, this is working very well for relays and switches. I am having a hard time reading the analog pins for the motion sensors. I was not able to have any success with V_Voltage or S_Multimeter. So I would need help with this.

        TRS-80T 1 Reply Last reply
        0
        • A amkochaki

          Hello
          Let me explain further. I was using the mqtt protocol for communication between Arduino and HA, the digital ports I use for relays and switches, the analog ports I use for motion sensors. I decided to change my automation and use the mysensors library, this is working very well for relays and switches. I am having a hard time reading the analog pins for the motion sensors. I was not able to have any success with V_Voltage or S_Multimeter. So I would need help with this.

          TRS-80T Offline
          TRS-80T Offline
          TRS-80
          wrote on last edited by
          #4

          @amkochaki said in V_VOLTGEM EXAMPLE:

          the analog ports I use for motion sensors

          What kind of motion sensors are you using?

          The very common HC-SR501 type are digital. So if using digital type of sensors, I think it should just be a matter of setting the pin accordingly.

          But if using some motion sensors with analog outputs (do such things exist?) would be a different scenario. MySensors sketch is written for digital.

          A 1 Reply Last reply
          0
          • TRS-80T TRS-80

            @amkochaki said in V_VOLTGEM EXAMPLE:

            the analog ports I use for motion sensors

            What kind of motion sensors are you using?

            The very common HC-SR501 type are digital. So if using digital type of sensors, I think it should just be a matter of setting the pin accordingly.

            But if using some motion sensors with analog outputs (do such things exist?) would be a different scenario. MySensors sketch is written for digital.

            A Offline
            A Offline
            amkochaki
            wrote on last edited by
            #5

            @TRS-80 hello. My motion sensores are the same of my alarm system. Are connected on analogic pins. So I need that Arduíno read voltage of the sensores.

            zboblamontZ TRS-80T 2 Replies Last reply
            0
            • A amkochaki

              @TRS-80 hello. My motion sensores are the same of my alarm system. Are connected on analogic pins. So I need that Arduíno read voltage of the sensores.

              zboblamontZ Offline
              zboblamontZ Offline
              zboblamont
              wrote on last edited by
              #6

              @amkochaki You imply the sensor sends two different voltages, one for standby and one for active, perhaps you might establish what these voltages are for each condition.
              All your ADC is doing is measure the voltage, your sketch takes that value and converts that to a logical 1 or 0, standby/active.
              If the voltage swing is large, say 5v for stable and 1v for triggered, perhaps conversion via resistor divider can provide a logical 1 or 0 input simplifying the process ?

              1 Reply Last reply
              0
              • A amkochaki

                @TRS-80 hello. My motion sensores are the same of my alarm system. Are connected on analogic pins. So I need that Arduíno read voltage of the sensores.

                TRS-80T Offline
                TRS-80T Offline
                TRS-80
                wrote on last edited by TRS-80
                #7

                I am sorry but your reply is still not very helpful. In general I feel like this is an interrogation session in order to discover relevant information, making the whole process much more difficult than necessary. Please keep in mind that we know absolutely nothing about your system other than what you tell us, and if we instead substitute assumptions, that can lead us to wrong conclusions. In other words, please be more forthcoming with relevant information so we don't have to keep playing this cat and mouse game. :)

                @amkochaki said in V_VOLTGEM EXAMPLE:

                My motion sensores are the same of my alarm system.

                I don't think that you mentioned anything about what is your alarm system, how it works, etc. therefore this statement is meaningless (at least to me). Perhaps I missed something?

                @amkochaki said in V_VOLTGEM EXAMPLE:

                Are connected on analogic pins.

                Perhaps you are unaware, but the analog pins on the arduino can also be used as Genral Purpose Input Output (GPIO) pins, aka digital. So again, this statement still does not clarify whether your sensors are analog or digital...

                @amkochaki said in V_VOLTGEM EXAMPLE:

                So I need that Arduíno read voltage of the sensores.

                Yes, of course. But (at least to me) we still have not determined whether they are analog or digital... Both are measuring voltages, the question is how...

                Perhaps you are unfamiliar with difference between analog and digital? I don't like to assume anyone's knowledge level, which can lead to wrong conclusions. On the other hand, I don't want to insult anyone, either... ;)

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


                24

                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