Show Posts
Pages: 1 [2] 3 4 ... 55
16  Using Arduino / Storage / Re: Datalogger on: November 06, 2012, 06:53:45 pm
Use a static char array and the "sprintf" and "strcat" functions instead.
17  Using Arduino / General Electronics / Re: About the article "10 Ways to Destroy an Arduino" on: November 06, 2012, 01:08:16 pm
I think "provide 5V on +5V and ground out Vin" is another way to blow it.
18  Community / Products and Services / Re: Great PCB House for Prototyping on: November 05, 2012, 01:21:19 pm
Quote
I,m struggling to cut them in half with the tools (or lack of) I have at home - 1.6mm is surprisingly thick when you try and cut it! So if I ordered from itead a 25mm x 50mm design, but under the 50mm x 50mm ordering code, would I received just 10 pcb's and effectively waste half the order, or would they supply twice as much, ie 20 pcbs?

Yes, you would "waste" that area.

A hacksaw actually cuts PCBs just fine, if you cut along the flat area. If you try to cut on the edge, it doesn't work very well.
Just put the PCB on a corner of a workbench, lay the hacksaw flat across the line you want to cut, and saw; takes only a minute!

19  Using Arduino / General Electronics / Re: P-Channel mosfet controlling car 12v light on: November 05, 2012, 01:18:10 pm
Quote
All the 10K pullup does is hold the MOSFET "off" when the NPN is off, and bias the MOSFET
gate to approx -12V when the NPN is on.

You missed the most crucial role of the pull-up: it switches the MOSFET off when the grounding transistor closes!

With a 10k pull-up, you're going to be running a little over a milliamp into the gate of the MOSFET.
That means it will take a while to switch off.
That means it will spend more time in the dangerous "intermediate" region when it will have higher resistance, and thus generate lots of heat.
As I said above: For a single switch (duty cycle of minutes, say,) this is *probably* fine, unless the load is very high-current. For faster duty cycles, or heavy loads, you may find yourself blowing the MOSFET on a single on-to-off transition. I know from experience, where I had to go to a 100 Ohm pull-up before my P-channels would stop failing :-) (That was with PWM, though)

The gate of the MOSFET is a capacitor. The pull-up is a resistor. Thus, you have an RC filter, and can calculate the rise times!
For a 10 kOhm pull-up with a 1000 pF gate charge, you have a 99% rise time of about 45 microseconds, which is actually a lot! With a 1 kOhm pull-up, you're down under 5 microseconds, which is better.
20  Using Arduino / Programming Questions / Re: A function to handle multiple datatypes on: November 03, 2012, 07:26:34 pm
With "common implementation merging" in the linker, template functions that have the same actual bytecode (because they serialize values of the same size, say,) will all use the same "actual" function under the hood, leading to less bloat. The "pointer and size" function doesn't have any bloat in implementation, but instead there's a little bit of bloat each time you call it, as the size has to be passed as an argument, not hard-coded in the function.

If size REALLY matters, you have to implement it both ways and measure it :-)
21  Using Arduino / General Electronics / Re: P-Channel mosfet controlling car 12v light on: November 03, 2012, 07:23:53 pm
I still think 10k is too much resistance for the pull-up. Try 2.2k. Although 10k possibly won't blow the P-channel if you don't "blink" the light, and/or it isn't very high wattage.

I also would use a BS170 n-channel MOSFET instead of the NPN transistor. The circuit could look almost exactly the same as the one for the NPN (you could switch the Arduino resistor to 1k, and might not need the pull-down.)  But now I'm just being anti-BJT :-)
22  Using Arduino / Project Guidance / Re: memory woes on: November 02, 2012, 10:12:09 pm
The "remote programming connection" for the Pi is SSH or even VNC :-)
23  Using Arduino / General Electronics / Re: About the article "10 Ways to Destroy an Arduino" on: November 02, 2012, 12:38:59 pm
When will we see a RuggeDue? :-)

Also, a RuggedyPi would be cool, I guess. Although for the Pi, you really want to just use a separate board for the I/O, and that can have the protection on it.
24  Using Arduino / Project Guidance / Re: memory woes on: November 02, 2012, 12:37:11 pm
The Pi's work right now?

Mine works OK. Granted, it doesn't have a lot of available power for peripherals, so you have to power those separately, and it's also a 3.3V/2mA I/O device, so you can't really power LEDs directly from the pins. It is a bit of a different animal, but if network connectivity is a requirement (maybe even WiFi) then I'd vastly prefer it over adding an Ethernet shield. Then again, I've used Linux for various things since 1995, so it's "home turf" for me :-)
25  Using Arduino / General Electronics / Re: P-Channel mosfet controlling car 12v light on: November 02, 2012, 12:30:55 pm
You can see the diode pointing forwards on the P-channel, so yeah, swap that around.
Also, I think the 10 kOhm pull-up is a bit weak. It will make the P-channel switch slowly, and if it's weak and/or the load is heavy, it might overheat.
Also, the transistor and base current limiting resistor are not needed. A 500 Ohm or 1 kOhm resistor from the Arduino to the gate of the MOSFET is all you need if you're using an N-channel that switches on the bottom -- that will be a lot more efficient. If you still need a P-channel, then use a 500 Ohm or 1 kOhm resistor into the gate of a small-signal N-channel MOSFET (like the BS170) and a 1-2 kOhm pull-up, instead of the BJT NPN you're using.

So, what I would do, assuming the grounding of the lamp is not interruptible or reversible to power (so, must use P-channel):
500 Ohm resistor from Arduino to gate of BS170. BS170 source to ground, BS170 drain to P-channel gate and 2 kOhm pull-up to 12V. P-channel source to 12V. P-channel drain to light.
26  Using Arduino / Project Guidance / Re: memory woes on: November 02, 2012, 12:48:10 am
The tasks may seem simple compared to regular computers, but there's a reason we call them MICROcontrollers.
Honestly, for the specific application you are describing, with no hard real time requirements, I'd probably use a Raspberry Pi. Ethernet built in, SD built in, web server built in, runs Linux, program in Python or whatever.
27  Using Arduino / Programming Questions / Re: A function to handle multiple datatypes on: November 02, 2012, 12:42:39 am
All you neediest function overloading. Write both functions andngive them the same name and the compiler will figure it out based on the data type of the argument.
28  Using Arduino / Programming Questions / Re: Strings cause arduino to crash :( on: November 01, 2012, 01:32:58 pm
It's my experience that you should never use dynamic memory allocation (operator new, malloc, or things that use them) on microcontrollers. There's just too much that can go wrong with fragmentation, heap running into stack, interrupts, etc.

Fixed buffers are the way to go. If you need to call "new" to create something, use placement new:

Code:
#include <new>

char storage[sizeof(MyThing)];
MyThing *ptr = new(storage) MyThing(arguments);

Also, some other things mentioned in this thread:
- An array of charais actually a byte-sized (or rather, byte-aligned) piece of data. This will have sizeof() 6:
Code:
  struct stuff {
    char a[3];
    char b[3];
  };

- A fixed-size array does not use heap. It uses global data segment space (if global/static) or stack space (if local.) There is no risk of fragmenting either.
29  Using Arduino / Microcontrollers / Re: Fried another two programmers :-( on: October 31, 2012, 10:12:54 pm
That might still be better than having *fired* a programmer :-/
30  Using Arduino / General Electronics / Re: About the article "10 Ways to Destroy an Arduino" on: October 31, 2012, 10:11:30 pm
I'm a beginner to Arduino, and I'm very nervous whenever I connecting pins with wires.  I came across an article "10 Ways to Destroy an Arduino" in the internet.  I'm just wondering, are all the pitfalls mentioned in the article true? (Obviously, the author of the article has a conflict of interest.)

All of them are very real! And I have experienced most of them myself in one way or another. I buy Atmega 328p chips (the CPU on the Uno) in quantity 25 from Digi-Key, so each cloud of magic smoke only costs me $1.98 :-) I do crazy things like build my own H-bridges for 15A motors, though, and I'm also known to accidentally put down soldering irons on energized boards.  smiley-red

If I had known about the Ruggeduino when I started out with Arduinos, I'd probably have gotten one of those instead.

Note that the "conflict of interest" with the author might not be all that bad. It's not like he's trying to scare you into buying his version. It seems to me like he knows how things can go wrong, and because he specializes in ruggedizing circuits (I think he's a consultant) he's using the Ruggeduino as a showcase of what he can do. Also, as the Arduino really is aimed at a wide variety of skill levels, I'm a little miffed that the Arduino guys themselves didn't add those protections. At the volume that Arduino Unos are selling these days, that probably would have been very cheap...
Pages: 1 [2] 3 4 ... 55