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.
  • ? A Former User

    Hi,

    the so I have multiple digital pins on my arduino. Can I use one Arduino to serve as 4-relay and binary switch and tempsensor and PIR-sensor all at once?

    What about the sensor network. It is meshed, but is it also two-way like confirming that the relais really switched ON or is it just like those dumb 433MHz Sockets you buy at DIY-store? Once you send relais #7 switch ON, does the controller actually gets confirmation that the relais received the command and switched its state?

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

    @kellyjelly

    You can report data on up to 254 child sensors for each arduino-node. That is probably more than you ever gonna be able to attach to one node. :)

    Right now messages directed to a sensor/actuator from gateway is acked by the sensor (= the functionality you are requesting).
    In the next version of the library, sensors should also have the possibility to optionally send ack:ed messages to gateway and/or other sensors. This is especially important for gas-sensors and other "security"-sensors.

    1 Reply Last reply
    0
    • ? A Former User

      Hi,

      the so I have multiple digital pins on my arduino. Can I use one Arduino to serve as 4-relay and binary switch and tempsensor and PIR-sensor all at once?

      What about the sensor network. It is meshed, but is it also two-way like confirming that the relais really switched ON or is it just like those dumb 433MHz Sockets you buy at DIY-store? Once you send relais #7 switch ON, does the controller actually gets confirmation that the relais received the command and switched its state?

      jkaJ Offline
      jkaJ Offline
      jka
      wrote on last edited by
      #3

      @kellyjelly It's no problem having more than one sensor per radio unit. Each sensor must have a unique childId per radio unit.

      Each node holds a table with possible routing candidates, It will try all candidates in the same order each time (if the first one is down the next one is tried and so on...). The message is ack:ed so that the sender knows that the gateway received the value.

      (Henrik, correct me if I'm wrong)

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #4

        Sounds good, just what I wanted to hear actually.

        jkaJ 1 Reply Last reply
        0
        • T Offline
          T Offline
          twisted
          wrote on last edited by
          #5

          Just be careful and check each additional sensor as you add it. I wasted a lot of time fault finding something I would have found easily if I had tested one at a time. FYI I so far have combined quite a few different things successfully, but still struggle with the humidity and relays together for some reason.

          1 Reply Last reply
          0
          • ? A Former User

            Sounds good, just what I wanted to hear actually.

            jkaJ Offline
            jkaJ Offline
            jka
            wrote on last edited by
            #6
            This post is deleted!
            1 Reply Last reply
            0
            • BulldogLowellB Offline
              BulldogLowellB Offline
              BulldogLowell
              Contest Winner
              wrote on last edited by
              #7

              Hi everyone,

              I am trying to add an LCD display to a (working with my Vera) multi-Sensor with both a hygrometer and barometer. The barometer uses pins 4 & 5 of my nano and the LCD needs those two pins too. It is possible to just simply wire both of the devices to the I2C bus on pins 4 & 5? Do I need any andy specific additions to my sketch?

              Thanks!

              1 Reply Last reply
              0
              • 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