Show Posts
|
|
Pages: 1 [2] 3 4 ... 82
|
|
16
|
Using Arduino / Project Guidance / Re: fine tuning sleep current Atmega328
|
on: April 29, 2013, 08:25:47 pm
|
That is if you can manage to get the chip started at all if you run it at lower voltages. Otherwise it won't run that code. It may or may not work. But the speed rate in the specs ( for the P suffix ) say 1.8 to 5.5v, why would they say that if it was doubtful if it would start ?
|
|
|
|
|
17
|
Using Arduino / Project Guidance / Re: fine tuning sleep current Atmega328
|
on: April 28, 2013, 02:28:40 pm
|
|
As it seems the chip is fine at 16 Mhz and 3.6v I will leave well alone.
The battery I have chosen will last several years anyway at 40 microamps ( which is the sleep current with the 3 CD4017 expander chips supplied by the battery ) plus the 160ms pulse of 15mA when the score is updated, which might be 200 times in a cricket match = about 0.14 mAh per match. ( 7000 matches at 1650 maH )
I think the shelf life of the battery will be the limiting factor.
( I put a smiley about blowing fuses )
|
|
|
|
|
18
|
Using Arduino / Project Guidance / Re: fine tuning sleep current Atmega328
|
on: April 28, 2013, 08:10:01 am
|
Well spotted Pito, we were all looking at the 328 range of speeds / voltage, where the 328P says 20 Mhz down to 1.8v. I must confess I made a remote control that has been working fine for over a year with 2 AAA batteries at 16 Mhz, but I was too embarrassed to mention it :-)  [/img]
|
|
|
|
|
19
|
Using Arduino / Project Guidance / Re: fine tuning sleep current Atmega328
|
on: April 28, 2013, 07:01:16 am
|
MCP1702 Thats the one I was thinking of DC42 ! , I knew it was less than 10 micoramps. Perhaps I am not so senile after all, but I think I will try and get the 328 going at 8 Mhz as I have another project that runs off a coin cell. I dont like the sound of blowing fuses though :-)
|
|
|
|
|
20
|
Using Arduino / Project Guidance / Re: fine tuning sleep current Atmega328
|
on: April 28, 2013, 01:27:57 am
|
|
Thanks
I will run it at 8 Mhz, there is no timing involved ( apart from the VirtualWire baud rate ) so would there be an advantage in using the internal oscillator - and would this affect the sleep mode?
Will I be able to change the frequency using the 2 Arduinos ISP programming ?
|
|
|
|
|
21
|
Using Arduino / Project Guidance / Re: fine tuning sleep current Atmega328
|
on: April 27, 2013, 09:29:47 pm
|
|
I seemed to recall the micropower regs had 8 microamps quiescent current, but it looks like its 80, which would be a waste of time !
I could use a 2477 3v coin cell, with a large value electrolytic to supply the current on transmit .
The transmitter and 328 only have to come on long enough to scan the switches and send out 19 bytes + checksum.
I use this on a CMOS project, but I would have to run the chip at 8 MHz evidently, I load the bootloader using my second Duemilanove as ISP. Is it possible to change the frequency with this method?
I have just found an available battery ( for $4 ) that is 3.6v 1.2 amphour the ER14250, it looks like it will keep 3.6v terminal voltage for 90% of its life, which at 20 microamps that I have now ( at 4v5 ) would be years - or probably its shelf life would limit it first.
It can supply 40mA continous or 80mA pulsed, but I would use a decent cap anyway.
I think the 328 is OK at 16 MHz at 3v6 ? I have looked at the data sheet for the Atmega328P and apart from a reference to " speed grades on page 321 " which doesnt exist on my datasheet, it lists 20MHz from 1.8 to 5v ??
Postscript - even better and half the price is the ER14335 at 1650 mAh
|
|
|
|
|
22
|
Using Arduino / Project Guidance / Re: What things to take note between 3V3 and 5V Atmega328?
|
on: April 27, 2013, 03:25:22 pm
|
|
I want to use a 328 for a project that at the moment I use CMOS chips for. It runs from a 3v battery.
I am happy to use the internal 8 Mhz clock that johnwasser mentions in this thread. I need to get the unit to report approx every 24 hours, so I want to try and use the watchdog timer, and increment a counter until it gets to 24 hours. ( I still have to work this out )
I also have to be able to have an interrupt send a code at any time when an input is triggered.
I will be using VirtualWire to transmit, and would normally have the baud rate set to 4000 for the cheapy rf modules I am using, will I have to set the boardrate to 8000 to get the same baudrate for the receiver to detect?
And will the watchdog timing be twice as long?
|
|
|
|
|
23
|
Using Arduino / Project Guidance / fine tuning sleep current Atmega328
|
on: April 27, 2013, 11:26:47 am
|
I have been using the same sleep settings ( originally from Crossroads ) for a long time now, and have pin 2 being called low as the interrupt. :- void enterSleep() { /* Setup pin2 as an interrupt and attach handler. */ attachInterrupt(0, pin2Interrupt, FALLING); delay(50); // need this? set_sleep_mode(SLEEP_MODE_PWR_DOWN); // setting up for sleep ... sleep_enable(); // setting up for sleep ... ADCSRA &= ~(1 << ADEN); PRR = 0xFF; sleep_mode(); // now goes to Sleep and waits for the interrupt /* The program will continue from here after the interrupt. */ detachInterrupt(0); //disable interrupts while we get ready to read the keypad PRR = 0x00; /* First thing to do is disable sleep. */ sleep_disable();
// set all the keypad columns back high so can read keypad presses again digitalWrite(3, HIGH); digitalWrite(16, HIGH); digitalWrite(18, HIGH); // then go to the void Loop() } I have a sleep current of about 20 microamps at the moment, which has been fine for the remote controls with 3 AAA cells. The batteries last a year. Unfortunatley I have just made a wonderful remote control unit, with 19 BCD switches, in a compact case. But when I looked inside, theres no room for the normal battery case ! I can fit an A23 12v keyfob type battery ( with a micropower 5v regulator ) but they are only rated at 55 mAh, which is marginal. I looked at Nick Gammons sketches, and it looks like I should concentrate on the DAC and the brownout. Should I just switch the ADC off in setup? I am not using it at all, and I have no idea what ADCSRA &= ~(1 << ADEN); means.
|
|
|
|
|
24
|
Using Arduino / Storage / Re: power down data saving
|
on: April 19, 2013, 04:45:33 pm
|
|
If you are feeding your 5v regulator with 12v you can use a 9v1 zener, the 100nF ( same as 0.1MFD, or marked 104 ) can be a 47nF or better a 220nF .
You don't need a seperate eeprom, this works well to save the data once to eeprom when the power goes off. If you are using v1 just check the EEPROM.read and write instructions.
You can make the variables to save anything you want ( I just showed in the example those that I save )
|
|
|
|
|
25
|
Using Arduino / Interfacing w/ Software on the Computer / Re: getting rid of Strings
|
on: April 16, 2013, 09:01:23 pm
|
|
I found the problem in the end, it was the receivers output to the chip was just under 3v pp, ( its running on the 3v3 line ) and the arduino spec for a 1 input is 3v.
I put a 2 transistor level shifter on it and it was OK.
I have used the direct input to the chip many times with no hassle.
It was confusing as it would work when I put the chip in the arduino borad, so I guess the USB 5v is marginally higher than the 5v from my regulator.
|
|
|
|
|
26
|
Using Arduino / Networking, Protocols, and Devices / Re: if statement confusing data ( or me ) SOLVED
|
on: April 16, 2013, 08:57:46 am
|
Thanks guys, I got myself mixed up there. How many other Great Grandfathers get confused with this sometimes ? :-) I didn't realise that you could have "byte number" in the EasyTranfer and also declare " int byte ". As soon as I did that I could dump all the confusing bits and now have as below and it works. I had to trim the tx data down as the fifo in the rf modules was breaking the message into 2, which confused the ET so I made everyting bytes, and combined the gps searching with the queue type in one byte - qgps. It all goes through fine now in one burst. ( I don't have time to find the wireless specs again to change the message length ) I reverted to my orig code for reading the qgps void checkprinter () { //check and see if a data packet has come in. if(ET.receiveData()){ int(PIN ) = mydata.PIN ; // PIN 33 for Radiant if(PIN == 33 ){ Serial.print (" PIN OK = " ); Serial.println (PIN ); int( qgps) = mydata.qgps;
if ( qgps == 0 || 2 ){ searching = 0 ; } else { searching = 1; } if ( qgps == 1 || 3 ){ queuetype = 0 ; } else { queuetype = 1; } int (number) = mydata.number; if (searching == 0 ) { // only update realtime clock if gps locked clockyear = mydata.clockyear + 2000 ; clockmonth = mydata.clockmonth; clockday = mydata.clockday; clockhours = mydata.clockhours; clockmins = mydata.clockmins; } // end of if seraching - 0 Serial.print (" qgps = " ) ; Serial.println (qgps); Serial.print (" number = " ) ; Serial.println (number); Serial.print (" searching = " ) ; Serial.println (searching); Serial.print (" queuetype = " ) ; Serial.println (queuetype); Serial.print (" clockmins = " ) ; Serial.println (clockmins); Serial.print (" clockhours = " ); Serial.println (clockhours); Serial.print (" clockday = " ) ; Serial.println (clockday); Serial.print (" clockmonth = " ); Serial.println (clockmonth); Serial.print (" clockyear = " ) ; Serial.println (clockyear); } // end of if pin =33 } // end of if any rx //you should make this delay shorter then your transmit delay or else messages could be lost delay(250); }
|
|
|
|
|
27
|
Using Arduino / Networking, Protocols, and Devices / if statement confusing data ( or me ) SOLVED
|
on: April 16, 2013, 07:54:37 am
|
I am sending some data to a logger, ( all sent as bytes ) , and have just got a testing code at the receive end, with the results monitored with Terminal on the PC. If I just send all the data and time/date with the code below it logs fine :- } void checkprinter () { //check and see if a data packet has come in.
if(ET.receiveData()){ int(PIN ) = mydata.PIN ; // PIN 33 for Radiant if(PIN == 33 ){ Serial.print (" PIN OK = " ); Serial.println (PIN ); int( qgps) = mydata.qgps;
if ( qgps == 0 ){ searching = 1; queuetype = 1; } if ( qgps == 1 ){ searching = 0; queuetype = 0; } if ( qgps == 2 ){ searching = 1; queuetype = 1; } if ( qgps == 3 ){ searching = 0; queuetype = 0; }
int (number) = mydata.number;
// if (searching == 0 ) { // only update realtime clock if gps locked int( clockyear) = mydata.clockyear ; clockyear = clockyear + 2000 ; int( clockmonth ) = mydata.clockmonth; int ( clockday) = mydata.clockday; int ( clockhours) = mydata.clockhours; int ( clockmins) = mydata.clockmins; // } // end of if seraching - 0
Serial.print (" qgps = " ) ; Serial.println (qgps); Serial.print (" number = " ) ; Serial.println (number); Serial.print (" searching = " ) ; Serial.println (searching); Serial.print (" queuetype = " ) ; Serial.println (queuetype); Serial.print (" clockmins = " ) ; Serial.println (clockmins); Serial.print (" clockhours = " ); Serial.println (clockhours); Serial.print (" clockday = " ) ; Serial.println (clockday); Serial.print (" clockmonth = " ); Serial.println (clockmonth); Serial.print (" clockyear = " ) ; Serial.println (clockyear);
} // end of if pin =33 } // end of if any rx
//you should make this delay shorter then your transmit delay or else messages could be lost delay(250);
}
The result is PIN OK = 33 qgps = 3 number = 2 searching = 0 queuetype = 0 clockmins = 35 clockhours = 8 clockday = 15 clockmonth = 4 clockyear = 2013 If I include the if statement that I commented out , as I only want to update the loggers clock if the GPS time coming in as right ie the remote GPS is locked, I lose the time and get as below void checkprinter () { //check and see if a data packet has come in.
if(ET.receiveData()){ int(PIN ) = mydata.PIN ; // PIN 33 for Radiant if(PIN == 33 ){ Serial.print (" PIN OK = " ); Serial.println (PIN ); int( qgps) = mydata.qgps;
if ( qgps == 0 ){ searching = 1; queuetype = 1; } if ( qgps == 1 ){ searching = 0; queuetype = 0; } if ( qgps == 2 ){ searching = 1; queuetype = 1; } if ( qgps == 3 ){ searching = 0; queuetype = 0; }
int (number) = mydata.number;
if (searching == 0 ) { // only update realtime clock if gps locked int( clockyear) = mydata.clockyear ; clockyear = clockyear + 2000 ; int( clockmonth ) = mydata.clockmonth; int ( clockday) = mydata.clockday; int ( clockhours) = mydata.clockhours; int ( clockmins) = mydata.clockmins; } // end of if seraching - 0
Serial.print (" qgps = " ) ; Serial.println (qgps); Serial.print (" number = " ) ; Serial.println (number); Serial.print (" searching = " ) ; Serial.println (searching); Serial.print (" queuetype = " ) ; Serial.println (queuetype); Serial.print (" clockmins = " ) ; Serial.println (clockmins); Serial.print (" clockhours = " ); Serial.println (clockhours); Serial.print (" clockday = " ) ; Serial.println (clockday); Serial.print (" clockmonth = " ); Serial.println (clockmonth); Serial.print (" clockyear = " ) ; Serial.println (clockyear);
} // end of if pin =33 } // end of if any rx
//you should make this delay shorter then your transmit delay or else messages could be lost delay(250);
}
I get the times as below PIN OK = 33 qgps = 3 number = 2 searching = 0 queuetype = 0 clockmins = <0> clockhours = <0> clockday = <0> clockmonth = <0> clockyear = <0> the declared variables are #include <EasyTransfer.h> //create object EasyTransfer ET; int ledPin = 10; int searching; int queuetype; byte number; byte clockyear; byte clockmonth; byte clockday; byte clockhours; byte clockmins; byte qgps;
struct RECEIVE_DATA_STRUCTURE{ //put your variable definitions here for the data you want to receive //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO // int blinks; // int pause; byte PIN; // PIN 33 for Radiant // byte searching; // gps locked = 1 byte number; // broken down for old system and eeprom? // byte numremainder; byte clockyear; byte clockmonth; byte clockday; byte clockhours; byte clockmins; byte qgps; // 0 for no lock normal ,1 for lock normal , 2 for no lock express, 3 for lock express // byte clocksecs; }; //give a name to the group of data RECEIVE_DATA_STRUCTURE mydata; //************************************************************************* void setup(){ Serial.begin(9600); Serial.println("setup"); //start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc. ET.begin(details(mydata), &Serial); pinMode(ledPin, OUTPUT); } void loop() checkprinter (); }
|
|
|
|
|
28
|
Using Arduino / Networking, Protocols, and Devices / Re: My rfm12B only works when connected to 5v.
|
on: April 15, 2013, 05:27:06 am
|
|
I wonder of its similar to the problem that has wasted a lot of my time this week. I often use resistors feeding data to a 3 v device, and feed the data back straight to the arduino pin - it supposed to be 3volts which should be a logic 1.
But it didnt work when I tried it this week for some reason, when I scoped it it was slightly under 3v pp. I had to put a 2 transistor level shifter in, now it works.
|
|
|
|
|
29
|
Using Arduino / Networking, Protocols, and Devices / Re: My rfm12B only works when connected to 5v.
|
on: April 15, 2013, 12:15:36 am
|
just plugging it straight into the 5V from the 7805 regulator worked just fine, and that's how I've had it for several weeks now with no issues. Thats a bit like crossing the road without looking left or right, you can get away with it for a while :-) You can put 3 x 1N4007s in series to knock the supply down to approx 3v3, ( with a cap after them ) but you will need resistors for the data lines to the module.
|
|
|
|
|
30
|
Using Arduino / Networking, Protocols, and Devices / Re: My rfm12B only works when connected to 5v.
|
on: April 14, 2013, 03:58:36 pm
|
|
That looks pretty good, the project I have been battling with at the moment, I made 6 months ago, and has one 2.4Ghz link, one 443 Mhz, and one 443.8 Mhz link ( not simultaneously ) and it worked fine then . I got it back to make some mods to the data logging, and have been battling to get it going even as it was then !
It uses the RFD21733 2.5Ghz transceivers which they claim up to 1700m range with proper antennas.
They have a nifty looking software to control the various modes, and I think use an NRF module.
I will also have another look at them when I get a break !
|
|
|
|
|