One Arduino with multiple functions



  • 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?


  • Admin

    @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.



  • @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)



  • Sounds good, just what I wanted to hear actually.



  • 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.



  • This post is deleted!

  • Contest Winner

    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!



  • 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 .


  • Contest Winner

    @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...


  • Hero Member

    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??


  • Contest Winner

    @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!



  • 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?


  • Mod

    @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?


  • Admin

    @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).



  • 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..."


  • Admin

    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


  • Mod

    @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...


 

276
Online

8.2k
Users

9.1k
Topics

96.6k
Posts