Show Posts
Pages: 1 ... 5 6 [7] 8 9
91  Using Arduino / Project Guidance / Sleep and Millis() - I need both? on: July 31, 2012, 11:48:28 pm
I am creating a project that needs to save power - both battery and my house power.

I am creating a simple circuit using an ATMega328 + a few components to count the pulses from a power meter.

The device must run on batteries and about once per minute send a small payload via 2.4Ghz

My data packet I send is

TimeNowMS
TimePrevMS
PulseNow
PulsePrev

So based on this I can work out the power consumption in my house at the current time.

I have the basics working but I now want the device to sleep between updates over WIFI to save power.

I need to have the pulses being counted using interrupts even when sleeping.

Without any sleep the board is using 19ma - I want to reduce that by a huge amount - remember this is not an arduino board just the bare essentials to get it running with arduino code.

All of the arduino sleep modes of any value corrupt the value returned by Millis() since the timer is not running when the device is sleeping.

Normally I count the pulses between updates and also the duration in ms since the last update in ms.

I thought about a RTC but 1 second accuracy is not good enough - I need more accuracy !

Is there a way I can use a crystal to get ms? maybe using some sort of external circuit? but still readable by Arduino and all the while not using much power?

ANy thoughts appreciated

chris

92  Using Arduino / Programming Questions / Re: Arduino and Sleep - power save on: July 31, 2012, 02:22:13 pm

Thanks Nick

That helped me a lot.

chris
93  Using Arduino / Programming Questions / Re: Arduino and Sleep - power save on: July 31, 2012, 03:37:56 am
Which version of the IDE are you using?

On that computer it is 1.01

Chris

94  Using Arduino / Programming Questions / Arduino and Sleep - power save on: July 31, 2012, 02:51:41 am
I am trying to follow the code at http://jeelabs.org/2009/05/16/power-consumption-more-savings/

I think I have it right - but I am getting some strange Serial output.



My code is

Code:
#include <avr/interrupt.h>
#include <avr/power.h>
#include <avr/sleep.h>
#include <avr/wdt.h>

ISR(WDT_vect) {
}

void setup()
{
  Serial.begin(9600);
MCUSR &= ~(1<<WDRF);
cli();
WDTCSR |= (1 << WDCE) | (1 << WDE);
WDTCSR = 6;
WDTCSR |= bit(WDIE);
sei();

}

void loop()
{
  delay(3);
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);
  sleep_mode();
  Serial.print ("\nBMP");
}



Any ideas of why I get corrupted data on the Serial Output?

I am using an Arduino Duemilanove

Chris
95  Using Arduino / Sensors / Re: ROPE Water Sensor on: July 30, 2012, 04:38:43 pm
I did find a site that creates and sells the cable.

I have asked for some pricing options.

http://www.cmrelectrical.com/water-detection-cable.htm

I think this works differently, in that it does not tell you where along the cable it is shorted but just that there is a detection.

Chris
96  Using Arduino / Networking, Protocols, and Devices / Re: RF24 - nrf24l01+ - scanner example on: July 29, 2012, 09:28:46 pm
Thanks John

Chris
97  Using Arduino / Networking, Protocols, and Devices / RF24 - nrf24l01+ - scanner example on: July 29, 2012, 06:39:44 pm
I am looking at the scanner example from the RF24 Library.

The example is here:

http://maniacbug.github.com/RF24/scanner_8pde-example.html

Can someone explain to me what I should be seeing?

From the code if it detects a carrier it increments a counter for that channel.

So is a carrier bad? ie there is some other wifi device on that channel?

Do I want to use a channel for my code which has a value of 0?

Chris
98  Using Arduino / Sensors / ROPE Water Sensor on: July 29, 2012, 01:55:03 pm
Hi

I have been getting interested in Rope Water Sensors which can detect when any part of the rope is wet and then using an Arduino to process that and generate an alert. Good for server rooms or anywhere you do not want water.

These things are made (or sold) by a lot of companies but they all include the electronics.

A quick  google will show you what I mean

http://www.google.com/search?q=Rope Water Sensor

I am interested in just the cable - anyone know who makes this cable and sells it online?

I am in New Zealand but it could be imported i assume?

Cheers

Chirs
99  Using Arduino / Networking, Protocols, and Devices / Re: NRF24L01 problems - Beginner - Not working on: July 26, 2012, 05:57:46 pm
OK

I decided to try to run a different sketch - in this case another example - I think it was pingpong?

This worked for me.

No idea why the "getting started" sketch did not but I will try to see over the weekend - work calls now!
100  Using Arduino / Networking, Protocols, and Devices / Re: NRF24L01 problems - Beginner - Not working on: July 26, 2012, 02:43:20 pm
OK I think I am better now but still not successfully transmitting/receiving.

I am getting what looks to be better data on the debug output from the radio now



The error  I get is timeout when sending a packet.

Now I am unsure about the radio pipe addresses

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

Are these some sort of hardware device id? or are they just created as random numbers?

If they are hardware ids then they look like the RX_ADDR_P0-1 from the screen snap above but the numbers are different in this case.

I tried using those numbers in this area but I still got the same timeout message!

Any ideas?

Chris
101  Using Arduino / Networking, Protocols, and Devices / Re: NRF24L01 problems - Beginner - Not working on: July 26, 2012, 01:52:44 pm
Thanks for your reply as it may have put me on the right track.

On an Arduino Duemilanove

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).

On an Arduino Mega 2560

SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS).

Also on the docs for Arduino Mega 2560 it says "The SPI pins are also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila."

So I have my connections on the wrong pins (as I am using Mega Boards) - I did a quick search for the ICSP header and found this image and page



ref: http://www.instructables.com/id/Adding-ICSP-header-to-your-ArduinoAVR-board/step3/ICSP-header-pinout/




I am about to go change my pins and test...

Chris
102  Using Arduino / Networking, Protocols, and Devices / Re: NRF24L01 problems - Beginner - Not working on: July 25, 2012, 11:16:12 pm
OK I have found that the constructor specifies the CE and CS pins - I take it CSN is CS?

Here is the constructor

RF24::RF24 (uint8_t _cepin, uint8_t _cspin )

Constructor.

Creates a new instance of this driver. Before using, you create an instance and send in the unique pins that this chip is connected to.

Parameters:

_cepin

The pin attached to Chip Enable on the RF module

_cspin

The pin attached to Chip Select


I have changed the constructor to

RF24 radio(8, 9);


But I still have no joy - here is a pic of the board with the pin outs (as I noticed some are different)



Chris
103  Using Arduino / Networking, Protocols, and Devices / NRF24L01 problems - Beginner - Not working on: July 25, 2012, 10:18:57 pm
I am trying to follow the details at http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

I have wired up my Arduino according to the link above.

Signal
RF Module
COLOR
Arduino
GND
1
Brown
GND
VCC
2
Red
3V3
CE
3
Orange
8
CSN
4
Yellow
9 or 7(a)
SCK
5
Green
13
MOSI
6
Blue
11
MISO
7
Violet
12
IRQ
8
Gray
2(b)


I am using the RF24 Library from https://github.com/maniacbug/RF24/archives/master

I am trying the getting started sketch



It has this in the sketch

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9,10);

well pin 10 is not even connected?

PIN9 is connected to CSN

Has anyone got this working? I am new to SPI and generally everything.

If I run the script I get this in the serial monitor

RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS       = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1   = 0x0000000000 0xffffffffff
RX_ADDR_P2-5   = 0x7f 0x3f 0x00 0x00
TX_ADDR               = 0x0000000000
RX_PW_P0-6   = 0x00 0x00 0x00 0x00 0xff 0x7f
ENAA                     = 0xff
EN_RXADDR            = 0x00
RF_CH                   = 0x00
RF_SETUP              = 0x00
CONFIG                 = 0x00
DYNPD/FEATURE = 0x7f 0xff
Data Rate            = 1MBPS
Model                   = nrf24l01
CRC Length          = Disabled
PA Power              = PA_Min

Got Payload 4294967295... Sent Response

There is nothing at the other end as I don't have the 2nd unit runing at all!


Chris
104  Using Arduino / General Electronics / Re: Looking for Solar Charger circuit to charge 6x1.2v batteries with protection on: July 21, 2012, 11:53:51 pm
Thanks for that Doc

I am in Christchurch, New Zealand - so not a lot of sun here and even worse in the position where the panel would be placed.

I will try to find some more details about the cells you mentioned and see if I can source them online

Cheers

Chris
105  Using Arduino / General Electronics / Looking for Solar Charger circuit to charge 6x1.2v batteries with protection on: July 21, 2012, 11:30:50 pm
Looking for Solar Charger to charge 6x1.2v batteries with over/under protection?

I have been looking around and there is a lot of information around on solar charges but I am looking for something that can charge 6 x 1.2v  Ni-MH Batteries.

I also want it to handle over and under voltage protection.

Obviosuly this is not just a charger as I am wanting to run my Arduino on the batteries during the dark and when it is light the solar charger will charge the batteries and run the arduino.

Any circuits you can recommend.

Chris
Pages: 1 ... 5 6 [7] 8 9