Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
For the transistor, use 5kohm. For the LED, use 250ohm.I got both of those values from that same page It says 20mA for the LED, and your Axon is 5V, so using ohms law requires 250ohms.
Quote from: Admin on January 14, 2011, 07:19:46 PMFor the transistor, use 5kohm. For the LED, use 250ohm.I got both of those values from that same page It says 20mA for the LED, and your Axon is 5V, so using ohms law requires 250ohms.Don't forget the LED forward voltage drop of 1.25 typical (1.7V max), making it: (5V - 1.25V) / 20mA = 187.5 Ohm => 180 Ohm for ~20mA(250 Ohm will give 15mA and give about 75% of nominal LED output).
That chart makes little sense to me. I understand the rise/fall graphs, but how did you determine the R1 ohmage(yes, i made that word up)? Why 5K and not 1K (beginning of 'rise' plateau)?
If I have the wiring correct, my next question is can use the simple pin_change function to monitor it's values?
I don't have a 180 or 1K ohm resistor, so I'm using the closest ones I have in inventory. I should be okay, but would appreciate any insights.
#include "sys/axon2.h" #include "a2d.h"#include "uart.h"#include "rprintf.h"#include "pinChange.h"void myCallback(const IOPin* io, boolean val, volatile void* data){ rprintf("Pin changed!!! OMGOMGOMGOMGOMGOMG!!!\n"); }void appInitHardware(void){ uartInit(UART1, 115200); rprintfInit(&uart1SendByte);}TICK_COUNT appInitSoftware(TICK_COUNT loopStart){ pin_change_attach(K0, &myCallback, null); return 0; // dont pause after}// This routine is called repeatedly - its your main loopTICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){ rprintf("Hello world\n"); //device alive messages for debug return 1000000; // wait for 1 second before calling me again. 1000000us = 1 second}
(When axon running) Using my multimeter, I am able to see a steady 4.7v coming out of the ground (breadboard) so I know the LED circuit is working okay. And when I test the signal out, it returns 0.05V (beam unbroken), and when the beam is broken, it drops to 0.00v.
Why would the the photo resistor have such a high voltage output, with such a minimal fluctuation in voltage? I have read, re-read, and read again the product manual and cannot figure out where they specify (using their own example of 5Vcc in) the expected voltages of the rise and drop. I see rise and fall times, but not voltages (probably right in front of my face too!).How would I get this sensor to read 0v unbroken beam, 3.3v+ broken beam?! I don't see a change in resistors doing this.
Hi,Quote from: GrooveHolmes on March 06, 2011, 05:48:16 PMWhy would the the photo resistor have such a high voltage output, with such a minimal fluctuation in voltage? I have read, re-read, and read again the product manual and cannot figure out where they specify (using their own example of 5Vcc in) the expected voltages of the rise and drop. I see rise and fall times, but not voltages (probably right in front of my face too!).How would I get this sensor to read 0v unbroken beam, 3.3v+ broken beam?! I don't see a change in resistors doing this. I assume you have a DMM, so measure the resistance of the LDR (Light Dependant Resistor/photo resistor) with the LDR lighted as well as in "dark". Your statements sounds like you are using a (wrongly) guessed value for it.You want the resistor to be a value around the percentile mean of these two values - the formula... Resistor = sqr(Rdark/Rlight)*Rlight