Show Posts
Pages: 1 ... 42 43 [44] 45 46 ... 50
646  Using Arduino / Sensors / Re: Connecting 24V inductive sensors to Arduino on: January 19, 2012, 07:45:44 am
I'd recommend a optocoupler with a drop-down resistor to make it safe. In case the signal is AC, use a AC optocoupler. That's what I have used here with my air conditioning system (the signals for most residential AC control systems in America are 24VAC). Attach the opto to a digital input and then count the pulse train. Given how slow the signal is, you could use a ISR to do the counting and then let your Arduino refer back to the count whenever you want.
647  Using Arduino / Project Guidance / Re: need more accuracy out of my 60Hz frequency meter on: January 19, 2012, 06:23:28 am
FWIW, I'd go a different route. If you need a really accurate dedicated pulse counter, I'd hook up the SQW output of an inexpensive RTC to one of the interrupt pins (using DS1307, for example). Then program a 1Hz signal output on the RTC and set up an Arduino interrupt to set a flag or increment a counter for every second that goes by. In the meantime, read the frequency as fast as possible.

Since you don't really need amplitude, you may even do this at a ADC lower resolution, i.e. you can adjust the ADC pre-scaler to a lower value like 16 (vs. the default 128) to get tens of thousands of readings a second. If you want to speed up things further, you can read analog values directly from the relevant port and thus get another reading about every 13 ADC clock cycles (so CPU speed / pre-scaler / 13 = max theoretical sampling rate).

I wouldn't count frequency with an ISR... every time the CPU has to go into ISR mode, you lose 51 CPU clock cycles as I recall. OK if your code has lots of idle time, maybe not so OK if you have time-sensitive stuff going on. Instead, I would dedicate a small period of time (let's say a second out of every minute) to just count the frequency and then dedicate the CPU to other tasks.

RTCs also feature other output frequencies. You could avoid the ISR altogether and do frequency measurements on demand by sampling the frequency signal with the ADC output while sampling the RTC output with a digital input. Since you can sample very quickly using a small pre-scaler, you can set up a for loop that increments every time a RTC signal drops low, then measure a known number of increments at a given frequency to determine your other frequency. Thus, you might be able to determine your frequency with a high degree of accuracy, as needed.
648  Using Arduino / General Electronics / Re: How important is a ground pour, or am I asking the right question? on: January 18, 2012, 11:25:44 pm
Looks awesome.

But if you want to consider going down this path of creating bigger and bigger pour areas, did you consider putting the driver chips on each of the vertical "legs"? That could save you space on the main PCB without increasing cost significantly. Another option is to find a vendor for flexible PCBs... the only downside being that flexible PCBs are even worse than FRP re: heat dissipation. Though given your application, you probably would be OK. You've probably thought of all this already, I was just thinking aloud.

Congrats again on a neat project.
649  Using Arduino / Sensors / Re: Measuring temperature with lm35 on: January 18, 2012, 10:48:20 pm
You may be able to calibrate the voltage levels by measuring the bandgap voltage between the Arduino internal AREF and the external voltage.

See http://arduino.cc/forum/index.php/topic,38119.0.html and http://arduino.cc/forum/index.php/topic,51708.0.html for further information.  Keep in mind, you have to calibrate your bandgap voltage first to be sure it's accurate.
650  Topics / Product Design / Re: Eagle - Double sided PCB - Vias on top but soldering on bottom on: January 18, 2012, 08:13:31 pm
Actually I think I was off by a factor or 10.
I design with 0.02" (20 mil) for power, and 0.01" (10mil) for signal traces.

Whoops, me too. 15-16mil and 24 mil respectively, it is.
651  Topics / Product Design / Re: PCB make+assemble service on: January 18, 2012, 08:05:04 pm
Thanks for making holland sound like a pile of weed and strippers btw smiley-wink
Well, the truth hurts! (just kidding!) The Swiss enjoy similar hospitality in German border towns in establishments that are happy to take Swiss as well as EU currency. That way, the Swiss can indulge in all sorts of naughty stuff that is banned in Switzerland without having to change currency. smiley-grin

Coming back to the subject at hand, thanks for the mention of the Seeedstudio assembly services! I will have to keep that in mind for my current project, Seedstudio costs about a quarter of what I would pay for similar services performed in the States. Makes sense, I guess, the PCB fabrication cost discrepancy is similar.
652  Topics / Product Design / Re: Eagle - Double sided PCB - Vias on top but soldering on bottom on: January 18, 2012, 07:56:27 pm
Go with 0.16" or 0.2" for power traces.

CrossRoads, just laughed out loud... I use 0.15-0.16" for signal traces, and 0.24" minimum for power...  One of my boards features a +5V ring around the perimeter that is about 0.5" wide... keeps losses low! Probably overkill.
653  Using Arduino / Microcontrollers / Re: ATmega1284P: End to End using 1.0 IDE on: January 18, 2012, 07:17:13 pm
Adi, nice looking board. The big solid ground pours and the signal, etc. lines show great attention to detail to keep things looking that 'simple'. I have spent many long hours optimizing my layouts too in order to minimize signal-line vias, etc. I am also very happy with the quality and cost of iteadstudio, now if only their PCB factories weren't on vacation until February!

CrossRoads, your solution to the much-debated question of whether to or not to include a USB interface is simply brilliant, especially since those of use who have an FTDI cable can use it too.
654  Using Arduino / General Electronics / Re: How important is a ground pour, or am I asking the right question? on: January 18, 2012, 07:03:35 pm
A couple of observations...

For one, you appear to be using the Eagle(?) autorouter. As others have suggested, the autorouter usually doesn't do very well (and the one in Eagle has not impressed me). For component layouts (to gauge how efficient a layout is) I have had great luck with the http://www.freerouting.net/ project. Frequently, designs with few tweaks can be adopted and integration is pretty simple for Eagle users (i.e. run a DSN, route, then run a script to lay the board out). Just remember to define your polygons up front (i.e. not only draw the polygon, but name it GND as well) and then to connect polygons that have fallen apart after the fact.

Ground planes (and positive rail grids) can simplify layouts significantly since one connection is always taken care of. The key is to review carefully what the optimum connection pattern is (and the auto-router may or may not discover that) and then to replicate it for assemblies like yours. Last but not least, another option for a power hungry board is to have a positive polygon on one side and a negative one on the other side. Then use Eagle to determine what polygons still need connections, etc.

As CrossRoads mentioned, using vias to connect polygons is the way to go. See how small you can go (your PCB factory should be able to tell you) in order to maximize the effectiveness of your vias. Laen's dorkbot PDX service allows 15 mil drills, while iteadstudio goes as low as 12 mils, for example.
655  Using Arduino / Sensors / Re: Help with DHT11 on: January 18, 2012, 05:32:21 pm
Try opening a new file, copy and paste your existing code into the new file, then try and compile.

I had the same issue with Easy Transfer on a file that had worked in the past and the copy and paste did the trick for me.
656  Using Arduino / Sensors / Re: Need IR sensor but can't find. on: January 18, 2012, 08:50:37 am
I know you'd prefer something non-contact, but do consider a K-Style thermocouple. Determine the critical surfaces to be measured and then attach the thermocouples there - some even offer screw-heads to make the connections really secure.

K-style thermocouples offer plenty of range (i.e. well over 400*C) and all you need is a small ADC meant for thermocouples to do the conversion. For example, the folk over at rocketscream offer a reflow oven controller for toasters that uses the Maxim MAX6675. There are other ADC's out there, but you might decide to look for a similar board and recycle the Arduino code relating to the MAX6675. K-style thermocouples are cheap on e-bay and with decimation/oversampling you may even get very good results. Just be quite observant re: PCB layout with anything that is measuring millivolts - you can easily add a lot of un-necessary noise.  

Another reason to go with a thermocouple vs. sensing with an IR sensor is the error that may creep in over time as function of emissivity, etc. At the very least you'd want to calibrate the IR gun regularly with a reference thermocouple to ensure that your readings are accurate.
657  Using Arduino / Project Guidance / Re: Temperature variance using TMP36 on: January 18, 2012, 07:34:19 am
The 1-Wire stuff is neat but the commitment of Dallas/Maxim to the platform is questionable. For example, they took out an existing product line (the very popular counter chip) and have yet to replace it with anything. That counter chip was extremely useful for hobbyists like myself (2 channels and counting bandwidth that could be measured in kHz) and was used in every 1-wire weather station to count the precipitation. To the best of my knowledge, they have yet to bring out a replacement counter.

As for the tmp36, as suggested above, your answer may be a better power supply (i.e. 0.1uF cap across GND and 5V) as well as decimation (Google the Atmel paper on that) to boost your sensor resolution from its quasi-10 bit beginnings to something approaching 16 bits. Decimation (or oversampling) is not the same thing as averaging, and for slow moving signals it's a perfect way to make inexpensive hardware perform much better.

All that said, the 1-wire digital temperature sensors from D/M are great units because they are accurate, can operate more easily in noisy environments, and are offered in all sorts of configurations that the TMP36 is not - like in a waterproof sheath, for example.
658  Using Arduino / Sensors / Re: AC Line Safety on: January 16, 2012, 02:52:55 pm
Hi and thanks AJOfScott!

I have yet to build a linear opto-isolation circuit. For me, they've always been either the on or the off type, usually with an AC input stage to make them universally applicable. I always thought that linear opto-isolation circuits require a lot more components to keep things linear... so that circuit of yours certainly looks interesting... I have no ability to model optos right now as neither circuit modeling package I have here can handle them outright... some vendors of linear optos like AVAGO go as far as including a SPICE model in their documentation.

As for Eagle, I chose that package since it's the most intuitive one I could find that ran on Windows as well as Mac computers. The large parts libraries available on the 'net are nice too, though all vendors could do a better job of documenting their wares. I frequently find myself coming up with parts libraries for my projects because the chips are not defined elsewhere. My biggest gripe with Eagle isn't though with the clunky UI or the somewhat arbitrary process flows (to define a new part, for example). It's the auto-router, which I find pretty useless.

However, thanks to the free-routing project, I have access to an amazing auto-router that is great for initial layout optimization, even if I later lay out a board on my own. I wish Cadsoft could buy a license from those researchers, as that autorouter makes the one in Eagle look pathetic, even if there are some quirks that have yet to be worked out (i.e. orphaned polygons, etc.).
659  Using Arduino / Sensors / Re: AC Line Safety on: January 15, 2012, 09:14:45 am
A couple more comments:

Using protection diodes as shown here takes some fairly careful calibration. I looked up some schottkys that had a similar form factor as the BAV99 (SOT-23) Their 1A voltage drop is about 0.45V @ 25*C but forward voltage is a function of current and temperature, as their datasheet shows on page 2.

I re-ran the circuit analysis tool and I wonder if those here who have way more experience than me can weigh in... Attached below is a 'scope' output and the circuit, which I am overdriving 100%, i.e. 230VACrms input on the primary side resulting in a 13VACpp signal on the secondary side. The green and blue 'scope' lines are for the protection diode, the red line shows the ADC voltage.



Extrapolating the chart in the datasheet that Diodes Inc published, I would expect about a 0.1V voltage drop at 0.1mA. The 'scope' appears to confirm this, as the peak forward current is around 120uA, while the 'shaven' portion of the voltage is about 0.15V, which looks consistent. However, if I disable the diodes by increasing their forward voltage to 1000V, the Vpp across the ADC is 4.77V. That suggests to me that each diode is actually shaving off more than a volt. So isn't this inconsistent? At a forward voltage of 1V, the SOT23 should be blowing up (i.e. 4+Amps). Granted, this is not a steady-state condition but still...
660  Using Arduino / Sensors / Re: AC Line Safety on: January 14, 2012, 06:44:09 pm
Thanks DC42!

I decided to try out a couple of configurations based on your suggestions that I hope I interpreted correctly.

I have enclosed two screenshots that I hope are interesting / useful... It occurred to me that the protection diodes would have a hard time protecting as long as their forward voltage potential wasn't adjusted. So, I created yet another voltage divider that may be just gilding the lily for all I know. I am assuming Schottky's here, 0.222Vdrop at 1A. iCircuit is extremely limited re: inputs in the interest of simplicity. I hope that it accounts for the different forward voltage drops in diodes as a function of current but I'm not super confident it does!

The first screenshot shows conditions under nominal 115VACrms conditions. I.e. the secondary voltage amplitude of the transformer is 6.5V (4.6VACrms*1.41), offset for fun by 2VDC. The yellow line on the 'scope' shows the voltage drop across the 1M resistor that stands in for the ADC while the blue line is a idealized VAC supply with an amplitude of 1.25 and a DC offset of 1.25V.


At 115VACrms the inputs into the ADC look pretty good. The curves are nicely formed, I see no distortion. Now, lets try a 230VACrms input. Note how the diodes are getting a workout and how the tips of the ADC violtage curves are getting compressed. There are no excursions above 2.5VDC or below 0VDC (so the ADC is safe). Then there is 150V MOV... Not sure if it's strong enough to blow a 1A slow-blow fuse before it goes boom, however.


That aside, the above looks promising. But I don't trust this program enough to accept the above as gospel. Any SPICE programs out there with a good GUI as long as it's either Mac or Windows? I'd like to think that WinSPICE would allow you to adjust component behavior with a bit more granularity.
Pages: 1 ... 42 43 [44] 45 46 ... 50