Show Posts
Pages: 1 ... 38 39 [40] 41 42 ... 48
586  Using Arduino / Microcontrollers / Re: Looking for a bootloader for the 1284p at 16mhz, anyone know of one? on: January 28, 2012, 07:45:11 am
Thanks for the opti-boot update!
587  Using Arduino / Sensors / Re: Preferable Thermistor Configuration on: January 28, 2012, 07:18:54 am
Apologies, it was late.

The thermistor from US Sensor is allegedly good for 0.1*C readings. I was trying to put a ADC on the backside that can take advantage of that, i.e. make the sensor the single limiting factor re: temperature resolution and accuracy. I'd prefer 10x resolution but accuracy is important too. I didn't want to go the whole hog to RTDs either since I'd need a much bigger PCB for all the terminals that would ensue...

As I understand it, (and please correct me if I am wrong) the theoretical vs. practical resolution and accuracy of a ADC are two very different things. IIRC, Atmel only specifies the AVR ADC to be accurate down to 2LSBs, so there can be significant offset errors. Hence the folk at openenergymonitor use a software-based filter suggested by Atmel to filter out the offset error.

The sampling of VCC on one channel allegedly can help address that, i.e. help improve accuracy by taking care of some of the inherent wanderings in ADC readings and / or voltage sources. Such sampling may not be necessary as you point out since the ADC has a much higher resolution than what the sensor can theoretically deliver.

But since I wanted an ADC that was better than the thermistor in terms of resolution despite loosing a LSB here and there due to noise and other factors, I was drawn to this 18 bit ADC. Even if I take off 4LSBs due to noise, drift, or other factors, I still get a ADC resolution down to 0.006*C from 0-100*C. That seems more than adequate to support that thermistor.

What I liked about the Wheatstone bridge arrangement was how I could take advantage of it to use the whole input range on the ADC. But a non-Wheatstone arrangement with a carefully designed voltage divider may be able achieve more than adequate resolution. I'll have to look into that.
588  Using Arduino / Sensors / Re: Preferable Thermistor Configuration on: January 27, 2012, 10:29:29 pm
Hi DC42,

I'm only looking to cover about 10-50*C, though a better specification range might be 0-100*C just to be safe. I was thinking the following probe from US Sensor looked tasty. It has a range of resistances from about 7k4 Ohm at 0*C to 150 Ohm at 100*C  and at $4.6 a piece, the price is not bad for its accuracy/resolution.

I played around with the Wheatstone bridge simulator over at Daycounter and it would seem that a pair of 4k7 and a 2k2 (opposite the the thermistor) would yield a wheatstone output voltage range of -0.96 to 0.95 if I used a precision Voltage source VCC = 3.3V. A MCP 3424 would then measure that voltage on a differential basis with a gain of 2, so I'd lose no virtually bits in the process vs. a full bit if I hooked the unit up as suggested in the datasheet.

Calibration would occur occasionally, as described in this article. That means one less channel to sample with but better auto-calibration. If I can just sample the VCC every other MUX channel cycle, then the rig can enjoy its auto calibration with 18 bit resolution and yet sample all four inputs.

Thanks again for your insights and any thoughts you might have re: the above.
589  Using Arduino / Sensors / Preferable Thermistor Configuration on: January 27, 2012, 12:00:46 am
I'm considering trying to put together a accurate thermistor sensor system. The Thermistor would likely be the 10k kind, and the circuit a wheatstone bridge with the two top legs (including the thermistor) being the 10k while the lower leg would be two 4.7k. Some of the literature I have reviewed suggests that adding a unit-gain buffer would further enhance stability and accuracy, I'm hoping that a wheatstone bridge and the MCP3424 would do it.

To help offset and gain issues, I'll set aside one channel to just measure those so that they can be compensated for. Thus, four channel inputs became 3...

Any thoughts regarding the above or should I be looking at different circuits?
590  Using Arduino / General Electronics / Re: 5v supply efficiency question on: January 26, 2012, 12:10:27 pm
Another option is the 1A switchmode power supply from Dimension engineering that drops into standard TO220 holes. It's a bit taller, wider, etc. but the holes line up and the efficiency is much higher, hence less heat.
591  Using Arduino / General Electronics / Re: Critique my circuit: Poor man's UPS on: January 26, 2012, 12:05:46 pm
If voltage drop across the diodes is a concern, you could also go the mosFET approach. At least that's what I remember the folk over at picoUPS do.  

That pre-engineered solution may be better (even if it's oversized) since it'll also charge a 12V battery (i.e. set and forget). You get 12V out, could use a switchmode VR from dimension engineering to deal with the Vdrop after that. That's the route I'm going to take on a phone base station in my house that will also serve as a USB phone charger.
592  Using Arduino / General Electronics / Re: ground plane question on: January 26, 2012, 11:57:18 am
In it's documentation, Atmel promotes putting up 'trenches' around noisy ground plane areas, such as where the oscillator is located. So, while the ground plane is shared, the area around the oscillator or resonator only connects in a small area near the ground pin next to the 328P. Similarly, for high-resolution ADCs, you apparently must think carefully about how adjacent digital circuits and other elements may be influencing the signal (because the sensitivities are much higher on a nice ADC than the 5mV that the Atmel/Arduino may or may not resolve to).

I'd suggest looking for application sheets on the chip you're interested in or write to the manufacturer re: reference designs that they might be willing to share. For example, many manufacturers will offer eval boards that can be a great place to start / emulate.
593  Using Arduino / General Electronics / Re: voltage divider 5V to 3.3V on: January 26, 2012, 11:51:28 am
Use a regulator or buy an Arduino like the pro series from Sparkfun that runs at 3.3v by default. The only issue there is using a proper programmer, i.e. one that won't blow out the Arduino in the process (3.3v FTDI cable, for example). One downside is that the Atmel CPU has to run at a lower speed to be stable per the manufacturer (Sparkfun uses 8MHz in general, though their openlogger clocks at 16MHz and still seems to work)

So if you're going to be passing signals back and forth between a 5V arduino and a 3.3v daughterboard, use a voltage translator chip rather than relying on resistor networks for the signal conditioning. Bidirectional voltage translators like those sold at Adafruit are your friend if you want to run 5V and 3.3V side by side. For $8 it's cheap insurance and guarantees performance. There are also other versions of this chip available to translate for I2C networks.
594  Topics / Science and Measurement / Re: 200-500mV Sensor? on: January 25, 2012, 10:12:23 pm
The current path is through a sheet of copper, 25A isn't that hard to handle (it will be getting hot though, but the same copper conducts the heat to the PCB traces.  These high current devices are just a sheet of copper next to a hall-sensor, simplicity itself...  Of course it will act as a fuse at higher currents (an expensive fuse!)
My concern was around using it in a small enclosure. I was not convinced that there would be adequate thermal heat transfer from in there, no matter how big the PCB area dedicated to allow heat transfer. These Allegro chips strike me as a great solution in enclosures that are either ventilated or in free-air situations. The Tamura sensor will create almost no heat so I feel that it's a better solution for a totally enclosed application without active ventilation.
595  Using Arduino / Microcontrollers / Re: Looking for a bootloader for the 1284p at 16mhz, anyone know of one? on: January 25, 2012, 08:03:30 pm
Well if you are absolutely sure that no value, once converted to a string, exceeds nine characters, then your 10 character buffer should be sufficient (since you need the terminating nul). I have not seen the rest of the code. Remember that arrays are 0 based, so valid index for a 10 character buffer is 0 through 9. I woudl check to see if you're writing outside that buffer in the code that converts a float to a string.
By the way, Optiboot now works with the 1284P correctly. So you have a few choices, the one I posted here or Optiboot. Both fully address all the flash space. Optiboot is smaller.

Hi Skyjumper, sorry for the late reply. I was in Chicago for AHRI for two days, so it was hard replying with just the iPhone considering how badly the site renders on a small screen. That gray bar up to covers all sorts of menu choices up.

Anyhow, I don't think a buffer problem exists for several reasons, for one, I'd have to think that the buffer function would blow up on any arduino if it was being abused. Yet the same function that worked fine on the 1280 or 2560 Atmel chips didn't on the 328P. My guess is that the String operations were the source of the problem. While using Char arrays is clearly less memory intensive, it's also a lot harder for novices like me to code for.

As for the Optiboot, that is fantastic news. Maybe I can now make the jump to 1.0....
596  Using Arduino / Microcontrollers / Re: Looking for a bootloader for the 1284p at 16mhz, anyone know of one? on: January 24, 2012, 07:55:28 am
Hi sky jumper,
The typical format is something like this

Time stamp (13 digits including a dot), accumulated kwh (up to 5 digits before the dot, three after), real power (up to 6 digits, including the dot), voltage (5digits including a dot), current (up to four digits + a dot), and temp and rh (usually four digits including the dot). All values are delimited using commas.

Have to go. Back later. But yes, all string operations.
597  Using Arduino / Microcontrollers / Re: Looking for a bootloader for the 1284p at 16mhz, anyone know of one? on: January 24, 2012, 12:13:18 am
Here is one example, showing the portion of the code where I add the Power, Voltage, Current Variables to the global Data_Package string.

void AddToDataString_Power(){
  char buffer[10]; // buffer that is used to write floats into the Data string
  Watt_Hours_Recalc(); //recalculate watt seconds, hours, kwh

  //now add remaining data to string
  if(Watt_Hours<100) Data_Package+="0"; //add zeros behind decimal if Wh is less than 100
  if(Watt_Hours<10) Data_Package+="0";  // see above
  Data_Package+=Watt_Hours; //now print the Watt-hours
  //The power part of the data string has been assembled for transmission.

(One issue clearly is that I could do a better job of avoiding global variables and push/return the variables between functions instead.) Give me time...

The preceding part of the string contains the time in excel format, i.e. several digits of for the days since 1/1/1900, a dot, and then another six digits describing the time of day down to the current second. Following this operation, the program may also add environmental data, another 8-10 bytes worth (temp in C, humidity in RH, two commas).
598  Using Arduino / Microcontrollers / Re: Looking for a bootloader for the 1284p at 16mhz, anyone know of one? on: January 23, 2012, 11:49:44 pm
Hi Skyjumper, no the arrays weren't large... the biggest was a int[5] size, not the worlds biggest! But I was adding data strings together of various variables being transmitted by the other CPU and for some reason (this data transfer string had less than 30 characters altogether in it at the end of all those operations), the program would compile fine... then the chip would cycle through setup() and shortly thereafter lock up. The exact same program on the 1280 or 2560-based Megas ran just fine, making suspect that I was somehow exceeding the allowable RAM allotments.

Many moons ago I had the pleasure/torture of having to program in Fortran 77 (or whatever version it was) and the best kinds of errors were the kind where a variable was not cast or defined properly and henceforth abused inside the program... the compiler would then report an error in a line that the program didn't even have (because, presumably, variable storage happened somewhere 'below' the last line). I had to listen to a lot of Dire Straits not to cry in dispair.

Coming back to the original topic, is there a way to test for the remaining RAM by variety (SRAM, etc.)? It would be great to understand what limits I may or may not be reaching...
599  Using Arduino / Microcontrollers / Re: Looking for a bootloader for the 1284p at 16mhz, anyone know of one? on: January 23, 2012, 11:16:24 pm
Remember that comment about forgetting certain things I made above? Dynamic Memory allocation? I'll have to google that. I might be able to help you with a manufacturing or financial issue but microprocessor programming is something I learn for fun...
600  Using Arduino / Microcontrollers / Re: Looking for a bootloader for the 1284p at 16mhz, anyone know of one? on: January 23, 2012, 11:12:08 pm
Hm, all this clamoring for a 1284P bootloader, and suddenly no one wants it? LOL, oh well...

Give me time... I have a couple of distractions clamoring for my attention first here at the moment. Plus, my 1284P program is only consuming 23k so far... I needed the 1284P mostly for RAM since even short data strings made the 328P blow up mysteriously while the 1280 or 2560 chugged along just fine with the same program in place. But, given that my main board can accomodate another 32+ daughterboards on the RS485 daisy-chain...

Again, thank you, Skyjumper for the work you do. I hope to take advantage of it soon. Cheers!
Pages: 1 ... 38 39 [40] 41 42 ... 48