Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Hacking the Arduino Wifi Shield on: January 01, 2013, 08:22:02 pm
Thanks for the suggestion, but I'm actually going to use EAGLE PCB software to put it together. Those are the default pcb files that come with Arduino hardware.
2  Using Arduino / Project Guidance / Hacking the Arduino Wifi Shield on: January 01, 2013, 02:37:23 pm
Hi everyone!

I'm thinking of combining the Arduino Pro mini + Arduino WiFi Shield + the nRF24L01+ breakout board into a single PCB in order to create a listening hub for various items in my house. The nRF24L01+ is a simple radio module that can connect to lots of electronics cheaply, and with the hub I can send all that data to my web server.

I've checked out the WiFi Eagle Files, and it seems rather straightforward to add on the arduino pro and breaking out the nRF24L01+ breakout pins on the board. Any tips for guidance? Will I be able to upload the firmware files for the WiFi shield easily?

Also, I saw that there was a "green wire" fix on the original release of the board. I didn't see the change on the EAGLE files, does anyone know what the latest version is?

Thanks so much for your help in advance!

M
3  Using Arduino / Motors, Mechanics, and Power / Re: Problem when plugging heavy load devices on the same outlet as Arduino on: September 21, 2012, 11:14:53 am

[/quote]

I am having the same problem in my apartment. I have found that whenever I rapidly turn on and off the air compressor, after about 20 toggles, the Arduino Duemilanove will halt. My Arduino is plugged into the same outlet as the fridge and when I unplug and replug the fridge, the Arduino halts after about 2-6 toggles, so it is obviously a power issue.

When I say Arduino Duemilanove "halts", it resets and then does not even execute its setup function. I used some LEDs to verify this, then I eventually used another Arduino to monitor the first with the same results. This is what you are experiencing with the WDT not being turned on. The funny thing is that the second Arduino does not crash, only the first, so it has to do something with my code.

I believe the workaround is to turn on the WDTON fuse with an ISP programmer. That way you don't need to enable the WDT in software.
[/quote]


we are currently using the arduino bootloader to upload code to the boards. How would you go about turning WDTON?

Also, adding a capacitor sounds like a great idea (effectively a backup power source to flatten the voltage), any way to add that to the Arduino without opening the guts of the wall wart?

4  Using Arduino / Networking, Protocols, and Devices / Re: WiFly Configuration Process - No response to $$$ on: August 24, 2012, 11:35:12 am
Post your schematics. Are you using an Arduino WiFly Shield?
5  Using Arduino / Networking, Protocols, and Devices / Re: Official WiFi Shield SPI Communication Problem on: August 24, 2012, 01:15:15 am
I believe the shield using the SPI protocol as well. However the Slave Select pin is 10, and pin 7 is used additionally for a handshake.
6  Using Arduino / Networking, Protocols, and Devices / Official WiFi Shield SPI Communication Problem on: August 23, 2012, 10:30:27 pm
Hello Everyone!

I've been waiting for the WiFi Shield for a long time, and it works perfectly on its own.

However, the terminal gives me the message 'WiFi Shield not present" whenever I wire a module up via SPI. For instance, I connected the popular nRF24L01+ module from Sparkfun (https://www.sparkfun.com/products/691?) using the following pins:

MISO 12
MOSI 11
SCK 13
CSN 9
CE 8

Whenever I disconnect pin 12, the shield works just fine.

Is this an SPI problem? Is the module drawing too much current from the shield? Any ideas?

Attached is also an image of my circuit, just for reference:

7  Using Arduino / Programming Questions / Re: Array of Char Arrays Question on: February 22, 2012, 06:16:06 am
No luck so far. The maniacbug code isn't giving consistent returns as much as the original Sparkfun RTC code. Any idea how to return Unixtime (seconds since 1st of Jan 1970) using that snippet?

Code:
int a=n & B00001111;   
if(i==2){
int b=(n & B00110000)>>4; //24 hour mode
if(b==B00000010)
b=20;       
else if(b==B00000001)
b=10;
TimeDate[i]=a+b;
}
else if(i==4){
int b=(n & B00110000)>>4;
TimeDate[i]=a+b*10;
}
else if(i==5){
int b=(n & B00010000)>>4;
TimeDate[i]=a+b*10;
}
else if(i==6){
int b=(n & B11110000)>>4;
TimeDate[i]=a+b*10;
}
else{
int b=(n & B01110000)>>4;
TimeDate[i]=a+b*10;
}

Any idea what those B01110000 numbers are?

Thanks in advance!
8  Using Arduino / Programming Questions / Re: Array of Char Arrays Question on: February 22, 2012, 05:28:36 am
This one looks promising, I'll dig deeper.

http://www.l8ter.com/?p=375

9  Using Arduino / Programming Questions / Re: Array of Char Arrays Question on: February 22, 2012, 05:26:25 am
Thanks for all the suggestions Paul. I didn't think of the memory challenge with storing big arrays, you're absolutely right.

AWOL, I love just using the unixtime values, however the current library I'm using can't return those. Any tips on where to start? I think if I can manage to get those it will be way easier/more efficient to create a dynamic int array.

10  Using Arduino / Programming Questions / Re: Array of Char Arrays Question on: February 22, 2012, 05:13:40 am
AWOL, thanks for the prompt reply.

I agree that the code isn't correct, it is pointing to the same place every time. I'm straying away from milis() since it resets every time the Arduino restarts. I'm using the DS3234 RTC module to keep track of time externally. The breakout board can be found here:

http://www.sparkfun.com/products/10160

M
11  Using Arduino / Programming Questions / Array of Char Arrays Question on: February 22, 2012, 04:58:36 am
Hello everyone,

I'm trying to create a dynamic array of strings, using the RTC module. I've managed to retrieve the time as a pointer to a char array in the format of "12/3/12   14:45:44". Now, I'm trying to capture them as a separate char array of arrays to store as a global variable, with the push of a button. It is sort of a data logger, but it stores the values as a big array. (i'll be using the char array of arrays to communicate between two nRLF2401+ modules).

Below is my code. The bottom functions are for the RTC Clock. The trouble I believe I'm running into is within void(loop).

Code:
#include <SPI.h>
#include <String.h>

const int  cs = 6;  //  chip select for the RTC module

const int maxRecordings = 100;

char * myStrings[maxRecordings] = {};

const int timeSaveButton = 2; //  Button pin for saving time and reading time

int n = 0;

int saveButtonState; //  Interrupt states for buttons
int saveLastButtonState = 0;

void setup(){
  Serial.begin(9600);

  pinMode(timeSaveButton, INPUT);
 
  RTC_init();
  Serial.begin(9600);
}

void loop(){
  //when button is pressed;
  saveButtonState = digitalRead(timeSaveButton);
  if (saveButtonState != saveLastButtonState && saveLastButtonState == HIGH) {
    for (int i = 0; i <= n; i++){
      if (i == n) {
        myStrings[i] = readTimeDate();
      }   
      Serial.print("Recording #");
      Serial.print(i);
      Serial.print(": ");
      Serial.println(myStrings[i]);
    }
    n++;
    Serial.println("");         
  }
  saveLastButtonState = saveButtonState;
  delay(1000);
}
 
 
int RTC_init(){
  pinMode(cs, OUTPUT); // chip select
  // start the SPI library:
  SPI.begin();
  SPI.setBitOrder(MSBFIRST);
  SPI.setDataMode(SPI_MODE3); // both mode 1 & 3 should work
  //set control register
  digitalWrite(cs, LOW); 
  SPI.transfer(0x8E);
  SPI.transfer(0x60); //60= disable Osciallator and Battery SQ wave @1hz, temp compensation, Alarms disabled
  digitalWrite(cs, HIGH);
  delay(10);
}
//=====================================
int setTimeDate(int d, int mo, int y, int h, int mi, int s){
int TimeDate [7]={s,mi,h,0,d,mo,y};
for(int i=0; i<=6;i++){
if(i==3)
i++;
int b= TimeDate[i]/10;
int a= TimeDate[i]-b*10;
if(i==2){
if (b==2)
b=B00000010;
else if (b==1)
b=B00000001;
}
TimeDate[i]= a+(b<<4);
 
digitalWrite(cs, LOW);
SPI.transfer(i+0x80);
SPI.transfer(TimeDate[i]);       
digitalWrite(cs, HIGH);
  }
}
//=====================================
char * readTimeDate(){
 
String temp;
int TimeDate [7]; //second,minute,hour,null,day,month,year
for(int i=0; i<=6; i++) {
if(i==3)
i++;
digitalWrite(cs, LOW);
SPI.transfer(i+0x00);
unsigned int n = SPI.transfer(0x00);       
digitalWrite(cs, HIGH);
int a=n & B00001111;   
if(i==2){
int b=(n & B00110000)>>4; //24 hour mode
if(b==B00000010)
b=20;       
else if(b==B00000001)
b=10;
TimeDate[i]=a+b;
}
else if(i==4){
int b=(n & B00110000)>>4;
TimeDate[i]=a+b*10;
}
else if(i==5){
int b=(n & B00010000)>>4;
TimeDate[i]=a+b*10;
}
else if(i==6){
int b=(n & B11110000)>>4;
TimeDate[i]=a+b*10;
}
else{
int b=(n & B01110000)>>4;
TimeDate[i]=a+b*10;
}
}
temp.concat(TimeDate[4]);
temp.concat("/") ;
temp.concat(TimeDate[5]);
temp.concat("/") ;
temp.concat(TimeDate[6]);
temp.concat(" ") ;
temp.concat(TimeDate[2]);
temp.concat(":") ;
temp.concat(TimeDate[1]);
temp.concat(":") ;
temp.concat(TimeDate[0]);

// added the below bit to return a char array, easier to save in EEPROM.

  const int len = 51;
  char buf[len];
  temp.toCharArray(buf, len);

  return buf;
}

The result of this code is such:

Recording #0: 22/2/12 3:49:18

Recording #0: 22/2/12 3:49:18
Recording #1: 22/2/12 3:49:23

Recording #0: 22/2/12 3:49:23
Recording #1: 22/2/12 3:49:23
Recording #2: 22/2/12 3:49:29


As you can see, once the pointer is updated with readTimeDate(), it changes all the myStrings values, since essentially they are the same pointers. How can I store the value readTimeDate() is initially pointing to?

Additionally, re: the way myStrings is declared is a little confusing.
Code:
const int maxRecordings = 100;

char * myStrings[maxRecordings] = {};

Do I always have to say the length of my char arrays? Is it not possible to create a dynamic array that grows whenever I wish to input a value? The below code compiles correctly, however returns jibberish once I actually open the serial monitor.

Code:
//const int maxRecordings = 100;

char * myStrings[] = {};

Any help would be greatly appreciated. Original code for the RTC functions can be found in the Sparkfun website below.

http://www.sparkfun.com/datasheets/BreakoutBoards/DS3234_Example_Code.c

All the best,

Mert
12  Using Arduino / Networking, Protocols, and Devices / ANT+ Protocol on: February 09, 2012, 03:16:07 pm
Hey everyone,

First and foremost, what is it?

Secondly, I just wanted to clarify what the difference between ANT and MiRF are. I know sparkfun has breakout boards for nRF24AP1, nRF2401A and nRF24L01+ - but I don't understand what specifically their differences are.

Is ZigBee communication doing the same thing as the Nordic chips? Are there any major differences on that front besides power use/range?

Thank you in advance!
13  Using Arduino / Project Guidance / ANT+ Communication and MiRF on: February 08, 2012, 07:35:03 pm
Hey everyone,

I just wanted to clarify what the difference between ANT and MiRF are. I know sparkfun has breakout boards for nRF24AP1, nRF2401A and nRF24L01+ - but I don't understand what specifically their differences are.

Is ZigBee doing the same thing as the Nordic chips? Are there any major differences on that front besides power use?

Thank you in advance!

14  Using Arduino / Networking, Protocols, and Devices / Re: DS3234 RTC and Uno problems on: January 31, 2012, 05:15:45 pm
Just figured it out - use shorter wires and you should be all good. I'm getting the correct read after using 4-5cm wires.
15  Using Arduino / Networking, Protocols, and Devices / Re: DS3234 RTC and Uno problems on: January 31, 2012, 04:56:15 pm

For the sparkfun code to work, all you have to do is change

  SPI.setDataMode(SPI_MODE1);

into

  SPI.setDataMode(SPI_MODE3);

Afterwards it worked for me.

However still haven't figured out the maniacbug code. I'm getting the below read as well from my code.

Code:
#include <Wire.h>
#include <SPI.h>
#include <RTClib.h>
#include <RTC_DS3234.h>


//create a SPI instance
RTC_DS3234 RTC(8);

void setup()  {
 
  SPI.begin();
  RTC.begin();

//set the time to now

  RTC.adjust(DateTime(__DATE__, __TIME__));
  SPI.setDataMode(SPI_MODE0);
  Serial.begin(9600);
 
}

void loop()  {
 
  const int len = 32;
  static char buf[len];
  DateTime now = RTC.now();
  Serial.println(now.toString(buf,len));
  delay(1000);
 
}

My output is below:

Dec 31 2165 23:60:60
Dec 31 2165 23:60:60
Dec 31 2165 23:60:60


Pages: [1]