I've just put an order in for 30x 2SD965 transistors from a hong kong based eBay seller... remains to be seen whether they'll do the job, but for my chosen application (very small HV inverter/cap charger similar to camera flash), I will probably accidentally kill quite a few of them. So, being slightly off-spec doesn't bother me very much. I say, go for it anyway. If nothing else, having some cheap "throwaway" bits might be handy for R&D purposes where things might accidentally get blown up.
RMS (root mean square) is a measure of A/C, so isn't a consideration here.
Quite right, I was thinking of the wrong damn component :-P "continuous" is what I should have written. On that note, I was checking the datasheet again for my favourite N-channel mosfet for playing with pyros, the IRF540N. At 25 degrees C, it reckons it can handle 33A continuous drain current. That, or something like it, would probably stand up to repeated abuse
If it was me, I'd start by measuring the current required to fire the thing, just by connecting it straight to the battery with an ammeter in series with your load.
Then, I'd probably go looking for mosfets that could handle a bit more current than I absolutely needed. I think it's the RMS value rather than peak/surge you need to look at. If you run them at their absolute limits for too long they might not last as long as you'd like.
I would definitely consider using an opto-isolator between the output pin and the mosfet, just for that extra level of protection in case something goes horribly wrong. Connecting all those parts up is dead simple, a quick snoop around Google and you should be able to find loads of circuit diagrams. A 100kohm resistor pulling the mosfet's gate to ground might also be needed, to make sure it stays off when it's not supposed to be doing anything.
Noted for future reference, Marek. I really am amazed how much of a n00b I can be sometimes, I'm sure I've actually used that stuff in my old BASIC programming days
Anyway, code works now... counting up like a beauty
That looks like exactly what I need! Thanks, I'll play with it now. I couldn't for the life of me figure out how to format the damn statements to do what I want.
This might sound pretty stupid, but I actually don't know WHAT to google to get a simple answer, so hopefully you guys can help me out :-) I bet it's one of those things that's really obvious once I know, but I'm hungover and my brain's not firing on all cylinders... hehe
Anyway, let's say I have a 4 digit number for example 1234. I want to split this up into thousands, hundreds, tens and units across 4 variables, ending up with each one holding a value of 0-9 so I can then push these out to my 7-segment module.
There MUST be a nice neat operation to do this, but hell if I can find it :-P Thanks in advance for the help!
EDIT: Here's the code I'm fiddling with, it should be apparent what I'm trying to accomplish.
Well EXCUSE ME Maybe I'm the only one who gets tired having to hack and bodge every damn thing and actually WANTS the proper tool to hand once in a while
As a side-note, why not invest in an AVRisp MkII programmer next time you have a few bucks knocking around? They're hardly expensive and might make easier work of re-bootloadering things. Been meaning to get one myself for just that purpose. It's good to know all the bodges and workarounds of course, but it's also good to have a nice stash of tools
As I understand it, the Flash memory and EEPROM are completely separate entities. So anything you store in EEPROM will stay there until you clear it or overwrite it.
A very early and ugly breadboard prototype I've refined the code a fair bit, and using a Pro Mini and a small serial-enabled LED module my final build should be quite small. I'm looking forward to having some production models done to take to games!
Post pics of yours when it's done Would be interesting to compare notes. I'm in the process of miniaturising mine now, so it can be used in a hand-held "stick it to the wall, set it and run" sort of fashion.
Wondering if I should use the external interrupt features to devise some sort of anti-handling feature.... mmm naughty.
Just checked my datasheets and the TIC106 I mentioned can handle 30A surge, 5A continuous. Might be worth considering for future projects as you'll find it pretty difficult to kill one in your chosen application!
I've made stuff like this before and have several projects in the pipeline for this purpose! (Although I use Mk5 maroons typically, rather than smokes).
My personal choice is an IRF540N N-channel MOSFET, but I have also used a TIC106 SCR to accomplish the same ends. The igniters I use obliterate themselves open-circuit after firing, so the SCR will turn off when the job is done
Yeah! For any timer project, you've gotta have the beeps and bloops. Especially if it's destined to be used for war games for that "movie prop" feel.
Here's what I've got going on code-wise at the moment:
Code:
const int SDATA = 12; //pin definitions, treating the DSP-0801 like a giant shift register const int CLOCK = 11; const int LATCH = 10;
int t_minutes = 0; //set up timekeeping variables, available to all functions (not used yet!) int u_minutes = 0; int t_seconds = 0; int u_seconds = 0;
void setup () {
pinMode(SDATA, OUTPUT); //set those pins to output pinMode(CLOCK, OUTPUT); pinMode(LATCH, OUTPUT);
delay(500); //allow DSP-0801's onboard PIC to wake up before sending anything, seems to fix display bugs MOST of the time
for(int i = 0; i < 8; i++) { //send 8 blank digits to clear all registers digitalWrite(LATCH, LOW); shiftOut(SDATA, CLOCK, MSBFIRST, 0x0000); //send this value twice in 8-bit sections shiftOut(SDATA, CLOCK, MSBFIRST, 0x0000); digitalWrite(LATCH, HIGH); }
int scrollRate = 100; //defines how fast digits will scroll word charTable[8] = { 0x00F7, 0x8F3, 0x1536, 0x0079, 0x120F, 0x4000, 0x4000, 0x4000 }; //character table array - what we want to put on the display goes in here
for(int index = 0; index < 8; index++){ word charData = charTable[index];