Show Posts
Pages: 1 ... 916 917 [918] 919 920 ... 1116
13756  Forum 2005-2010 (read only) / Interfacing / Re: Detect snow in rain gauge on: December 24, 2010, 11:13:20 am
Just move to where I live, it snows here lightly only every 20+ years or so.  smiley-wink
13757  Forum 2005-2010 (read only) / Interfacing / Re: 4 nimh Battery charging through arduino on: December 24, 2010, 12:55:10 pm
Quote
How could one take advantage of the 1.1V reference internal to the ATMega?

Simple by using the internal 1.1v reference then one can use an external 2 resistor voltage divider to cut the battery voltage down such that maximum battery voltage is measured as say 1vdc. Software can be used to scale that to any internal value you wish, or just treat it as 1v = 100%.  The 1.1v reference will not change as the battery (therefore Vcc) slowly drops as the battery discharges.

Make sense?
13758  Forum 2005-2010 (read only) / Interfacing / Re: 4 nimh Battery charging through arduino on: December 24, 2010, 11:08:10 am
Quote
how do phones and other devices read their battery level?

By using a A to D reference voltage that does not change with battery voltage.

Lefty
13759  Forum 2005-2010 (read only) / Interfacing / Re: 4 nimh Battery charging through arduino on: December 23, 2010, 12:06:28 pm
Quote
Basically, i wont be using the batteries that are being charged while reading the battery level.

Understood. However the more fundemental problem is that how the analogRead() function is setup by default you will not be able to read the true battery voltage if it is also directly being used to power the +5v bus of the Arduino, it will always read out as 1023 counts, never change even though the battery voltage is decreasing over time. You will have to read up on alternate voltage references and using resistor voltage dividers. Lots of info on this forum if you search around.

Lefty
13760  Forum 2005-2010 (read only) / Interfacing / Re: 4 nimh Battery charging through arduino on: December 22, 2010, 11:46:51 am
Quote
Actually, i planned on having a spdt switch, or a latching relay to the circuit to choose between charging, and operation when plugged in to another powersource.

What does that have to do with the ability to be able to measure the battery voltage via the Arduino accurately?

Lefty
13761  Forum 2005-2010 (read only) / Interfacing / Re: 4 nimh Battery charging through arduino on: December 22, 2010, 12:51:01 am
Quote
I'm using this to power my Arduino, as well as run 2 motors, so they are eaten up quickly. I was wondering if i could use analogRead to measure the battery capacity.

Well you can but it will be a meaningless reading in that it will measure they are always fully charged? How could that be? Well if you are powering your Arduino with the 4 AA batteries in series then they becomes the Vcc for the processor chip which by default is also the reference voltage for the analog to digital function on the chip. So by reading the battery via a analog input pin the resulting measurement will always be 1023 counts regardless of the actual voltage of the cells. They will remain true until the battery voltage gets so low that the chip stops functioning. Pretty cool huh?

 So what can you do? Well you can read up on the A/D section of the datasheet for the processor. You can consider using internal or external regulated A/D voltage references. There are ways around it but it's best that you try and understand the how and why as there will be various trade-off decision of costs Vs component count, etc.

Lefty
13762  Forum 2005-2010 (read only) / Interfacing / Re: Transformers on: December 22, 2010, 09:15:53 pm
 If it has an AC output you could run it theoretically 'backwards', however not at the voltage levels you speculate on because of the voltage rating of the insulated wire used in the internal transformer windings. If the rectification is internal to the wall wart then it has DC output and cannot be used 'backwards', as DC will not pass through a transformer.

Lefty
13763  Forum 2005-2010 (read only) / Interfacing / Re: How to constrict serial input to only 3 numbers? on: December 23, 2010, 11:39:37 pm
Quote
It needs to be a 3 digit number between 0 and 180.

But 0 is a one digit number and 42 is a two digit number.  smiley-wink

Lefty
13764  Forum 2005-2010 (read only) / Interfacing / Re: Capacitors on: December 22, 2010, 06:01:38 pm
Quote
Does this mean 47 microF @ 10 V?

Yes. Generally if a cap has polarity markings they are electrolytic capacitors that are almost always in microF units.

Lefty
13765  Forum 2005-2010 (read only) / Interfacing / Re: Arduino pin high only 2,68v ??? on: December 22, 2010, 07:16:50 pm
Quote
i have here som 390k resistor is this enough ?

Much too high a value, it would only allow like 10 microamps to flow, not enough to cause the led to light. You must master ohm's law calculations or use a automated program to calculate it for you. You must know what current the LED is rated for continous operation, most want around 10-20ma of current flow.

By the way you can buy replacement processor chips for around $6 as if you continue to burn out output pins it will become faily useless.

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

LED resistor calculator:
http://www.hebeiltd.com.cn/?p=zz.led.resistor.calculator

Lefty
13766  Forum 2005-2010 (read only) / Interfacing / Re: Arduino pin high only 2,68v ??? on: December 22, 2010, 06:47:47 pm
Quote
no resistor
led+ direct to pin11 ground direct to ground..

That is your problem. There [glow]must[/glow] be a current limiting resistor wired in series with the LED, 1k ohm will work or calculate the needed resistance to run the led at it's recommend current level.

The way you are doing it will or has damaged the output pin and shorten the life of the led.
13767  Forum 2005-2010 (read only) / Interfacing / Re: Making a 5x5x5 led cube and need help!! on: December 22, 2010, 05:29:24 pm
Well it's a little dated, but did post about my 5x5x5 cube project.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1271300719


Lefty
13768  Forum 2005-2010 (read only) / Interfacing / Re: Pressure transmitter 4-20mA with arduino on: December 21, 2010, 06:05:57 pm
Quote
Yeh I know that but was just advising about the elevated zero in case it was not immediately appreciated by Frode.  Old enough to go back to the good old days 3-15psi then 10 to 50ma and finally 4-20.  Couldn't be bothered with today's virtual signals all running down the same wire and dependant upon multiple single points of failure.

I'm old enough too. smiley-wink
  I worked for 27 years in a oil refinery (Chevron) until retirement and we went through all that stuff. They had, when I left, so far resisted going to field bus and other digital only instrumentation loops, but I'm sure they have started by now as the instrument and control system vendors had been investing millions and constantly badgering us to upgrade to their latest stuff.

 I too had big reservations about the possible failure modes where a given plant can lose a million dollars a day in lost profits if shutdown because of instrumentation/control system failures. It could be a very stressful job at times, but pay and benefits were first class.

Lefty
13769  Forum 2005-2010 (read only) / Interfacing / Re: Pressure transmitter 4-20mA with arduino on: December 21, 2010, 03:45:43 pm
Quote
Bear in mind that the bottom 20% of the 0-5volt range is "lost" sonce the scale range starts at 4ma which produces 1 volt across the 250ohm resistor.

Yes, it is a pain but that's tranducers for you.

Well there was a valid reason for the 'live zero' 4-20ma standard to be designed that way. It allowed a system to be able to tell the difference between a valid zero reading and a broken current loop wire which would also result in a zero reading. The main advantage of current loop instrumentation loops is that the sensor can be hundreds and even thousands of feet away from the measuring point with no loss of accuracy, unlike voltage sensors where long cable runs can result in voltage drop causing measurement errors.

13770  Forum 2005-2010 (read only) / Interfacing / Re: Pressure transmitter 4-20mA with arduino on: December 21, 2010, 01:55:31 pm
Scale down your drawing and maybe one can actually see it. Also most (and yours according to the second datasheet) 4-20ma transmitters utilize only use two wires to the sensor, labled + & -. You have to create a current loop comprising of a voltage source (10V to 30V d.c. (24V d.c. maximum above 110°C)) and a 250 ohm resistor. The wiring would go from negative of the voltage source to resistor, then resistor to - of transmitter then + of transmitter to positive of voltage source. The arduino wiring would be wire ground pin of voltage source to Arduino ground pin and other end of resistor to analog input pin. Measurement voltage to Arduino would be 1-5vdc corresponding the 0-100% of pressure measurement range.

Lefty
Pages: 1 ... 916 917 [918] 919 920 ... 1116