Big project in my opinion

Hi Arduino Lovers and Dev's.

First, sorry if im confusing or mis-spelling, my English is getting quite old.

I've got this big project in mind, not sure how to describe it, but here it goes.

I want to make some simple 'clients' with arduino NANO (v3), and have one master controller, and i want them to talk to each other with nRF24l01.

Description of clients:
All Arduino Nano's are equipted with one nRF24l01, one relay, and one DS20B18.

The master controller:
Is an arduino board, not sure wich yet, it should have one nRF24l01, some buttons, an display of some kind (Maby an I2C controlled display?) and one RTC for time accarucy.

The master arduino should keep track of:
-> time
-> clients
-> temperature

So if i tell master arduino that client 01 should keep heat at 22 Deg Cel from 20:00 evening to 08:00 morning, and rise 1 Deg Cel each 30 minut, then client 01 should turn on relay from DS18B20 readings.

Seams and sounds very hard, i've got most components and modules at the moment, only missing an display of some kind.

I use a lot of time with arduino normaly, and wouldn't say im beginner, nor an expert.
I program a whole lot in my sparetime to (Mostly PHP and some shell in linux) so im not completly lost.

Thow i could use some help getting started.
Im currently trying each module, with some of my boards, for testing and getting to know the modules and how they work.

Also i work alot with DesignSpark PCB for PCB designing, so the end result should be more 'proffesionel' ending.


Can anyone guide me?
I've got 10-12 hours a week for this project.

Thanks & Regards:
Danni Hansen - Denmark.

I'd recommend that you just get it working on a breadboard before you decide to design and make a PCB etc.

So first, make a list of all the sensors, radios and relays etc you need.
Check that there are Arduino libraries for the devices you have chosen.
Check that those devices don't use the same arduino pins and software features as each other.

When you are sure that you have all the data on each component, and that you understand all the libraries.

Order the parts

Build the whole lot on a breadboard.

Write the code using the libraries to interface to the Temperature Sensor, RTC and Radio etc.

(Actaully to start with, don't bother with the radio, just hard code the temperature and time and make sure it works)

Then integrate your radio system (at the same time you need to build and test your Master unit)

Anyway, its totally practical to do this.

you may want to check out MySensors.org if you are at all comfortable Python/Raspberry Pi, or think you could be.

you wouldn't be so limited on what you could display compared to an LCD and the sensor network has been developed extensively.

I agree with rogerClark, very do-able and you will have a lot of fun putting this together!

Yes, it seams very nice idea. The goal is warm the house, right? If you came home at 18:00 you want your house warm before you arrive, right?
If you are a linux user, why don you use (like BulldogLowell said) a Raspberry Pi to the master? Maybe you don't want to use 2 platforms, but can be easy for you. To keep time you use the system clock, and then you can attach an LCD and the RF module.

Hey again and thanks for repleys :slight_smile:

The ideá is to controll virvariums, thow i later would like to use it for home automation.

At this moment im playing with 2 arduino nano's with nRF24l01, and using the lib, and "GettingStarted.ino" in arduino IDE.
http://arduino-info.wikispaces.com/nRF24L01-RF24-Examples

The setup is from the link BulldogLowell provided:

Seams like it failes.. :confused:

Any ideá how to coutinue?

Seams like it failes.. :confused:

Please explain what you mean.

If you followed the examples correctly, and it does not work, then you have a hardware fault.

However its far more likely you have made a mistake.

Double check everything.

Danni-Hansen:
The setup is from the link BulldogLowell provided:
Connecting the Radio | MySensors - Create your own Connected Home Experience

Seams like it failes.. :confused:

Any ideá how to coutinue?

That system relies on a gateway aduino attached to a Raspberry Pi. Were you able to get the gateway together already?

meanwhile, you can get two arduinos talking with one of the RF libraries available for your arduino and the NRF24l01 radio.

I only now went take a look to the http://mysensors.org/, and Wow!
Very nice work, BulldogLowell! Congratulations!

Like I said before, I think that is better idea to have something "stronger" than Arduino controlling the net, and then have an inexpensive Arduino in each node (like at the first glance, is the idea of the BulldogLowell's project).

luisilva:
I only now went take a look to the http://mysensors.org/, and Wow!
Very nice work, BulldogLowell! Congratulations!

Like I said before, I think that is better idea to have something "stronger" than Arduino controlling the net, and then have an inexpensive Arduino in each node (like at the first glance, is the idea of the BulldogLowell's project).

It is a great, but it isn't my project. Rather a group of guys from Scandinavia/EU/USA. They put it all together and it has grown. They are constantly updating the libraries and improving...

I only contribute my devices for DIY home automation projects.

The key, as you pointed out is the Gateway device which you can use RPi.

Ok. I misunderstood that. Maybe because of the name of the project "MySensor.org", and maybe I read "my Sensor.org" or "my MySensor.org".

rogerClark:

Seams like it failes.. :confused:

Please explain what you mean.

If you followed the examples correctly, and it does not work, then you have a hardware fault.

However its far more likely you have made a mistake.

Double check everything.

I was trying to make an wireless connection with arduino nano as master, and arduino nano as slave.
from trying this code:

/*
 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */

/**
 * Example for Getting Started with nRF24L01+ radios. 
 *
 * This is an example of how to use the RF24 class.  Write this sketch to two 
 * different nodes.  Put one of the nodes into 'transmit' mode by connecting 
 * with the serial monitor and sending a 'T'.  The ping node sends the current 
 * time to the pong node, which responds by sending the value back.  The ping 
 * node can then see how long the whole cycle took.
 */

#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"

//
// Hardware configuration
//

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10 

RF24 radio(9,10);

//
// Topology
//

// Radio pipe addresses for the 2 nodes to communicate.
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

//
// Role management
//
// Set up role.  This sketch uses the same software for all the nodes
// in this system.  Doing so greatly simplifies testing.  
//

// The various roles supported by this sketch
typedef enum { role_ping_out = 1, role_pong_back } role_e;

// The debug-friendly names of those roles
const char* role_friendly_name[] = { "invalid", "Ping out", "Pong back"};

// The role of the current running sketch
role_e role = role_pong_back;

void setup(void)
{
  //
  // Print preamble
  //

  Serial.begin(57600);
  printf_begin();
  printf("\n\rRF24/examples/GettingStarted/\n\r");
  printf("ROLE: %s\n\r",role_friendly_name[role]);
  printf("*** PRESS 'T' to begin transmitting to the other node\n\r");

  //
  // Setup and configure rf radio
  //

  radio.begin();

  // optionally, increase the delay between retries & # of retries
  radio.setRetries(15,15);

  // optionally, reduce the payload size.  seems to
  // improve reliability
  //radio.setPayloadSize(8);

  //
  // Open pipes to other nodes for communication
  //

  // This simple sketch opens two pipes for these two nodes to communicate
  // back and forth.
  // Open 'our' pipe for writing
  // Open the 'other' pipe for reading, in position #1 (we can have up to 5 pipes open for reading)

  //if ( role == role_ping_out )
  {
    //radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  //else
  {
    //radio.openWritingPipe(pipes[1]);
    //radio.openReadingPipe(1,pipes[0]);
  }

  //
  // Start listening
  //

  radio.startListening();

  //
  // Dump the configuration of the rf unit for debugging
  //

  radio.printDetails();
}

void loop(void)
{
  //
  // Ping out role.  Repeatedly send the current time
  //

  if (role == role_ping_out)
  {
    // First, stop listening so we can talk.
    radio.stopListening();

    // Take the time, and send it.  This will block until complete
    unsigned long time = millis();
    printf("Now sending %lu...",time);
    bool ok = radio.write( &time, sizeof(unsigned long) );
    
    if (ok)
      printf("ok...");
    else
      printf("failed.\n\r");

    // Now, continue listening
    radio.startListening();

    // Wait here until we get a response, or timeout (250ms)
    unsigned long started_waiting_at = millis();
    bool timeout = false;
    while ( ! radio.available() && ! timeout )
      if (millis() - started_waiting_at > 200 )
        timeout = true;

    // Describe the results
    if ( timeout )
    {
      printf("Failed, response timed out.\n\r");
    }
    else
    {
      // Grab the response, compare, and send to debugging spew
      unsigned long got_time;
      radio.read( &got_time, sizeof(unsigned long) );

      // Spew it
      printf("Got response %lu, round-trip delay: %lu\n\r",got_time,millis()-got_time);
    }

    // Try again 1s later
    delay(1000);
  }

  //
  // Pong back role.  Receive each packet, dump it out, and send it back
  //

  if ( role == role_pong_back )
  {
    // if there is data ready
    if ( radio.available() )
    {
      // Dump the payloads until we've gotten everything
      unsigned long got_time;
      bool done = false;
      while (!done)
      {
        // Fetch the payload, and see if this was the last one.
        done = radio.read( &got_time, sizeof(unsigned long) );

        // Spew it
        printf("Got payload %lu...",got_time);

	// Delay just a little bit to let the other unit
	// make the transition to receiver
	delay(20);
      }

      // First, stop listening so we can talk
      radio.stopListening();

      // Send the final one back.
      radio.write( &got_time, sizeof(unsigned long) );
      printf("Sent response.\n\r");

      // Now, resume listening so we catch the next packets.
      radio.startListening();
    }
  }

  //
  // Change roles
  //

  if ( Serial.available() )
  {
    char c = toupper(Serial.read());
    if ( c == 'T' && role == role_pong_back )
    {
      printf("*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK\n\r");

      // Become the primary transmitter (ping out)
      role = role_ping_out;
      radio.openWritingPipe(pipes[0]);
      radio.openReadingPipe(1,pipes[1]);
    }
    else if ( c == 'R' && role == role_ping_out )
    {
      printf("*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK\n\r");
      
      // Become the primary receiver (pong back)
      role = role_pong_back;
      radio.openWritingPipe(pipes[1]);
      radio.openReadingPipe(1,pipes[0]);
    }
  }
}
// vim:cin:ai:sts=2 sw=2 ft=cpp

The 'GettingStarted.ino file in the RF lib.

And it returned:
"Failed, response timed out.", as fare as i remenber at the moment.


The reason for using arduino nano as master for this moment, is to learn to know the nRF24l01+ module better.. Never tryed to play with them before..

The response from arduino nano, regarding my last reply is:

Danni-Hansen:
The 'GettingStarted.ino file in the RF lib.

And it returned:
"Failed, response timed out.", as fare as i remenber at the moment.

The original version of that sketch implemented the sending and receiving sides in the same sketch with the mode selected by a global variable at the top of the sketch. The version you posted has been hacked to only support the receiving side. I suggest you go back to the original and change the mode by setting the global variable as the original author intended. If it doesn't work, I suggest you post your versions of the sending and receiving sketches, and details of your hardware. The nRF24L01+ transceivers are certainly capable of working with a Nano - I've used this combination.

Pretty sure there's Youtube videos covering the radios. I've watched at least one.

When the big wired up supposed to work doesn't, then it's time to get step by step simple.