Show Posts
Pages: 1 ... 47 48 [49] 50 51 ... 160
721  Using Arduino / General Electronics / Re: Circuit Debounce on: October 12, 2013, 03:15:53 am
I simply emulated a 1uf cap , obviously i let it draw as much current as possible, the arduino has a 40ma limit si.    So ard we not risking damage?

Ok if that circuit emu is right, it's going to be fine...
722  Using Arduino / General Electronics / Re: Circuit Debounce on: October 12, 2013, 02:58:46 am
I'm concerned with the rate of charge discharge.

Let's say you dis charge the cap by shorting, just how much current will i draw from the arduino pin? I see no resistor?
723  Using Arduino / General Electronics / Re: How to TTL a laser? on: October 12, 2013, 02:54:54 am
In that circuit i see a constant 5v regulator and a constant current of 300ma.....

So what are you saying?
In the circuit, as drawn, I see a 7805 linear voltage regulator being fed by a 1.5V cell.  But assuming that the poster meant that the source voltage was, infact 7V or above, as required by the regulator, the regulator will supply 5V out, as long as the supply can keep input at, or over, 7V; at a MAXIMUM of 1A draw, as long the supply can supply 1A or more.  The output is only regulated to 5V at a max of 1A.  if the input current (source battery depleation, for example) drops below 1A, so does the output current.  One Amp in, through 10 Ohms (disregarding losses in the transistor) is 500mA, not 300mA. What I am saying is read the datasheet.


MarkT,
"But a series resistor is one perfectly good way to get constant current drive..." for a first year E.T. student, or maybe more accurately said, Until the resistor heats up and changes value (remember what lousey temp coefficients resistors have?).

I do a lot of playing around LASER diodes at various wavelengths, and the first rule (after use your goggles) is ALWAYS use a constant driver driver circuit.  Then you worry about things like heatsink requirements...
You CAN depend on a resistor for your current control. if you want to (they call it 'Kip Kay'ing'), but you are gonna loose more diodes to over-current-burn-outs than you will to ANY other cause.

You do it however you want. Listen, or not, read the datasheet, or not  I did my part. See ya!



I was taking into acount the forwarf voltage drop of a typical 2v diode.
724  Using Arduino / General Electronics / Re: Circuit Debounce on: October 12, 2013, 01:23:44 am
Still, you may damage an a hardware pin, you need to limit the current.
725  Using Arduino / General Electronics / Re: Circuit Debounce on: October 11, 2013, 10:22:54 pm
I'm talking about this circuit and the fact, the resistor stops the very fast discharge...

with the resistor there, having a LOW value until the cap discharges prevents the bouncing on the Arduino's input, even if it took 100ms to empty (via a 1k resistor) is acceptable.

See the Circuit, is that the circuit we both see?
726  Topics / Device Hacking / This is what we're missing from the Arduino range! on: October 11, 2013, 09:47:06 pm


I love it lol....
727  Using Arduino / General Electronics / Re: How to TTL a laser? on: October 11, 2013, 12:47:37 pm
In that circuit i see a constant 5v regulator and a constant current of 300ma.....

So what are you saying?
728  Using Arduino / General Electronics / Found a useful converter online! on: October 11, 2013, 11:25:26 am
http://www.translatorscafe.com/cafe/units-converter/electrostatic-capacitance/calculator/picofarad-%5BpF%5D-to-nanofarad-%5BnF%5D/


I hate having to remember 0.1uf is the same as 100nf 10nf 0.01uf , trying to remember if it's nf or uf or pf is a pain esp when reading circuits, this website is a big help, just wanted to share....
729  Using Arduino / General Electronics / Re: How to TTL a laser? on: October 11, 2013, 11:23:41 am
I.R. LASER diode needs to be fed 2.2 volts, not 5 volts.  You need a driver (constant current source) instead of that 5volt linear regulator.

If you look at the circuit, he IS using a constant current source (and constant voltage) WITH that 5v linear regulator.

Secondly, 5v or 2.2v, big whoop, a PWM switching method is preferred over linear, already been stated...
730  Using Arduino / Microcontrollers / Re: Nano - TTL and serial ? on: October 11, 2013, 07:13:22 am
http://arduino.cc/en/Reference/SoftwareSerial

3840 should be fine....
731  Community / Bar Sport / Re: Modding LEDs on Arduino Clones. on: October 11, 2013, 06:07:25 am
hmmm, you could probably get around it, unmount the LED.

http://www.ebay.com.au/itm/50-x-SMD-SMT-0402-Chip-Resistors-Surface-Mount-0R-0Rohm-ohms-1-16W-5-RoHs-/170826322480?pt=AU_B_I_Electrical_Test_Equipment&hash=item27c60ad230

tack on to the end a resistor ( a 0402 ), move it a little to the right or left and then add the solder.

http://articulationllc.home.comcast.net/~articulationllc/sm0402.htm

The smallest I use is 08 maybe 06....  and even with them i'm scared i'll accidentally sneeze or worse, breathe in a bunch of leds and resistors, i don't fancy accidentally eating $6 of components lol :O


732  Using Arduino / General Electronics / Re: Circuit Debounce on: October 11, 2013, 04:45:18 am
The resistor is primarily there to protect too much current discharging through the button each time it's pressed, without it, it's a dead short when you press the button to discharge the cap.
733  Using Arduino / Programming Questions / Re: Counting pulses in the last 60 seconds on: October 11, 2013, 02:11:53 am
a 3 dimensional array where each second has the "count" strike, if it sees 30 strikes in 1 second, then
  • [30]  eg second 1, 30 strikes, [12[2] on the 11th second, 2 strikes took place, using my method to simply loop through from the begining only wiping the old, not needing to store data on the end, and then wiping the values null again.

my method would work with a couple of modifications and a 3Dimentional array smiley
734  Using Arduino / Programming Questions / Re: Errors in Programming on: October 11, 2013, 12:55:57 am
I wrote my own little thermostat app to switch on a heater when it got cold... it's similar to above but i might have put something in you may want to use for your own ?...

Code:
#include <OneWire.h>
#include <stdlib.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//#include <Wire.h>
//#include <Adafruit_BMP085.h>
#define RelayPin 7
#define Rled 3
#define Gled 5
#define Bled 6
#define b2 8
#define sbled 9
#define PowerPin 12

boolean OldPower,Power = true;
float OldTemp;
boolean Relay = false;
boolean RelayM = false;
byte LightLevels[] = {0,10,50,80,100,150,200,225,255};
byte LL = 0;

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 10

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
LiquidCrystal_I2C lcd(0x27,16,2);
DallasTemperature sensors(&oneWire);


void setup(void)
{
  // start serial port
  pinMode(Rled,OUTPUT);
  pinMode(Gled,OUTPUT);
  pinMode(Bled,OUTPUT);
  pinMode(RelayPin,OUTPUT); 
  pinMode(8,INPUT);
  pinMode(sbled,OUTPUT);
  pinMode(b2,INPUT);
  pinMode(Power,INPUT);
  analogWrite(Rled,0);
  analogWrite(Gled,0);
  analogWrite(Bled,0); 

 for (int i=1; i<10; i++)   //3 pin RGB test
 {
  analogWrite(Rled,225);
  delay(20);     
  analogWrite(Rled,0); 
  delay(20);     
  analogWrite(Gled,225);
  delay(20);     
  analogWrite(Gled,0); 
  delay(20);     
  analogWrite(Bled,225);
  delay(20);     
  analogWrite(Bled,0); 
  delay(20);       
 }
   
  lcd.init();                      // initialize the lcd
  lcd.backlight();
  // Print a message to the LCD.
/*  for (int n=1; n<55;)
   {
    n++;
    lcd.backlight();
    delay(100);
    lcd.noBacklight(); 
    delay(100); 
   }*/
 // attachInterrupt(0,TriggerIRQ,RISING);
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

// if (!bmp.begin())
 //   Serial.println("Could not find a valid BMP085 sensor, check wiring!");
  // Start up the library
  sensors.begin();
}



void loop(void)
{
  sensors.requestTemperatures(); // Send the command to get temperatures
  float T;
  char TStr[5];

// T= 21;
 // Serial.println(T);

  T = sensors.getTempCByIndex(0); 

  if (T<10)  //this is for a quick visual status
   {
     //relay on, heater on.
 //    Serial.println("freezing cold");     
     analogWrite(Rled,0);
     analogWrite(Gled,0);     
     analogWrite(Bled,220);     
   }

   if ((T>=10) &(T<19))
    {
//      Serial.println("cold");     
     analogWrite(Rled,0);
     analogWrite(Bled,225);
     analogWrite(Gled,225);
    }

   if ((T>=19) & (T<26))
    {
 //    Serial.println("warm");     
     analogWrite(Rled,0);
     analogWrite(Gled,225);
     analogWrite(Bled,0);     
    }
   
   if ((T>=26))
    {
 //     Serial.println("hot");     
     analogWrite(Rled,225);
     analogWrite(Gled,0);
     analogWrite(Bled,0);     
     }

    if (RelayM==true)  //button press detected (although holding down is required depends on luck)
    {
        if (T>=20.0)  //max temp to reach with override button
       {
         RelayM=false;
         digitalWrite(RelayPin,RelayM);     
        } //heater off
    }
     
     
  //pin 8 connects to a button to override and turn on the heater
  //ideally, I want to trigger this quicker, so a delay may have to go

  Power=digitalRead(PowerPin);
 if ((Power==LOW))
   {
      LL=2;
      RelayM=false;
      digitalWrite(RelayPin,RelayM);
      analogWrite(sbled,LightLevels[LL]);
      delay(80);
      OldPower=Power;
   }



   if (digitalRead(2)==HIGH)
   {
      delay(80);
      RelayM=!RelayM;
      digitalWrite(RelayPin,RelayM);
   }
   
    if (digitalRead(b2)==HIGH)
   {
  //   Serial.println("Boo LL = ");
      delay(80);     
     LL=LL+1;     
     if (LL>=sizeof(LightLevels))
        LL=0;
      analogWrite(sbled,LightLevels[LL]);
      lcd.clear();  //i2c library LCD             
      lcd.setCursor(0,0);
      lcd.print("Brightness: "); 
      lcd.setCursor(1,1);
      lcd.print(LightLevels[LL]);
      lcd.println(" of 255 MAX"); 
      delay(987);     

      OldTemp=0;
//Serial.println(LL);
   }

  if ((T>=18.5) && (RelayM==false)) //if override is off do normal operation
    {
      Relay=false; //turn off relay
      digitalWrite(RelayPin,Relay);     
    } //heater off
   else
  if (T<=16.5)
    {
      Relay=true;  //turn on relay as it's cold
      digitalWrite(RelayPin,Relay);
    }
   
//    Serial.println(T);
//    Serial.println(OldTemp);   
  if (OldTemp!=T)
   {     
     dtostrf(T,5, 3, &TStr[0]);
     TStr[5]=0;   
     lcd.clear();  //i2c library LCD             
     lcd.setCursor(0,0);
     lcd.print("The Temperature:"); 
     lcd.setCursor(1,1);
     lcd.print(TStr);
     lcd.println(" Degrees C"); 
     delay(55);     
   }   
     OldTemp = T;     
     
   
}


I used a RGB LED to indicate how cold/warm it is, a relay pin to switch on a electric heater.

BUT!

I used the dallas temp sensor not a thermistor, so you'd have to literally strip lines away of the code to (search and replace is handy for quickly renaming variables)
735  Using Arduino / Microcontrollers / Re: Nano - TTL and serial ? on: October 11, 2013, 12:50:34 am
infact, i just compiled it, not tested though.

Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

void setup()  
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
  mySerial.begin(9600);
}  

void loop() // run over and over
{
   char c;
    if (mySerial.available())
     {
      c=mySerial.read();
      mySerial.print(c);
     }
}

Stick the UART of the ODBC into pins 2&3  remember to change the Serial baud rate to match or it will be garbage you'll get back and send.
Pages: 1 ... 47 48 [49] 50 51 ... 160