Loading...
  Show Posts
Pages: 1 ... 11 12 [13] 14
181  Using Arduino / LEDs and Multiplexing / Re: 4 5x7 DOT MATRIX DISPLAY on: April 28, 2012, 04:59:09 pm
You can use the MAX7219 to do that. Details here: http://arduino.cc/playground/Main/LedControl
182  Using Arduino / General Electronics / Re: 2n2222 from ebay? on: April 25, 2012, 12:12:15 pm
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.
183  Using Arduino / Project Guidance / Re: electric confetti cannon- warming up nichrome wire on: April 07, 2012, 04:08:37 pm
Quote
I think it's the RMS value
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 smiley
184  Using Arduino / Project Guidance / Re: electric confetti cannon- warming up nichrome wire on: April 07, 2012, 03:23:23 pm
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.

Hope this helps!
185  Using Arduino / Programming Questions / Re: Need some maths help please! on: April 07, 2012, 09:24:38 am
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  smiley-roll

Anyway, code works now... counting up like a beauty smiley-grin
186  Using Arduino / Programming Questions / Re: Need some maths help please! on: April 07, 2012, 09:18:09 am
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.

Lifesaver!  smiley-cool
187  Using Arduino / Programming Questions / Need some maths help please! (RESOLVED) on: April 07, 2012, 08:59:44 am
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.

Code:
int CLK = 10;
int SIN = 11;
int LAT = 12;

byte digitData[10] = {
  0x3F, 0x6, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x7, 0x7F, 0x67
};

// Array to hold segment patterns for digits 0 - 9


void setup () {
  
  pinMode(CLK, OUTPUT);
  pinMode(SIN, OUTPUT);
  pinMode(LAT, OUTPUT);
  
  
}



void loop () {
  
  while(1) {
  
unsigned long time = (millis() / 1000);

int D0 = time ?????????????

int D1 = time ?????????????

int D2 = time ?????????????

int D3 = time ?????????????


  
  digitalWrite(LAT, LOW);
  shiftOut(SIN, CLK, MSBFIRST, digitData[D0]);
 
  shiftOut(SIN, CLK, MSBFIRST, digitData[D1]);

  shiftOut(SIN, CLK, MSBFIRST, digitData[D2]);

  shiftOut(SIN, CLK, MSBFIRST, digitData[D3]);
  digitalWrite(LAT, HIGH);
  
  
  }
  
  
  
    
}


188  Using Arduino / Microcontrollers / Re: ATmega328p with 8MHz internal clock on: April 04, 2012, 03:10:03 pm
Well EXCUSE ME  smiley-razz 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  smiley-razz
189  Using Arduino / Microcontrollers / Re: ATmega328p with 8MHz internal clock on: April 04, 2012, 12:43:59 pm
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 smiley-grin
190  Using Arduino / Microcontrollers / Re: ATmega328p with 8MHz internal clock on: April 04, 2012, 11:53:23 am
Have you already burned a bootloader onto the chip with specific settings to use it's 8MHz internal clock? If not, try that first.
191  Using Arduino / Programming Questions / Re: Store a value on: March 29, 2012, 03:05:34 pm
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.
192  Using Arduino / General Electronics / Re: Arduino timed smokebomb on: March 29, 2012, 02:46:57 pm


A very early and ugly breadboard prototype smiley 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!
193  Using Arduino / General Electronics / Re: Arduino timed smokebomb on: March 29, 2012, 01:44:57 pm
Post pics of yours when it's done smiley-grin 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.  smiley-twist

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!
194  Using Arduino / General Electronics / Re: Arduino timed smokebomb on: March 29, 2012, 01:17:11 pm
Any TO-220 type - MOSFET or NPN use 4 A or more.

This.

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 smiley
195  Using Arduino / Displays / Re: Serial display driving problems on: February 18, 2012, 02:58:38 pm
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];
  
  digitalWrite(LATCH, LOW);
  shiftOut(SDATA, CLOCK, MSBFIRST, (charData >> 8));    //send high byte
  shiftOut(SDATA, CLOCK, MSBFIRST, charData);           //send low byte
  digitalWrite(LATCH, HIGH);
  delay(scrollRate);
  tone(7, 700, 10);
  
}

 tone(7, 1400, 50);
 delay(250);
 
}

 





void loop () {
  
   int scrollRate   = 100;
   word charTable[8] = {
    0x120F, 0x0038, 0x1500, 0x0000, 0x243F, 0x643F, 0x243F, 0x243F };
  
 
  for(int index = 0; index < 8; index++){
  word charData = charTable[index];
  
  digitalWrite(LATCH, LOW);
  shiftOut(SDATA, CLOCK, MSBFIRST, (charData >> 8));
  shiftOut(SDATA, CLOCK, MSBFIRST, charData);
  digitalWrite(LATCH, HIGH);
  
  }
  
  while(1) {
  }
  
  
}



Pages: 1 ... 11 12 [13] 14