Show Posts
Pages: [1] 2 3 ... 5
1  Products / Arduino Yún / Re: Arduino Yun, power draw on: September 20, 2013, 02:33:34 pm
I tried turning wireless off, but never saw better then a 20ma improvement.  Even at it's lowest power measured (170ma) it is still to much.  Just trying to build a remote solar powered weather station.

Using a pure Arduino solution would be a bit hard (for me).  Doing compression (gzip/lzma) with 2k of ram is near impossible!
2  Products / Arduino Yún / Re: Arduino Yun, power draw on: September 20, 2013, 10:23:21 am
And here I was complaining about 75ma@5V on my https://www.olimex.com/Products/OLinuXino/iMX233/iMX233-OLinuXino-NANO/open-source-hardware

Any one know of any mini Linux board that draws less?
3  Products / Arduino Yún / Arduino Yun, power draw on: September 18, 2013, 11:46:22 pm
Info for all who seek to know the power draw of the Arduino Yun.
Every thing here is tested at 5V (USB) measured with a Fluke 115 meter:

Stock system booted, no connection, no sd: 200ma~270ma Seems to like to hover around 235~245ma but could peak to 300ma.
Stock system booted, with wired (cat5) networking: 277ma
Stock system booted, with wired (cat5) networking, max load: 315ma

I was a little shocked at how power hungry this device is.  Lowest power draw seen was 170ma, in the first 1 second of booting. UBoot?  So much for a low power Linux solution.  :-(



4  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino serial read in script keeps hanging. Ideas? on: September 04, 2012, 03:52:17 pm
I never found the root cause.  I hacked some code together that can spot the problem.

reader.sh
Code:
#!/bin/bash
TMP_DATE="/dev/shm/tmp.date.txt"
date +%s > $TMP_DATE

while read CHAR
do
  echo "${CHAR}" | logger
  date +%s > $TMP_DATE
done < /dev/ttyUSB0

watcher.sh (Setup to run from cron once a minute)
Code:
#!/bin/bash
#Version=0.5

HOME_PATH="/root/bin"
SCRIPT="serial_watcher.sh"
FULL_PATH="${HOME_PATH}/${SCRIPT}"
TMP_DATE="/dev/shm/tmp.date.txt"

#Check:  Has it run in the last 7min (420 sec)
CURRENT_TMP_DATE=`date +%s`
LAST_WRITTEN_DATE=`cat $TMP_DATE`
DIFF=$(($CURRENT_TMP_DATE - $LAST_WRITTEN_DATE))

if [ $DIFF -gt 420 ];then
  logger "$0 ERROR: $SCRIPT has not responded in $DIFF seconds, restarting"
  killall $SCRIPT
  nohup $FULL_PATH &
fi
5  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino serial read in script keeps hanging. Ideas? on: August 29, 2012, 03:03:52 pm
PC end XBee is attached to a XBee Explorer
https://www.sparkfun.com/products/8687

As far as the lights?  The XBee/Arduino sleep 99% of the time, and the lights are out (Both sides).  When it does wake up, for about 3 seconds, both sides light up, and the RX/TX lights show a burst of activity.

If I switch back to my 2.4GHz XBee's everything works (No code changes).  I am guessing I am getting some kind of control charter that is causing my while loop to crash.  But I cant see what that control charter is do to the crash... Nasty catch 22.
6  Using Arduino / Interfacing w/ Software on the Computer / Arduino serial read in script keeps hanging. Ideas? on: August 29, 2012, 10:17:18 am
I have a solar powered Arduino Fio out in a field playing weather station.  All the data is get transmitted back over a XBee net.  Last week I upgraded from XBee 2.4GHz's to XBee 900's.  Now my serial_watcher.sh script crashes/hangs ever 4~6 hours. 

serial_watcher.sh
Code:
#!/bin/bash

while read CHAR
do
  echo "${CHAR}" | logger
done < /dev/ttyUSB0

In a crashed state the script is still running, but no data is coming in.
Code:
# ps -ef | grep serial
root     13147     1  0 Aug28 ?        00:00:23 /bin/bash /root/bin/serial_watcher.sh

I am stumped on this one.  Nothing in dmesg/messages.  Yet is works fine for weeks on end with a 2.4GHz XBee.
If I restart my script every thing start working again, for a few hours.
Code:
# kill 13147
# nohup /root/bin/serial_watcher.sh &

XBee 2.4GHz
https://www.sparkfun.com/products/8710

XBee 900
https://www.sparkfun.com/products/9098

Any ideas?
7  Using Arduino / Programming Questions / Hardware interrupt with a 555 Timer, or internal timer, with a sleeping arduino? on: July 20, 2012, 03:50:37 pm
Question:
Is it possible to use a timer to wake an Arduino once every 5 minutes, regardless of how long the code takes to run?  I know I can do this with a hardware interrupt and 555 timer set to pulse once every 5 minutes, but I would rather not add extra hardware.

What I have:
Execute code --> Sleep 5m = 5m + execution time for each cycle

What I would like:
Start 5m timer, Execute code and go to sleep, sleep until the 5m timer expires = 5m for each cycle, regardless of execution time

The setup:
I have an Arduino Fio (V2) attached to N number of DS18S20 temperature sensors. The Fio is solar/battery powered and transmits data back home via XBee. The Fio/XBee are set to deep sleep for about 5 minutes between reads. I would like new data every 5 minutes (+/- a few seconds).  With the addition of each DS18S20 the sampling time goes up. I am using the Arduino Narcoleptic http://code.google.com/p/narcoleptic/ code to put my Fio to sleep. My current watt draw when asleep is less then any meter I own can read. :-)

My current sleep code is rather dumb
Code:
//28 = about 5min including code execution time
for (int i=0; i < 27; i++)
{
  Narcoleptic.delay(10000); 
}

Any ideas on how to do this with out adding hardware?
8  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz (Solved) on: November 21, 2010, 10:33:46 pm
We have gotten off topic.  The timer code worked great.
9  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz on: November 20, 2010, 05:40:47 pm
Setting up Analog pin 5 as an interrupt pin...
Code:
void setup()
{  
  //make analog pins 5 into a pin change interrupt
  PCICR |= (1 << PCIE1);
  PCMSK1 |= (1 << PCINT12)
}

ISR( PCINT1_vect )
{
  digitalWrite(ledPin, HIGH);
}

This should work.  Will do testing soon.
10  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz on: November 20, 2010, 03:28:12 pm
Quote
Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2) and 1 (on digital pin 3).

PORTD=0~7....  CRAP!
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz on: November 19, 2010, 11:30:38 pm
I love open source.  There are many people who have many different ways to solve this problem.
http://blog.makezine.com/archive/2008/05/makeit_protodac_shield_fo.html
http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208192843

At this point in time, I think I have the fastest solution.  If I push the i++, and the i==0 into asm, I will have the fastest solution.

It does not really matter, as I do not need to run at 15.99MHz  :-)

I am really looking forward to my new scope.  Once I have that, I can place numbers on all this, and see what I need to change. Until then, I am just messing with the serial functions.
12  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz on: November 19, 2010, 10:27:15 pm
Counting cycles across my old scope's screen.
With the old code I could get a max of 1.75 complete cycles.
With the new code I get 5.5 cycles. I can get 9 cycles when I remove the 'for' loop!

So It would seem that the 'for' loop is costly! It may be a better move to use a much bigger wave table and vary the number of cycles in the wavetable in order to achieve different speeds.

Code:
//byte wavetable[32] = {128, 154, 178, 201, 220, 236, 247, 254, 255, 251, 242, 228, 211, 190, 166, 141, 115, 90, 66, 45, 27, 14, 5, 1, 3, 9, 20, 36, 56, 78, 103, 128};
byte wavetable[32] = {0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255};
byte delay_length = 0;
byte i = 0;
unsigned int z = 0;

void setup()
{
  for (z = 0; z <= 7; z++)
  {
    pinMode(z, OUTPUT);
  }
}

void loop()
{  
  PORTD=wavetable[i];

  i++;
  if (i==32)
    i=0;  
  else
    asm("nop\n nop\n nop\n");  

  /*for (z = 0; z <= delay_length; z++)
  {
    asm("nop\n");
  }*/
}
13  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz on: November 19, 2010, 04:27:59 pm
Slight code change.  Defining z as a global variable.  Dont want to define a new z every time "for (byte z = 0; z <= delay_length; z++)" is called.
14  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz on: November 19, 2010, 04:20:33 pm
If a single wave form is defined by 32 points.  How fast do you think we can go?
Code:
byte wavetable[32] = {128, 154, 178, 201, 220, 236, 247, 254, 255, 251, 242, 228, 211, 190, 166, 141, 115, 90, 66, 45, 27, 14, 5, 1, 3, 9, 20, 36, 56, 78, 103, 128};
byte i = 0;
byte delay_length = 0;

void setup()
{
  for (byte z = 6; z <= 13; z++)
  {
    pinMode(z, OUTPUT);
  }
}

void loop()
{  
  PORTD=wavetable[i];

  i++;
  if (i==32)
  {
    i=0;
  }
  else
  {
    asm("nop\n nop\n");
  }

  for (byte z = 0; z <= delay_length; z++)
  {
    asm("nop\n");
  }
}
15  Forum 2005-2010 (read only) / Syntax & Programs / Re: How do I set TCNT2 for XXXXX Hz on: November 19, 2010, 04:05:12 pm
Quote
connecting a digital pin on the RX Arduino to a digital pin on the TX Arduino
That was EXACTLY what I was planning.  :-)

Quote
millis, micros, delay, delayMicroseconds (I think) will all stop running
 That is just fine, I can write my own delay function.
Pages: [1] 2 3 ... 5