Show Posts
Pages: [1] 2
1  Using Arduino / General Electronics / Re: Low-cost power converter for low-power Arduino? on: April 11, 2011, 08:24:45 pm
I'm working with some low power stuff too, have you ever considered using a DS3231 RTC and sleep mode on the ATMEGA?  That RTC battery can last years and it can also generate a wake-up signal to the chip..If you are just using this set up to occasionally transmit data, well, you don't really need the chip awake until you are ready to, right? 

We would have to do some research on the RTC to see the idle current and if it would trigger ATMEGA interrupts from a CR2032 smiley-wink

I want to build a drift buoy to send off to see if it could make it across the pacific, using ocean currents at particular depths as a conveyor and pressure sensor to determine depth.  I will have a 'report' routine where it will surface and get a GPS location, charge the batteries with a solar cell, and transmit its data points and location to me using ULF.  Obviously I want the thing to be using little-no power when it isn't collecting data or transmitting...

I will probably lose 90% of these buoys- but not before hopefully getting some transmit data!
2  Using Arduino / General Electronics / Re: using a momentary switch with dc-dc convertor to turn arduino on on: April 11, 2011, 08:02:05 pm
Why not have a pulldown switch that goes to the interrupt pin - if the sketch is running and the interrupt occurs low (use the internal pullup on D2), then go into sleep more - and if in sleep mode and the interrupt occurs, wake up.

I was hoping to use the power supply sync to completely cut power to the chip, cutting the total consumed power to nearly zero, as this device will be in storage from time to time for periods of weeks.  On looking again at the schematic, yes, it doesn't say the SYNCIN pin can be used as a power switch, however, it also says that pulling it low will 'inactivate' the converter.  I didn't see any power consumption specs for the 'inactive' state, so maybe it isn't a stable state meant for periods longer than a high frequency cycle?

My current version of the schematic just has an open circuit on/off switch, but I would really like to use my nice surface mount buttons if possible! any ideas? I would like OFF power consumption to be <.1mA....

3  Using Arduino / General Electronics / Re: using a momentary switch with dc-dc convertor to turn arduino on on: April 07, 2011, 07:51:30 pm
Oops, see another problem!

When I push the button for OFF when sketch running, it will immediately stop the open drain on D4 and engage the P/U, keeping the system ON.  Hmmm, anyone with a bit more hardware experience have a suggestion on using a momentary pushbutton switch to toggle on/off state of chip? (without using an on/off switch!) I guess I could use 555s or something, but lots of devices have this, how do they do it and how do they avoid excessive OFF current consumption?
4  Using Arduino / General Electronics / using a momentary switch with dc-dc convertor to turn arduino on on: April 07, 2011, 07:45:25 pm
I've picked up a dcp01b series TI DC-DC converter and I'm working on a circuit to use it with a momentary on/off switch to turn on an arduino (well, actually just an Atmega328).  By using the atmega's output pins to toggle ON pull up resistors (and an open drain on the other side of the switch) could I use this set up?  I can already see that when all power is off, the SYNC IN will be left floating, which I will need to address in the final design.

I'm trying to achieve battery efficiency over a wide range of voltages from ~4.5V to 6V using Alkaline batteries-

Maybe It will be simpler to reference the below schematic and technical data:

Uploaded with

5  Using Arduino / Programming Questions / Re: Timer Interrupts on: February 24, 2011, 10:19:56 pm
I find aikoevents to be a really simple way of making things happen at regular intervals- regardless of how long those particular events take or how long the rest of your program takes to loop.  I was using before a messy code filled with millis() and interrupts to determine how long each event/iteration took, then adding times together to do one simple thing- which is repeat a task reliably at the same interval.  It was impossible to get accuracy- and not to mention made the code a mess. 

Simple=good  smiley-cool
6  Using Arduino / Storage / Re: How does openlog readFile work? on: February 22, 2011, 11:09:41 pm
Hmmm re-read the commands list over at GitHub, looks like sending openlog simply "read test.log" then ASCII 13, then doing a will read the entire contents of the file, start to finish...

You know, I think most of the problems people have with openlog aren't because of openlog itself- but because the openlog examples given do not work.  I reworked the example sketch, and I have at least the logging part of mine working flawlessly, every time.  As soon as I can get the readfile working, I'm going to post up a new example that is tested and working(for at least the newest version of openlog). 
7  Using Arduino / Sensors / Re: Is my brain or my TMP36 broken? on: February 21, 2011, 09:23:27 pm
Wait a second, you should never see 700+ on the analog input from this sensor.  It should be down around .73- about 1.76 v If I am not mistaken- So 1.76/5 = .352 = only 360 on the scale... and that would only be if it was around 125 C in your workspace!

Check your connections-

Also, are you using a 3.3v arduino? because all of this would make sense then.
8  Using Arduino / Sensors / Re: Is my brain or my TMP36 broken? on: February 21, 2011, 09:14:36 pm
 This should work:
float tempvoltage = analogRead(tempsensorpin) * 5.0;
  tempvoltage /= 1024.0;
  float temp = (tempvoltage - 0.5) * 100;

As long as you have a 5v arduino!

if you are still getting readings of 293+, then have a close look at your sensor, you probably have an LM335 instead of a 36GZ...  In that case, simply add the line:
temp = temp - 273.15
to the end of the above.

I happen to have both of these sensors in front of me
9  Using Arduino / Storage / How does openlog readFile work? on: February 21, 2011, 09:00:43 pm
Instead of trying to read my MicroSD direct with the computer, I've set up a "logswitch" button, whereby when HIGH, openlog will log data to test.log.  When it is LOW, I want to readFile, and dump the data to the serial port (where I can capture the whole log with gobetweeno). 

Is this practical or possible? If so, could someone help me with the readFile(x, y, z)?  I would really just like a better explanation of how readFile works- as in, x is filename, y is start record (zero- I want the whole log) and z? can I determine the end of the record on the SD, then set it as a variable in place of z- in order to save the entire log to variable fullog?

ps, I know there is a problem with this part of the sketch, since openlog is not dropping into command mode (and therefore printing 13 to serial monitor).  The logging part works fine though smiley
void logserial(){
  if(digitalRead(logswitchpin) == HIGH){
  //logger.print(26, BYTE);
  //logger.print(26, BYTE);
  //logger.print(26, BYTE);
  //logger.print(13, BYTE);
  //logger.print("append ");
  //logger.print(13, BYTE);
  DateTime now =;
   if(now.hour() < 10) {
  logger.print(now.hour(), DEC);
    if(now.minute() < 10) {
    logger.print(now.minute(), DEC);
    if(now.second() < 10) {
    logger.print(now.second(), DEC);
  logger.print(" ");
  logger.print(13, BYTE);
  logger.print(10, BYTE);
  if(digitalRead(logswitchpin) != HIGH){// if we aren't loggin', were printin'!
  logger.print(13, BYTE);
  readFile("test.log",0, 8);
  String fulllog;
  fulllog =;
void readFile(char fname[40], int start, int length)
  int wait = 200;

  //Send escape command
  logger.print(26, BYTE);
  logger.print(26, BYTE);
  logger.print(26, BYTE);
  //We don't know where we are without checking. Either we just dropped to command prompt, or we were already sitting at the command prompt.
  //If we were already at the command prompt, then we've got a bunch of command characters sitting there.
  //Press enter to dump them
  logger.print(13, BYTE);
  logger.print("read ");
  logger.print(" ");
  logger.print(" ");

  //OpenLog is echoing all the commands up to this point including 'read test.log 0 100', etc. We don't want this stuff in the buffer
  logger.flush(); //Remove all the trash in the current buffer

  //Now send the enter command to OpenLog to actually initiate the read command
  logger.print(13, BYTE);

10  Using Arduino / General Electronics / Re: Zener diode??? on: February 13, 2011, 11:41:16 am
Thanks Lefty! I think I may have a mislabeled few Zeners... perhaps I grabbed 9+ v Zeners instead.  I haven't had a chance to pick up some new ones that will hopefully conduct at 5.1v. 

I also want to add some other things to make this circuit even better- a 10k protection resistor for the input pin, a 10k protection resistor for the Zener, and also a 1uF cap to smooth the sensor output.  Am I on track with the below? I will be datalogging with a gas sensor, so the output doesn't need to be super fast.  If this looks like a workable circuit to your expert eyes, I will be posting it along with my finished sketch to help anyone with 4-20mA sensors- my first contribution to the community! (yay!!!)
11  Using Arduino / General Electronics / Re: Zener diode??? on: February 12, 2011, 04:05:06 am
The diode should be from the input to ground, the resistor should be between the arduino input and the source.

Grumpy, Since the output of the sensor will vary current, shouldn't I need to measure the voltage drop across the 180ohm resistor?

So, I have not received my sensor yet, and I am working on the hardware (and sketch) to read it.  I am simulating the low value sensor output (4mA) by running my 9v Vin through 2250ohm resistance, giving 4mA current.  Of course, the sensor won't work off 9v, but that won't matter for the design of the circuit since 4mA is 4mA right?

With this setup, how could I possibly have blown my Zener? Running the 9V through my simulated sensor at 2250ohm would only give .03W, below my .5W rated zener!?

I would like a protection diode on it in case for some reason the sensor malfunctions and outputs 28 or more mA of current, which will result in more than 5v at the input pin.
12  Using Arduino / General Electronics / Re: Zener diode??? on: February 11, 2011, 08:26:54 am
Oops! didn't label it- it is 180ohm- making the signal work out to .72v to ~3.6v for the input.  I want to protect the input with the diode though, in case the resister fails/becomes loosened from the circuit due to my non-artistic soldering work, or the sensor power voltage increases (since it is regulated external to the Arduino- taken from Vin pin). I'm not sure how I could have blown it, since it is new.  Perhaps it was mislabeled?

I am using it correctly, yes? black stripe side away from ground?

The 9v is the power wire for the sensor, which I have temporarily simulated with resistors to make a 4mA signal (at 9v) and a 20mA signal. 
13  Using Arduino / General Electronics / Zener diode??? on: February 11, 2011, 06:58:38 am
hmm I'm building a shield to condition the output of a standard 4-20mA sensor for the Arduino, and I would like to make it safe for my poor Arduino.  I have the Zener set up as shown below, but I'm still getting the full 9 volts at "Arduino Input Pin" (it isn't yet actually attached to my Arduino!). It is supposed to be a 5.1v zener, so why isn't it saturating and conducting when at 9v?

PS: this works just fine with and without the protection diode- but I just want to prevent 9+ volts from damaging my analog input.  Also, there is of course a P/D resistor on the input pin not shown.
14  Using Arduino / Networking, Protocols, and Devices / Simple logic level convertor for SD card interface? on: February 02, 2011, 01:37:00 am
I realize that I will need to provide my SD card socket with a robust 3.3v power supply, but will this logic level converter handle the SPI comms between my uno and the SD card?

Also, how is it different than a substantially more expensive I2C level shifter?
15  Community / Bar Sport / Re: 555 Contest on: January 31, 2011, 05:09:38 am
Too bad I don't have more time this month! I'll put my crazy Idea out there for some brilliant and bored member here to undertake...

Basically, I want to use 555s to play "fur elise" with no logic involved.  With enough 555s, you could run each of them on a precise cycle to control two or more 555s which would be the tone generators outputting through speakers.  By using other 555s to control several (dozen) resistors to vary r1/r2 values, it would be possible to send the correct frequencies to the tone generating 555s- at the correct time.  One master 555 could control the whole loop, repeating the tune every minute or so!

hmm, here are the frequencies and r2 values for the tones for the notes during the first 30 seconds of 'fur elise' These would assume an r1 value ~1/10th of the r2 value, and a .1uF cap. 
frequencies needed:
329.628     r2= 21236ohm, cap=.1uF     
311.127       r2 = 22508
293.665     r2 23890
261.626       r2 26819
246.942       r2 28455
220.000       r2 31818

207.652     r2 = 33816
164.814     r2 = 42862
146.832     r2 47945
130.813       r2 53846
110.000     r2 63636
103.826     r2=67961ohm cap = .1uF

Good luck! smiley-razz

Pages: [1] 2