Show Posts
Pages: [1] 2 3 ... 188
1  Using Arduino / Microcontrollers / Re: Can anyone recommend a ADC? on: April 20, 2014, 03:00:17 am
IMO using any adc with a Vref tied to the Arduino usb powered Vcc is a recipe for disaster. There are several options from a TIL431 "Adjustable Zener" to a full Precision voltage source but whatever method used does require a separate dedicated reference supply.
Noise or variation of Vref is the same as noise or variation of the Arduino USB Vcc source if it is used for the external ADC Vref. The TIL431 is a cheap low tempco adjustable zener with a 100 uA min zener current and the max is 100 mA. The device has a reasonably good tempco in of itself... Probably very good for an enob of 10. However as has been mentioned the Arduino board has several glaring PCB layout errors.. the least is that is isn't a star topology where all the supply returns individually come to the same point which is the PSU return point. There is also little attention to the AVref supply for both noise filtering and ground or supply common mode noise. Individual Pi section LC type filtering in both the Vref and ground returns are a good idea and or a separate low noise linear or dedicated reference... This is very applicable when more than 10 bits of accuracy are required and finally the ADC on the Arduino board is an SAR type architecture which isn't really intended for high accuracy. I always mistrust the LSB and frequently will add some clean buffering and gain so I can drop the LSB. The best option by ar is a dedicated off board ADC of 12 - 14 bits as the PCB layout for that level of accuracy isn't nearly as demanding as are higher resolution parts. Finally the National Semiconductor Linear App notes (Vol 2 I think) describe in great detail the requirements for high accuracy ADC's. Unfortunately the books have been out of print for many years... the issues are the same though and both TI and National (owned by TI now) have available app notes that are applicable to your issues.. I would first read all I could find on layout and good wiring practices from both sources... Burr Brown also had some great stuff for care and feeding of high resolution ADC's... Old to be sure but most applicable.

Doc
2  Using Arduino / Programming Questions / Re: TinyGPS++ - Failed checksum on: April 19, 2014, 06:06:12 pm
I corrected a massive error in my first answer... there are 6 or 7? total massages /second @ 4800 IIRC and the function for printing for both the Adafruit '7735 controller and most if not all of the UTFT library is blocking thus one of the issues. If the NMEA 0183 serial data is decoded and  and the print function then displays the data either an interrupt is required or a simple solution as I wrote in my first reply it is necessary to print the whole screen in setup() and then ONLY print the data (Most Important) returned in the loop() that has CHANGED. while the GPS sentences are short... they still call the isr and will make printing stall (and everything else) stop until the isr completes, in this case again IIRC ... that's about 500 mS.. the easy answer for all of this is a state machine IMO. The short answer for all of this is a  is to make everything work around 1 second as an interrupt and keep the functions that are required from a flag in the ISR as short as possible. Since the TimeGPS++ library isn't dependent on the 'age' of the GPS sentence as a whole it will anywhere it can hear.. GPS data as indicated by valid checksums. It Will return accurate time. AS I said before my Skylabs SKM53 can be instructed to listen to the most useful for time/static location data which are GGA and RMC. I bring it up again to point out that it should be looked for on the Mfr's datasheet for the device you own as it will free up a large chunk of time.
I made these measurements with a Saleae logic analyzer last year and I'm working from memory... IHTH.

Doc
3  Products / Arduino Due / Re: Arduino Due TWI/I2C channel 1 on: April 17, 2014, 11:31:47 am
The outputs of the Due is about 4 mA, the Arduino about 20 mA... for best performance the IIC Pull ups should be 2k2 ohms for a 1.5 mA bus current. 10k will allow 330uA which makes length and thus loading capacitance more of an issue than the 2k2 value would.

Doc
4  Using Arduino / General Electronics / Re: Basic question: Arduino wires on: April 17, 2014, 11:00:45 am
Aluminum has about 1.5 x the unit identical resistance of copper. Or two same dia/length wires one copper and one aluminium will wire will have different values of resistance where the aluminium wire will be approx 50% higher than the copper wire..

Doc
5  Using Arduino / Programming Questions / Re: TinyGPS++ - Failed checksum on: April 16, 2014, 01:21:21 pm
Serial printing Is a blocking function and is a big chunk of time that must.be shared with the GPS sentence parsing. My answer was to print the support text and only update the changed data. I had a baro sensor an RH/temp sensor and tested two GPS Devices both with the same issues until I split the main data form or screen into drawing the static data (the labels)  and when required data changed I updated that data as required. Since the RH data requires ~2.5 seconds between measurements I updated the barometer at twice the rate of the RH/Temp data  and the display at the same time.
Time on the second, and the RH data once every 3 seconds. The BMP 085 was updated every 5 seconds.

This worked well with all but the Adafruit 1.8 display which requires 'clearing' or printing a blank field or box prior to printing new data I cleared the field first then wrote the data to the cleared area. The '7735 adafruit library only updates the new pixels it doesn't clear them first.

Doc
6  Using Arduino / Programming Questions / Re: GPS with Arduino UNO - 2. on: April 16, 2014, 05:07:25 am
Sooner or later you'll learn the "language" and the procedures...
I stand by my original comments because IMO Strictly I read youasking for the simple experience that I was EALILY ABLE TO READ FFROM A HALF A DOZEN GOOGLE SEARCHES AND A LOT OF SEARCHING IN THIS AND OTHER FORUMS... YOU STATED NOTHING EXCEPT A REQUEST FOR INFORMATION ON HOW TO DO IT. tHE MANUAL IS CLEAR...  READ IT...
AND IT WAS THIS QUESTION THAT i RESPONDED TO
Quote
So, what should I do to make sure that my GPS is in the NMEA mode ?!!.
RTFM, PAGE 9 REFERS TO THE COMMANDS THAT MUST BE SENT TO THE TO THE GPS DEVICE VIA SERIAL TX TO PLACE IT IN THE NMEA0183, BINARY OR USER 1 PROTOCOL...
YOU MIGHT HAVE QUOTTED THE RELEVANT TEXT AND ASKED HOW TO DO IT... HOWEVER IT WASN'T THERE AND THE 5 SECONDS I "WASTED" ON YOUR INABILITY TO ASK ABOUT WHAT YOU DON'T UNDERSTAND WEAS SIMPLY WASTED TIME.
I HAVE 4 0R 5 DEVICES THAT ALL WORK AS ADVERTISED... SIMPLY BECAUSE I HAVE THE COMMON SENSE TO ASK ABOUT THE "SPECIFICS' OF WHAT I FAIL TO "GET' THE FIRST TIME AFTER HAVING DONE ALL I CAN TO GET ANY INFORMATION I CAN.
I responded as I did because I saw NO evidence in all your posts about anything you had made any attempt to read or understand this rather simple set of instructions...
Quote
■ NMEA Input Command
A.) Set Serial Port ID:100 Set PORTA parameters and protocol
This command message is used to set the protocol (SiRF Binary, NMEA, or USER1) and/or the
communication parameters (baud, data bits, stop bits, parity). Generally, this command is utilize to
switch the GPS module back to SiRF Binary protocol mode, where an extensive message commands
are readily available. In example, whenever users are interested in altering navigation parameters, a
valid message sent and is receive by the recipient module, the new parameters will be stored in
battery backed SRAM and then the receiver will restart using the saved parameters.
Format:
$PSRF100,<protocol>,<baud>,<DataBits>,<StopBits>,<Parity>*CKSUM
<CR><LF>
<protocol> 0=SiRF Binary, 1=NMEA, 4=USER1
<baud> 1200, 2400, 4800, 9600, 19200, 38400
<DataBits> 8,7. Note that SiRF protocol is only valid f8 Data bits
<StopBits> 0,1
<Parity> 0=None, 1=Odd, 2=Even
Example 1: Switch to SiRF Binary protocol at 9600,8,N,1
$PSRF100,0,9600,8,1,0*0C<CR><LF>
Example 2: Switch to User1 protocol at 38400,8,N,1
$PSRF100,4,38400,8,1,0*38<CR><LF>

perhaps the checksum might have been an issue but easily solved by attaching the manual and asking how to do the checksum...
So I fail entirely to see your issue... I do however see a great deal left out about about what you had tried prior to posting the  first easily answerable question. One I found as an easy to so procedure and one I have done many times with both of my Skylabs SKM53 modules... ones I've not yet done with my U-Blox Neo 6 or Max 7 modules or my first EM406 module...
It's been a year or more but for the SKM 53 it was a little different as I only wanted the RMC and GGA sentences...
Code:
// uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  // uncomment this line to turn on only the "minimum recommended" data
  //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);
This is covered well in both the Adafruit example and the SKM53 manual which is what I meant about doing your own research prior to asking others to solve your issues...

Docedison
I edited my response andremoved the request to notify me of anything changed in this thread. Further I will not reply to emails or pm's
7  Using Arduino / Programming Questions / Re: GPS with Arduino UNO - 2. on: April 15, 2014, 07:19:26 pm
You Might try to google for the attached data sheet.  I did so because you apparently are somewhat handicapped in your abilities to "Google" for part and modules data sheet.. So I took 5 seconds and...
The answers to set the module for NMEA 0183 or binary  are present on page 9 and can be found by reading pages... Lots faster than either asking someone else to do it for you or offer an opinion and wait for an accurate answer..

Doc
8  Using Arduino / Programming Questions / Re: Weird Error on: April 15, 2014, 03:28:39 pm
 @ Awol.. Thank You...
@ op This compiles..
Quote
 int  segA = 8;
  int  segB = 7;
  int  segC = 6;
  int  segD = 9;
  int  segE = 2;
  int  segF = 4;
  int  segG = 3;
  int  DP = 5;

void setup()
{// put your setup code here, to run once
  pinMode(segA, OUTPUT);
  pinMode(segB, OUTPUT);
  pinMode(segC, OUTPUT);
  pinMode(segD, OUTPUT);
  pinMode(segE, OUTPUT);
  pinMode(segF, OUTPUT);
  pinMode(segG, OUTPUT);
}
void loop()
{
  displayDigit(0);
  displayDigit(2);
  displayDigit(4);
  displayDigit(6);
  displayDigit(8);
}
void displayDigit (int i)
{

 
  {
    digitalWrite(segA, (HIGH));
    digitalWrite(segB, HIGH);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, HIGH);
    digitalWrite(segE, HIGH);
    digitalWrite(segF, HIGH);
    digitalWrite(segG, LOW);
  }
  if (i==1)
  {
    digitalWrite(segA, LOW);
    digitalWrite(segB, HIGH);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, LOW);
    digitalWrite(segE, LOW);
    digitalWrite(segF, LOW);
    digitalWrite(segG, LOW);
  }
  if (i==2)
  {
    digitalWrite(segA, HIGH);
    digitalWrite(segB, HIGH);
    digitalWrite(segC, LOW);
    digitalWrite(segD, HIGH);
    digitalWrite(segE, HIGH);
    digitalWrite(segF, LOW);
    digitalWrite(segG, HIGH);
  }
  if (i==3)
  {

    digitalWrite(segA, HIGH);
    digitalWrite(segB, HIGH);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, HIGH);
    digitalWrite(segE, LOW);
    digitalWrite(segF, LOW);
    digitalWrite(segG, HIGH);
  }
  if (i==4)
  {
    digitalWrite(segA, LOW);
    digitalWrite(segB, HIGH);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, LOW);
    digitalWrite(segE, LOW);
    digitalWrite(segF, HIGH);
    digitalWrite(segG, HIGH);
  }
  if (i==5)
  {
    digitalWrite(segA, HIGH);
    digitalWrite(segB, LOW);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, HIGH);
    digitalWrite(segE, LOW);
    digitalWrite(segF, HIGH);
    digitalWrite(segG, HIGH);
  }
  if (i==6)
  {
    digitalWrite(segA, HIGH);
    digitalWrite(segB, LOW);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, HIGH);
    digitalWrite(segE, HIGH);
    digitalWrite(segF, HIGH);
    digitalWrite(segG, HIGH);
  }
  if (i==7)
  {
    digitalWrite(segA, HIGH);
    digitalWrite(segB, HIGH);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, LOW);
    digitalWrite(segE, LOW);
    digitalWrite(segF, LOW);
    digitalWrite(segG, LOW);
  }
  if (i==8)
  {
    digitalWrite(segA, HIGH);
    digitalWrite(segB, HIGH);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, HIGH);
    digitalWrite(segE, HIGH);
    digitalWrite(segF, HIGH);
    digitalWrite(segG, HIGH);
  }
  if (i==9)
  {
    digitalWrite(segA, HIGH);
    digitalWrite(segB, HIGH);
    digitalWrite(segC, HIGH);
    digitalWrite(segD, LOW);
    digitalWrite(segE, LOW);
    digitalWrite(segF, HIGH);
    digitalWrite(segG, HIGH);
  }
}

Doc
9  Using Arduino / Programming Questions / Re: Weird Error on: April 15, 2014, 02:30:09 pm
Code:
If (i == 2)
{
Do something;
}
What increments i ?

Doc
10  Using Arduino / Programming Questions / Re: how to calculate clock cycle of an instruction on: April 15, 2014, 11:27:07 am
 I often wonder why the Blink without Delay Sketch isn't the Standard Arduino "Hello World" example?... Might serve well, properly commented and perhaps a slight thoughtful error deliberately introduced and alluded to in the sketch documentation...  so that it might produce a more interesting effect when 'corrected' and perhaps to encourage  the new user to read the sketch first... IMO many of the users don't often even really try to suss out why the basic one works as it does... my point is that it teaches methods that are more likely to "Shoot the User in the Foot" than it does to teach the new user to "think" before before writing anything really useful... in particular there are two simple practices that I have always found to produce a sketch that is planned and thus has a slight chance of producing a better working first attempt.
This in particular from both the engineering aspect and the language issues that confront the new user...
In particular to answer the question that this new user is really asking.

Doc
11  Using Arduino / Microcontrollers / Re: ATtiny84 with internal pull-ups on: April 14, 2014, 09:46:02 pm
What is the ground connected to... and is it the same place as the Arduino ground really is?
and is it possible that there is a power supply issue...Measure the Vcc in the failed condition IE PA1 and PA2...

Doc
 
12  Using Arduino / LEDs and Multiplexing / Re: Binary Clock - ATTiny85 + 74HC595 + ULN2003 on: April 14, 2014, 08:03:24 pm
It is very difficult to guess at your problem... If you had 1.read the sticky note at the top of this forum section you would understand what is the minimum information required for an answer that applies to your code and your wiring...

Doc
13  Using Arduino / General Electronics / Re: Level shifting advice on: April 13, 2014, 12:56:32 pm
Yes it is... But it works well with 10 - 20 CM bus length's and although sometimes hard to route especially with the early Protel autorouters...I knew that there would be less "Midnight Oil" sessions on the larger and faster boards used as the systems controllers.
The gain being less current required for the bus itself or in other words insurance against midnight modification of PCB's to "Fix" "Design Errors" in battery operated devices... or in other words a "Shotgun Cure". it only took one time for me to understand that being conservative to the extreme wasn't a bad condition.  <BG>

Doc
At least the board worked the first time... IT WAS Ugly... Though.
14  Using Arduino / General Electronics / Re: Level shifting advice on: April 13, 2014, 11:54:54 am
@ Fungus... The IIC Spec that you are using is not really very current... 400 KHz isn't the IIC upper limit...
Rather the TWI header file is in need of a small change... in order to make the internal pull up optional.
Further the internal 50K weak pull up is not quite right as it doesn't really do much for the capacitive load or DI/DT.
Basically the pull up Must be different at high speed.. I wouldn't design anything that required more than 2 cm of track length unless the track width could be 2 1 mm. I looked at some of my old artwork and realized my error.. 1 mm is much more accurate with the internal pull up, Again because of the DI/DT issue.
If the TWI class as a whole had an option to disable via an ifdef the weak pullup there would be much less difficulty in making the "Standard" work with mixed device Vcc devices.. My background is hardware and I do understand why a PCB trace can be an inductance rather than a "wire".
I use without thinking a maximum value of 4.7K for the IIC bus pull up and If I need to go off board or cannot apply the 2 mm trace width  'condition' I personally will reduce the value of the Pull up. Particularly when there are multiple devices on the same bus.
As bus speed increases PCB traces become transmission lines and it is most necessary to 'adjust' the bus current to allow for the DI/DT issue, Especially mixed Vcc loading issues. I have been long considering "Fixing my TWI.h file to make the pull up an option... This is really an issue.. again with different device Vcc requirements between the controller and the majority of connected TWI devices, the internal weak pull up is frequently inappropriate and should IMO be an option that is controllable with a minor change to the header file using an ifdef condition that allows for applied Vcc for compatibility with 3V3/5V devices.
While I do understand both the engineering handicapped and the knowledgeable engineer, this is a real issue and I feel one that is ignored by the people that are responsible for writing or reviewing the extant Arduino TWI specifications as the Vcc standards? change. When the initial code was written 3V3 Vcc devices were scarce and somewhat beyond those without a good electronics knowledge base... Thus it was again IMO left alone (dumbed down..) to avoid confusion for the electronically handicapped majority of Arduino issues..
I do remember my own issues when I began to design devices that used lower power supply voltages..
In the early 2000's I began to change from 5V Vcc to 3V3 Vcc devices/bus voltages and I made a few mistakes... Before I got it, that the issue Is the DI/DT condition or bus loading that begins at 10 cm sq PCB's with multiple IIC devices. Sometimes to keep within my allowable current budget I had to switch the  pull ups off when not in use or use different communication methods to keep my total board current within the solar panel/battery capacity budget required for the design spec/design cost. This was really an issue when I went from 12V SLA to 2.2V gates cell type SLA batteries.. I remember one design that Had to be 5V from 2 gates cells... I had a boost converter on board to drive a 12V latching soleniod and I used a 5V linear MAX660?
(I really don't remember the part # but it was similar to the MCP1702 IQ class device). My solution was to "Tick" the boost device and connect my regulator to the output of the boost device. Since the solenoid storage cap was 4700 uF the Tick was required every few 100 mS or so and done by monitoring the solenoid power supply to generate the tick when the HV bus got close to the regulator dropout point. It worked well although considered a PITA by the contract programmer..
I consider 50K pull ups suitable only for frequencies below 50 KHz and prefer to tri-state anything on the TWI bus if I need to use longer traces between devices, Conservative.. Certainly but what I designed always worked... After the initial lesson I learned. It doesn't cost more that a cheap mosfet and two extra pull ups for the few devices that required different Vcc levels.. <End Rant>

Doc
15  Using Arduino / Project Guidance / Re: 24V Derivation on: April 11, 2014, 10:05:12 pm
Very Small too, A 2A continuous duty buck mode CV device that commonly sells for 2 or 3 dollars is 20 X 42 X 12 mm. The CV-CC modules at the same current are about twice the size and sell for less than 5 dollars... Both in single quantities...
A 25 watt heat sink is frequently more money... W/O any parts.
The first one I mentioned is one I use frequently as a pre-regulator for the discarded printer power supply power modules I find and or buy from the local "Thrift" stores... A 30V .7A HP Printer supply is 21 watts of power, and here in the US already UL approved.. safe..
 This is for me 5V @ 4A output or 7.5V @ 2.5A, An Ideal input voltage for an Arduino board as the voltage (7.5V) is Ideal for the AMS1117-5.0 regulator on any of the Uno, Mega and Leonardo boards I use.... When I designed my own.... back when I worked for a living were even smaller... An MCP16301 will produce 500 mA from a 16.5 V input and is in an SOT-23-5 case.. I use one of them to support 2  Sure Electronics 3208 scrolling displays that use the Holtek HT1632 IC with 4, 8 X 8 5mm red matrix LED displays Each...

Doc
Pages: [1] 2 3 ... 188