Skip to main content

Posts

Showing posts with the label Practical Circuits and Designs

Arduino Blinking LEDs

Arduino boards have I/Os (Input/Output) that can either receive or transmit signals. One of its basic functions is digital input/output. It can be programmed to output digital signals that can be used drive devices, such as an LED . To drive an LED, you will have to add a resistor to regulate the current to the LED. The digital output is about 3V (5V or a little less for 5V board), and for an LED the forward voltage is about 2V. What is left (1V) divided by the resistor sets the current. Current is typically 10 to 20mA. Driving an LED Below is an example code for alternating LEDs on Arduino Pro Micro Board. It uses pins 2, 3, 4, and 5 as digital outputs. My 11 year old son helped out in the programming. :) void setup() {   // initialize digital pins 2, 3, 4, and 5 as outputs.   pinMode(2, OUTPUT);   pinMode(3, OUTPUT);   pinMode(4, OUTPUT);   pinMode(5, OUTPUT); } // the loop function runs over and over again forever void loop() {   di...

Arduino Transistor DC Motor Control

Arduino boards have PWM (Pulse Width Modulation) outputs that can be used to control like the speed of a DC motor. On a Pro Micro, those outputs are encircled white on the board. You can program it such that it outputs on a scale of 1-255, 1 being the slowest and 255 being the fastest. PWM gives out pulses whose width is varied (modulated) while the period is constant. The longer it is high, the higher power it delivers to the circuit. PWM can be used to drive a transistor (switch) which in turn drives the motor ON and OFF. The longer the switch is ON, the higher the power delivered to the motor, and thus faster. The circuit consists of a transistor Q1 (TIP31) NPN transistor, driven by the PWM from Arduino. The resistor is to limit the current to the base, but enough to operate the transistor in saturation when the input is high. The diode is to protect the motor from any back emf that might come from the motor when the current is cut off. The circuit is supplied by a 9V battery. ...

Making a Current Source Using an In-Amp

With the availability of many modern instrumentation amplifiers today, it has become quite an easy task to build a very precise current source. Current source is an important electronic building block that is supposed to deliver a constant defined current regardless of the load. If to a voltage source the low output impedance is the important characteristic, high output impedance would be for the current source. High output impedance means that as the load voltage changes due to current being sourced or sunk, there is very small change to the current. Ideally we would want the current to remain unchanged, because it is what it is supposed to do, to be a constant current source. My Digilent Discovery Kit includes an AD8226 in-amp, and together with a buffer, OP02 , also included in the kit, I made a very simple but very precise current source.  What I like about this in-amp is it is a low-power, wide input and supply range instrumentation amplifier at +/-1.35 to +/18V, ve...

Simple Voltage-to-Frequency Converter

Early this year I got my Digilent Analog Discover Kit . It is a wonderful PC based design and experiment kit complete with software measurement and resource tools perfect for students and professionals alike, but students surely will benefit the most out of it.The complete Discovery kit includes many useful exciting components that will enable you  to design your own circuit in your living room! One cute little component it has is the AD654 , a low-cost IC voltage-to-frequency converter. It is a very simple to use IC that outputs a square wave with programmable frequency, set by just a single RC network. The scaling relationship as obtained from its datasheet is: Below is a simple V-F circuit that takes its input from another IC included in the kit, the AD584 , a precision programmable voltage reference. Figure 1 V-F Converter The AD654 accepts full-scale current up to 2mA, but the best linearity is offered at 1mA full-scale. The voltage input is converted to ...

Practical Integrator Circuit - A Triangle Waveform Generator

Below is a basic op amp configuration of converting a square wave input to triangular waveform. Figure 1 The concept is pretty simple. The square wave input produces a current that is translated to a voltage ramp across the capacitor. The positive cycle of the input produces a negative ramp output, while the negative input produces a positive ramp. The ramp is governed by the following basic equation: Equation 1 where Ic  is produced by the input voltage divided by Rin, since the same current flows in the resistor and in the capacitor. Note that the input has to be centered and symmetrical about the positive input terminal which is connected to ground, in order to produce a symmetrical output. But this basic configuration has some serious problems. Even if the output starts at zero, it will not be centered at zero, and will not stay at the same center or common mode value due to the inherent offsets of the amplifier. Figure 2 A technique in order to hold th...