Show Posts
Pages: 1 2 [3] 4 5 ... 147
31  Using Arduino / LEDs and Multiplexing / Re: Breathing LED controlled by temperature sensor (NEED HELP!!) on: April 13, 2014, 09:37:51 am
So, if I used that sketch with an ordinary LED, but made tempReading a const, it'd sit there fading in/out?
Can you suggest a good value to plug in?
32  Using Arduino / LEDs and Multiplexing / Re: Breathing LED controlled by temperature sensor (NEED HELP!!) on: April 13, 2014, 08:46:37 am
and what transistor?

Transistor?

How do I take a pause after sampling and analogWriting at the end of the loop? 

Code:
#include <math.h>

const int transistorPin = 9;
int tempPin = 0;
int tempReading;
int x;
void setup()
{
  pinMode(9, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  tempReading=analogRead(tempPin);//temperature reading
  x=map(tempReading,150,170,1,5);//map the reading to change the frequency
  Serial.println(x);
  float val = (exp(sin(millis()/1500.0*x*PI)) - 0.36787944)*108.0;//the function of breathing led
  Serial.println(val);
  analogWrite(transistorPin, val);
  delay(500);  //  <<<< a pause
}

Stll, though, what is the "breathing" effect here?
33  Using Arduino / General Electronics / Re: Transistor's base voltage.. on: April 13, 2014, 08:39:54 am
cj,
Are you off your meds again?
34  Using Arduino / General Electronics / Re: Maximizing RFID Reader Operating Range on: April 13, 2014, 08:38:44 am
I have connected an RFID reader to my Arduino Pro Mini.  Initially, I had connected a 9V 650 mA adapter to the Arduino raw pin.  However, when I connected a 9V 1A adapter, the read range of the RFID reader increased. 

Also, could you elaborate please?  I'd be happy to provide more details.

Maybe the 650mA supply is a dud?

What I'm taking from this is that you're running the RFID from the ProMini 5V pin?
When you had the ProMini running off a "9V 1A" the RFID did better than when using a "9V 650mA" supply.
Now that I see the data sheet, Page 2 (table 1) informs us that it can run from a wide supply range, 5-15V.
So, why not run it from your "9V" supply directly?

Perhaps you could dispel all doubt and attach or link to a sketch of your hook-up diagram of what you have going?
Or take a good quality picture with everything in shot?

35  Using Arduino / General Electronics / Re: Transistor's base voltage.. on: April 13, 2014, 08:26:53 am

Give them an inch and they'll take a mile.
There's that VCBO spec, too


36  Using Arduino / General Electronics / Re: Transistor's base voltage.. on: April 13, 2014, 08:17:03 am
VBE vs. VEB

What's in a name?  A lot.
37  Using Arduino / General Electronics / Re: Maximizing RFID Reader Operating Range on: April 12, 2014, 07:11:48 pm
Also, here is the spec sheet of the RFID reader...

Where?


Still, from your description, something seems amiss.
38  Using Arduino / LEDs and Multiplexing / Re: Breathing LED controlled by temperature sensor (NEED HELP!!) on: April 12, 2014, 07:08:22 pm
Is it the val values that you are hitting analogWrite with?
What if you Serial.print those?  What's happening there?
Shouldn't you take a pause after sampling and analogWriting at the end of the loop?  To let that dwell for a bit?
I guess it's supposed to rise and fall, and how does that work out?
39  Using Arduino / General Electronics / Re: can anybody tell me the gain of this transistor for 0.15 amp collector current? on: April 12, 2014, 10:36:34 am
What are you trying to do?
Be specific.
40  Using Arduino / Project Guidance / Re: logic for arduino programming? on: April 12, 2014, 10:34:52 am
Could be at the beginning of your loop, digitalRead for a switch and you'd go to one function or another from there.
Even then, from either function you could check that switch to go to the other function.
41  Using Arduino / Project Guidance / Re: Arduino GPS speed pulse generator for digital speedometer on: April 12, 2014, 09:25:22 am
Well, if it's a 21 inch radius then the circumference is 132 inches = 3.35 metres.
2 * 3.14159 * 21 = 132 in   132 in * 2.54cm = 335 cm = 3.35 m
100 km/h / 60 / 60 = 27.78 m/s (metres per second)
27.78 / 3.35 = 8.29 revolutions / sec  [8.3 Hz]
42  Using Arduino / General Electronics / Re: How to use shift register. on: April 09, 2014, 09:03:45 pm
Some shift registers are for inputs and others are for outputs.
A 74_165 is used to shift the states of its inputs to the device that controls it.
43  Using Arduino / Programming Questions / Re: Arduino Uno as a HID Keyboard PROBLEM on: April 09, 2014, 01:30:37 pm
You do NOT want to increment the counter when the pin IS low. You want to increment when the pin BECOMES low. Look at the state change detection example.

so Why it should not be counted when its low?

PaulS was drawing your attention to the difference between a transition from HIGH to LOW vs. a LOW state.
44  Using Arduino / LEDs and Multiplexing / Re: Send LED HIGH after "x" seconds on: April 07, 2014, 09:19:26 pm
I don't know which is the active state of a PIR sensor .
My assumption, for this sketch, was that it would go Low.
You can change that easily.

Anyway, once the 5 consecutive second threshold is crossed, LED 13 goes On.
And it stays on till the Reset button is pushed or you include a separate reset option

Code:
//  trippoint5sec
//
//  wait for 5 seconds
//  of constant detection
//

unsigned long refTime;
unsigned long trippoint;
const long threshold = 5000;
byte DET;
const byte pirPin = 8;
const byte ledPin = 13;

void setup ()
{
  //pirPin is INPUT by default, use ExtPullup
  pinMode (ledPin,OUTPUT);
  digitalWrite (ledPin,LOW);
}

void loop ()
{
  DET = digitalRead(pirPin);
  if (DET == 1)  // inactive
  {
    refTime = millis();
    trippoint = refTime;
  }
  else   // Active Low
  {
    pir_active();
  }
}

void pir_active ()
{
  trippoint = millis();
  if ((trippoint-refTime) > threshold)
  {
    digitalWrite(ledPin,HIGH);
  }
}
45  Using Arduino / Project Guidance / Re: How to connect an 8ohm speaker to an Uno? on: April 05, 2014, 12:20:46 pm
... or keep it "low key"
http://www.radioshack.com/product/index.jsp?productId=2103254
Pages: 1 2 [3] 4 5 ... 147