Monday, 6 August 2012

Drive Servo using Servo.write

Coding


Arrangement Circuit Board


Sunday, 5 August 2012

Getting Started


Tutorial analogRead


reading analog value


The goal of this example is to read an analog value. Based on the value read, a led will blink faster or slower.

WHAT DO YOU NEED





SCHEMATIC



BOARD


In the schema you need a variable resistor connected to pin 15 and to 5V and GND.SOFTWARE

// test blink with Pinguino

#define PIC18F4550

// pin where the led is connected
#define LED 0

void setup()
{
pinMode(LED,OUTPUT);
}

void loop() T
{
digitalWrite(LED,HIGH);
delay(300+analogRead(15));digitalWrite(LED,LOW);
delay(300+analogRead(15));
}


As this it's not the first pinguino example, we are going to suppose that you know what means the setup and loop functions, and why appears the #define PIC18F4550 directive.In this example of new function we are going to use the analogRead.

analogRead will return a 10 bits value, based on the analog value on the specified pin. If the pin has 0V, the returned value will be 0, if the pin has 5V the returned value will be 1023.

Then in this example, we use the readed analog value to determine the value that we pass to the delay function. If the voltage is 0V, we will execute a delay(300), if the value is 5V, we will execute a delay(300+1023)
DO-IT-YOURSELF

- Instead of blinking the led, change it to dimmer

Saturday, 4 August 2012

Capacitor for voltage regulator


The capacitor is required.

Inside the regulator is a high gain amplifier, always monitoring the difference in output voltage with an internal reference supply. Like most amplifiers, it can become unstable if variations in supply voltage cause a change in output voltage. Given the battery has quite a high internal resistance, it is very likely it's voltage will vary if the load changes.

You should always connect a capacitor of more than 100nF and preferably in the region of 1 to 10uF across the input terminal and ground with the wiring as short as possible. A capacitor on the output is less important but it is preferable to have one close to the output and ground pins as well. If you make the output capacitor too big, it has a detrimental effect on the regulators transient response. Between 1 and 10uF is usually a good choice.

Brian.




Re: Which capacitor to use with 7805 voltage regulator?

I suggest 1 - 10uF because that's what the regulator manufacturers suggest. The value isn't critical but if you make it too small you risk it being inadequate to damp oscillation. If you make it too big, at least with a single capacitor, you run the risk of the high frequency impedance of the capacitor being too high. Most cheap aluminum electrolytic capacitors have a relatively high internal inductance so while fine as reservoirs in power supplies, they become less effective at damping high frequency oscillation. You will find that in 'better' designs, there are two parallel capacitors used, one will be electrolytic to give a high value in a small space and the other will be ceramic to improve HF performance.

Brian.






Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews