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. Hardware
  3. One Arduino with multiple functions

One Arduino with multiple functions

Scheduled Pinned Locked Moved Hardware
17 Posts 9 Posters 10.1k 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.
  • DvbitD Offline
    DvbitD Offline
    Dvbit
    wrote on last edited by
    #8

    I am a total newbie in arduino but I would guess that the only common pin among different attached sensors could be the ground one.
    The other pins transport sensor specific tensions levels (related to event for that specific sensor) so I uses you should use other pins and modify your sketch accordingly to monitor each pin for each function. All of that in the same main arduino polling loop.

    Experts please correct me if I am wrong .

    BulldogLowellB 1 Reply Last reply
    0
    • DvbitD Dvbit

      I am a total newbie in arduino but I would guess that the only common pin among different attached sensors could be the ground one.
      The other pins transport sensor specific tensions levels (related to event for that specific sensor) so I uses you should use other pins and modify your sketch accordingly to monitor each pin for each function. All of that in the same main arduino polling loop.

      Experts please correct me if I am wrong .

      BulldogLowellB Offline
      BulldogLowellB Offline
      BulldogLowell
      Contest Winner
      wrote on last edited by
      #9

      @Dvbit

      Thanks for the reply. From what I understand,these two pins are special, and are capable of serial communication via I2C. That protocol does allow for communications with multiple devices, but everything I have read are examples of like devices (e.g. multiple barometers) an they solve the problem of communication with some switch or multiplexing. This is because the master cannot talk to multiple devices, just one at a time.

      Since the barometer is an input device and the display is an output device, I would think I could connect them both without getting into complicated circuitry because the barometer will ignore the output from the Arduino and the LCD will not be transmitting back to the Arduino, just handshaking. But I really don't know...

      1 Reply Last reply
      0
      • greglG Offline
        greglG Offline
        gregl
        Hero Member
        wrote on last edited by
        #10

        Im in no way an expert.....;-) but...
        I dont think its got anything to do with input/output of an i2c device...its that each device will have an address on the bus.
        eg: my LCD uses a "byvac" 12c board... it has an address 0x21
        I have another LCD board with the address 0x27

        There is a sketch to show the addresses. (also some good info on i2c)
        http://playground.arduino.cc/Main/I2cScanner

        connect one device at a time and run the scannner... should show you each address.

        IIRC i can through some "out of my league commands" change the address of one of my LCD's ...never needed too though.

        I gotta ask ...why would you need to connect multiple barometers? one inside and one outside??

        BulldogLowellB 1 Reply Last reply
        0
        • greglG gregl

          Im in no way an expert.....;-) but...
          I dont think its got anything to do with input/output of an i2c device...its that each device will have an address on the bus.
          eg: my LCD uses a "byvac" 12c board... it has an address 0x21
          I have another LCD board with the address 0x27

          There is a sketch to show the addresses. (also some good info on i2c)
          http://playground.arduino.cc/Main/I2cScanner

          connect one device at a time and run the scannner... should show you each address.

          IIRC i can through some "out of my league commands" change the address of one of my LCD's ...never needed too though.

          I gotta ask ...why would you need to connect multiple barometers? one inside and one outside??

          BulldogLowellB Offline
          BulldogLowellB Offline
          BulldogLowell
          Contest Winner
          wrote on last edited by
          #11

          @gregl
          thanks. I think I'm on your page.

          i am using the barometer and want to add the LCD. They both use I2C. I hadn't thought about scanning the barometer, I did already scan the LCD (I had to to get it to display).

          Let me try that!

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tjay4x4
            wrote on last edited by
            #12

            Hi everyone,
            Thanks Hek for very interesting project!
            Could anybody write combined sketch for double "Pulse water meter" on one Arduino for hot and cold water meter?

            marceltrapmanM hekH 2 Replies Last reply
            0
            • T tjay4x4

              Hi everyone,
              Thanks Hek for very interesting project!
              Could anybody write combined sketch for double "Pulse water meter" on one Arduino for hot and cold water meter?

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

              @tjay4x4 said:

              Could anybody write combined sketch for double "Pulse water meter" on one Arduino for hot and cold water meter?

              Why not try it yourself?

              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
              • T tjay4x4

                Hi everyone,
                Thanks Hek for very interesting project!
                Could anybody write combined sketch for double "Pulse water meter" on one Arduino for hot and cold water meter?

                hekH Offline
                hekH Offline
                hek
                Admin
                wrote on last edited by
                #14

                @tjay4x4

                I suggest you don't use sleep-mode and try to create the sketch yourself by looking at the provided example. You will need to attach and use one of the other digitail input pins for the "extra" pulse sensor and duplicate some code (for presentation and reading of your new pin).

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tjay4x4
                  wrote on last edited by
                  #15

                  Couse I think many interested people could be beginers with arduino like me, and needs some examples to understand how to combine diferent sketchs on one Arduino. Of course if nobody answer I find "how to..."

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

                    Guess it is much easier if you try yourself and if you bump into problems you ask specific questions on what you find hard understand or can't solve yourself ;)

                    There are some good books on the basics of Arduino and programming. I linked a couple of them here:

                    http://www.mysensors.org/build/sensor_api#buying-guide

                    1 Reply Last reply
                    0
                    • T tjay4x4

                      Couse I think many interested people could be beginers with arduino like me, and needs some examples to understand how to combine diferent sketchs on one Arduino. Of course if nobody answer I find "how to..."

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

                      @tjay4x4 I completely understand.
                      Until about 3-4 weeks ago I did not even know what an Arduino was.

                      Yet, here I am creating a plugin for Indigo (I did not know about Indigo until about 8 weeks ago) and creating/testing very basic sensors.
                      Today I started creating my first 'home-grown' sensor and guess what: You have to try it to understand it :)

                      I know from experience that you can ask just about anything when you get stuck...

                      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


                      11

                      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