Show Posts
Pages: 1 [2] 3 4 ... 197
16  Using Arduino / Programming Questions / Re: NEWBIE: Building code to monitor in the background. on: September 15, 2014, 12:26:57 pm
Proper use of this forum section requires the use of code tags and the method is here: http://forum.arduino.cc/index.php?topic=97455.0
Your question just might be answered a great deal faster if it wasn't so hard to read 5 screens of code instead of one scrollable window...

...
17  Using Arduino / Programming Questions / Re: question about 2 different water tank code! on: September 14, 2014, 06:24:32 am
I didn't consider anything but a means of measuring both tank volumes, Obviously connecting both was a simple answer to an unstated condition..
However with a little imagination and some very little (simple) mathematical knowledge it could be written as a simple function that can be called with each data set.. The rest is up to your skills at C/C++ and your ability to use google and a simple calculator to prove your math.
Particularly since one variable per tank can change...

...
18  Using Arduino / Programming Questions / Re: Repetition of pseudorandom Random() sequence on: September 14, 2014, 06:11:59 am
@ Nick and Coding Badly?
  Very entertaing from both aspects ..
Dilbert was great... However Nick's 99 coins was also great (er)
Nick + 1
CB.. +  1
Very provocative Both.

Doc
 I thank you both for a real Jewel...
19  Using Arduino / Programming Questions / Re: Interrupts in Adafruit_GPS library example on: September 14, 2014, 05:40:13 am
GPS sentences occur every second... Endlessly... Here is the comment about that code... or at least the ISR code
Quote
// the nice thing about this code is you can have a timer0 interrupt go off
  // every 1 millisecond, and read data from the GPS for you. that makes the
  // loop code a heck of a lot easier!
It does but it is most unfriendly with other code ... like writing to an LCD display...
Try Mikal Harts TinyGPS++ Found here:https://github.com/mikalhart/TinyGPSPlus/releases/tag/v0.94b...
It's a whole lot easier than the Adafruit example sketch.

Doc
20  Using Arduino / Programming Questions / Re: question about 2 different water tank code! on: September 14, 2014, 05:28:19 am
Your answer is dependent on the geometry of the two tanks which determines the level of equal amount of water.
A simple ratio can be used for comparing the water levels..
OR if one tank can be above the other, the total level level or volume is related to the pressure at the final tank outlet..
Or here is a simple Google search that will return the volume in gallons, Took me 5 seconds, I guess you don't have google?
Quote
Hi Dean,

I'll do cylinder A and that should show you how to do the calculations for B. I am going to assume that you mean American gallons. One American gallon is 231 cubic inches.

The volume of a cylinder is given by

volume =   radius2  height

Your cylinder A has a radius of 4' = 48" so, since  is approximately 3.1416, one foot (12 inches) height of this cylinder has a volume of

  radius^2  height = 3.1416  482  12 = 86859 cubic inches.  // use your tank numbers here and do it for both tanks
A simple set of calculations with a slight re arrangement of the formula above will give you an answer that can easily scaled to any measurement type that you desire


Since 231 cubic inches is one gallon this is

 86859/231 = 376 gallons.

Since your cylinder is 12 feet high its volume is

12 multiply 376 = 4512 gallons.

Penny
Stolen from http://mathcentral.uregina.ca/QQ/database/QQ.09.04/dean1.html...

Doc
21  Using Arduino / Programming Questions / Re: Receiving erratic values for potentiometer - WITHOUT touching it/moving it on: September 14, 2014, 05:17:33 am
@ BulldogLowell... The 7805 is less than an optimal solution as it has a 2.5 V overhead or dropout voltage thus requiring nearly 8V for proper operation which will not enable use of all the capacity of the battery as it will fail when the Vin  drops to 7.5V (Ideally) to the regulator and since most 9V batteries will drop to 8 to 8.4 V rather quickly... I also use a 470 to 1000 uF capacitor across the battery because the internal resistance of a battery must increase as the battery loses capacity due to use...
It can be as  much as 30 - 40% with light loads, Worse by far as the load current increases due to the increasing losses due to the changes in the battery
The solution mandates a low dropout voltage linear regulator, ie one with less than ~ .8 V dropout voltage @ full load current, otherwise your reasoning is spot on.
For my style of engineering (Murphy was an Optimist) using a 9V battery on an LM7805 leaves no useful margin...
Whenever possible I use a cellphone charger to the 5V output on the PCB, else a 7.5V wallwart to the Vin or DC in..
I really like the mains operated cell phone chargers as they are nearly free... most all fail due to the device connector wear But I've Never had one fail and put out more than the rated voltage...
Simply because they are free or nearly so... Typically $0.75 at any thrift store in Southern California...

Doc
22  Using Arduino / Programming Questions / Re: Receiving erratic values for potentiometer - WITHOUT touching it/moving it on: September 14, 2014, 12:05:10 am
onlythis one http://zeldor.biz/wp-content/uploads/2012/09/BatteryPack.png is likely to sovle your issues..
For My development work I use a 7.5V 2A power supply plugged into the DC in connector, Mainly because after the protection diode and the linear regulator losses it provides ~ 7V to the regulator which has an ~ .6V dropout voltage which is more than enough to keep the 5V dc supply in regulation (7.2V DC at the regulator input and since only 1 V is the maximum required difference between the source and the load voltage X the load current keeps the loss heating of the AMS1117-5.0 to a minimum .1A X 1.?1 V = ~.1 W or 100 mW energy lost as heat.. IHTH...

Doc
23  Using Arduino / Programming Questions / Re: Receiving erratic values for potentiometer - WITHOUT touching it/moving it on: September 13, 2014, 11:41:36 pm
If in fact your grounds are correct and it looks like they aren't or or the pot is very noisy from your measurement data, then making a simple running average might well be your easy solution..
You might also try a smoothing (low pass) capacitor from the pot wiper to ground. 50 to 100 nF is a reasonable starting point and I'd use the smallest value that returned a stable measurement.
I would also if 'twere me... to also try a separate power supply for the controller board only (A battery big enough to supply the same current as the USB power. this will eliminate the possibility of a ground loop causing mains ground noise to modify the measurement.

Doc
24  Using Arduino / General Electronics / Re: Amateur Spectrum Analyzer on: September 12, 2014, 09:48:43 am
There are several stores, Amazon, Ebay, Alibaba.. to name a few that sell SDR's based on the RF280 chip. They are called DVB-T and some nice freeware programs to make a 24 - 26 to ~1700 MHz Radio. Google SDR...
However extracting the specific information you seem to desire.. (You've not really done a good job of specifying exactly what you want to do..) There is also a channel scanner for the 2.4 GHz ism band radios that might be a beginning...

Doc
25  Using Arduino / Networking, Protocols, and Devices / Re: 433 Mhz RF signal cloning on: September 11, 2014, 11:44:06 am
I own a few logic analyzers (a couple of clones) and a Saleae Logic and a good enough o'scope (a Tektronics 2213) with a 60 MHz  vertical amplifier bandwidth.
I also have about 50 years experience in electronics... Both mixed signal and RF...
One of the issues in the Audacity measurements is that they are analog in nature, Not digital so extracting the pulse width to any real accuracy is a matter of chance.. Particularly with the SDR as a measurement tool. Mine are based on the R280 chip and are better positioned as crude spectrum analyzers.. I enjoy very much playing about with them BUT I'd Never make an attempt at deriving accurate timing from them.. it simply isn't there.
Drift of the 35 MHz? (KHz) isn't really critical as the actual bandwidth for the detector is rather large. What is missing is the transition speed.. The Audacity measurements are effectively analog measurements that are capacitor coupled, Not DC coupled so one looses the accurate timing required to extract the pulse width's due to the effective 'spreading' of the pulses due to charging and discharging effects caused by the translation to the Audacity input as the sound card that translates this information to time related events is slewed by the measurement method itself..
Unfortunately a fair quality O'scope is still above $100.00.. This for a used good quality O'scope and well beyond the capacity of the various inexpensive "Digital Handheld Devices"... Unfortunately there is a steep learning curve required to using a device like an O'scope effectively.
That having been said the best method that I can see is to use a logic analyzer.. A cheap Alibaba clone is more than ample for your needs... However you will need direct DC measurements of the encoder to extract accurate timing information.
I would first measure the data at the key pin of the OOK transmitter or LED driver output with a logic analyzer to extract real time measurements before I tried to interpret the TX data as it is ground referenced and thus easier to accurately measure..
The drawback for many is the lack of the skills to identify the measurement point and the lack of both skill and equipment to do so with.
What I've seen so far look like faulty measurement techniques or PWM/PCM encoding and I suspect that this is not the real reason for failures in decoding these measurements. Likely more skewed data from the measurement techniques.
The CRC is really important and must be taken into account.. Basically Assume Nothing unless you can see the same results for any unique pulse train.
There has been a fair amount of investigation about IR encoders and decoders that can be had for a little imagination and a lot of searching.
This forum member might be of great help http://forum.arduino.cc/index.php?action=profile;u=193325
and this is a helpful Blog from him: http://bit.ly/1cvd0at.. IHTH..

Doc
26  Using Arduino / Microcontrollers / Re: MEGA 2560 reset voltage on: September 11, 2014, 10:00:24 am
@ Raschemmel... The operative point is the the threshold is not an absolute value, It depends on the actual applied Vcc..
Thus Vhigh is .9 X Vcc and Vlow or reset is .2 X Vcc not .2V or .9V

...
27  Using Arduino / Programming Questions / Re: Measuring amperage on: September 11, 2014, 09:44:51 am
Yes it should I didn't really read the whole article but my suggestion Re: the op-amp as to leave the math to the op-amp and it's feedback (gain set) so as to produce a voltage that is equal to the amperage and to offset the bi-polar output to a single ended solution.
Thus it becomes a reusable solution that requires less code to convert for example the
Quote
ACS712ELCTR-05B-T
Which has a sensitivity of 185 mV/A to a number that is easier to use.
Since the part # mentioned is a 5A sensor (ideal I think) converting the output voltage from 185 mV to 0 to 5 A can  certainly be done in code there is still the Output + mV/A still has a possible plus or minus output value and requires the use of floats extensively meaning larger code because first you must scale the output to the actual current first and then display that number... Which can be done with int's much easier when the ACS712 output is representative of the actual current...
Your requirements and what I read of your skills indicates to me that a small read about op-amp's would give you more options.
It will also make a re-usable device much easier to implement should you need one for another use or another project.
One op-amp 3 or 4 resistors and 2 pots makes an easy circuit to use..
I've taken the liberty of attaching data sheets on the three devices mentioned... The ASC712 device is relatively cheap from fleabay , in the 3 to $5 dollar range and has a minimal loss due to it's sensing resistance.. The TIL431 is also in the same class (Vref and adjustable too).
The LMC662 is  very easy to use and is relatively stable... The Dip part is under a dollar (or should be) so "Give it a play"...
There are example circuits on all the data sheets too.
If you get lost, I'll be watching this thread.. so after Mr Google post a question and I'll try to answer it as best as I can...
The 20A ASC712 device has a 100 mV/A output but it sort of is out of range for small (1 to 5A) due to the
ADC limitations and while it would work I feel that it is not the best choice.. I do hope this helps.. you and anyone else needing a solution such as yours..

Doc
28  Using Arduino / Programming Questions / Re: Measuring amperage on: September 11, 2014, 08:21:01 am
Perhaps this would better done as a search by the OP But an Allegro ACS712 series hall effect current sensor might be a 'somewhat' better choice than attempting to use a sensing resistor... It requires nearly the same additional Op-Amp as would OP's attempt. is missing... But far more accurate... A TIL431 and a resistor and a pot for calibration make an excellent Vref source, Even considering the stated accuracy of the SAR ADC used in the 328P series of uControllers (+/- 2 counts, Typ).
The output of an ACS712 is Vcc/2 and changes as the current flow shifts from zero. Discharge is typically Vcc/2 + Vout and charge is Vcc/2 - charge depending on the polarity of the sense inputs which go in series with the load... This device can be used to sense either the positive or negative power supply lead. An LMC662 (dual rail to rail op-amp) can be the gain block to rationalize the output shift and the second op-amp can be used as a level shifter to convert a bi-polar output to a zero referenced output voltage.. Easily...
I leave the details to OP's skill with Google.. As I Know there are reference examples for both freely available from Google..
BTW Did the OP make even a small effort to search the Arduino site first..
This is not the first time this or similar requests have been asked here... The Answers are typically found in the General Electronics section and the answers are relatively simple... Once you "Search For Them"... I am happy to answer specific questions on methods and circuitry... Only if the OP has done his part in researching the question... The OP would learn little If I did the relatively simple engineering required... I'm not participating in this forum for anything else but what I don't already know...
If I can be of help with advice.. Great... But I don't consult for free and I will not do design work for anyone but myself.
This is a trivial issue and the answers can all be found in the "Op-Amp Cookbook".. It just takes some initiative from the OP to do the basic work... I'll be happy to fix bad circuitry But...

Docedison
29  Using Arduino / Programming Questions / Re: byte level boolean, calibrate crystal, eeprom as flash on: September 11, 2014, 06:16:46 am
@ Coding Badly?...
Thank you for this reference to a most useful library... A year or so back I bought 3 "Clock modules" from Fleabay...
They have ATMEGA8-AU's as processors and for the most part work well however the code was written in another environment that  I don't yet understand well enough to use (I've tried) apparently it is the Atmel Studio IDE and I've been looking for something like this. The unfortunate part is that the month and day data is written in what looks like simplified Han...
Combined with the HT1632 library because it's the display controller, will allow me to make a relatively painless transition to the Arduino IDE and 3 functional clocks with virtually no change to the board...
While I realize that a DS3231 is a much better choice I'd rather not make extensive mods to the board... The board has the ISP connections broken out to a 6 pin header so all I need to do is write what I need and test it.. I do have a spare HT1632 board for testing and I can develop the code on a breadboard and test it with a single HT1632 and display...

Doc
30  Using Arduino / Programming Questions / Re: Mosquito Anti Loitering Device on: September 10, 2014, 06:40:31 am
 Most professional "Perimeter denial" devices use a combination of both doppler radar and IR sensors...
I've designed Perimeter Denial devices with a 500 meter range using a 75 KG body mass as the doppler range and the IR function was for Hot  bodies... like automobiles... or close body radiation
The Mosquito device looks like a short range device working under the assumption that radiated IR from a human sized "model" was close enough to exceed the normal ambient IR radiation of a hot day or night where the ambient radiation is greater than the ~ 86 deg average body radiation of a fully clothed body...

Doc
Pages: 1 [2] 3 4 ... 197