Wednesday, October 10, 2012

Simple Line Following babybot


A year ago I built a simple line following mobot. It doesn't use any microcontroller(Arduino, PIC, Atmel, etc.) and even logic ICs.

Simplest Line Following Mobot


This line following mobot uses basic electronic components. Actually, the circuit for this mobot is based on the previous project light/dark activated switch.

The chassis and wheels of the robot are recycled materials. The body is from a box of cookies and the wheels are from the container of wafer stick. I also added a wristband from one of presidential candidates last election for the additional traction of the wheel.

The whole circuit for this mobot is not mounted on a pcb nor a protoboard but on a mini-breadboard. I also uses scrap components for this mobot I found on my bin. 
 

The circuit on the mini-breadboard

This is the circuit of the simple line following mobot.


Basic components are used in this mobot. I uses the following components(all in pairs): bright leds, resistor, variable resistor, ldr, general purpose npn transistor, signal diode, spdt relay and a geared dc motor. 

Here are some pictures of the mobot parts:


Top view of the mobot



DC Geared Motor with recycled wheels.


Sensor part: pair of LEDs and LDRs.


Powered up!


Isometric view of the robot

Digital Clock Using PIC16f628a Microcontroller


This is a very basic digital clock that can be done using a microcontroller. I particularly used a PIC16f628a.

You can also check my digital clock based on 74ls90
here --> http://circuitdesolator.blogspot.com/2010/12/digital-clock-based-on-74ls90.html

Here's the picture of my digital clock prototype




This is the schematic of the device:



 Notes to remember:

1. Put resistors from 7447 to the seven segment display pins(a-g) as current limiter resistors
2. You need to start up you're clock at exactly 1200am/pm.



-------------------------------------------SOURCE CODE-----------------------------------------------
//Digital Clock using PIC16f628a microcontroller
//Design by: Parax (rlabs)
//Date: April 2011

#include

#define _XTAL_FREQ 4000000

__CONFIG(INTIO & WDTDIS & PWRTDIS & UNPROTECT & BORDIS & LVPDIS);

unsigned int hours = 0;
unsigned int mins = 59;

unsigned int timer = 0;
unsigned char mpx_cnt = 0;
static unsigned char mode = 0;

void interrupt ISR(void)
{   
       
            {       
            timer++;
           
            if(timer > 19650)
            {
                mins++;   
                if(mins == 60)
                {           
                    mins = 0;
                    hours++;
                    if(hours == 13)
                    hours == 1;                   
                }
               
                timer = 0;
            }
        }
       
        switch (mpx_cnt)
        {
            case 0:
                PORTB = hours/10;
                RA0 = 1;       
                mpx_cnt = 1;
               
            case 1:
                PORTB = hours%10;
                RA1 = 1;       
                mpx_cnt = 2;
           
            case 2:
                PORTB = mins/10;
                RA2 = 1;       
                mpx_cnt = 3;
           
            case 3:
                PORTB = mins%10;
                RA3 = 1;
                mpx_cnt = 0;
        }
   
        T0IF = 0;                //clear TMR0 interrupt flag   
}


void init_Timers(void)
{
    GIE = 0;               
   
    T0CS = 0;               
    PSA = 0;                                           
    PS2 = 0;              
    PS1 = 0;              
    PS0 = 0;

    T0IF = 0;               
    T0IE = 1;                  
    TMR0 = 6;                                                                                               
   
    GIE = 1;             
}

void main()
{
    TRISA = 0x00;
    TRISB &= ~0x0F;
    TRISB |= 0xF0;
   
    init_Timers();
   
    while(1);
}

---------------------------------------SOURCE CODE--------------------------------------------

Switch debounce circuit


 In most digital electronics projects that uses different kinds of switches, switch bounces are commonly encountered. These are extra glitches after the real switch operation. These are tiny pulses that affect the actual operation of the circuit like counters.

Here's a demo video of a switch bounce.


It is clearly seen that in certain push on the switch, the counting is not accurate. This is causee by the switch bounce. Here now is the image that shows switch bounces and a clean pulse.



As you can see in the top image, this is an image of a clean pulse without a switch bounce. On the other hand, below it, shows the bounces formed from switching.

The upper image use a circuit that is called switch debounce. A switch debounce can be software or hardware. We will create the latter.

The circuit below is a RS latch that is used as a switch debouncer. It's composed by two 2-input NAND gates with outputs feedbacks to the input of another. (other explation from malvino)

Pull-up and Pull-Down Resistor


Most of the beginners in digital electronics assume that the hanging input is a logic 0. Then, that's a misconception. They are neutral state which can be a logic 0 or a logic 1. This will bring chaos on your circuit operation.

To solve this problem, we add a pull-up and a pull-down resistor.

Below is an image of pull-up and a pull-down.



As you can see, in each case there is a default input. For a pull-up, the default input to the logic IC is 1. And for the pull-down, the logic is 0. The resistor also provide a current limiting function thus affecting power consumption of the input section. 10kohms is the commonly value but any value can be use depending on your application.

Simple magnitude comparator (7485 IC) Circuit


In designing logic circuit, it is sometimes necessary to compare values of two digital data. In this case, creating your own magnitude comparator can cause you more logic IC and can consume more time and money. This magnitude comparator IC might help you. It can compare two 4-bit data but can be cascaded to other magnitude comparator. It is the 7485 IC.

This 7485 magnitude comparator is one of my favorite logic ICs. This IC helped me a lot in my school projects specially on digital electronic games like chess, fight combat, etc. I usually use this chip in declaring the winner of having a higher score.

Here is a sample circuit.


Up/Down Counter Circuit

Counters are very common experiments on digital electronics subjects.

Here's a simple up/down counter that uses 74190.


This circuit is easy to implement and here are some of its features:

Presettable - having this capability, it is easy to use for down timers with initial value like 24second shot clock.
Parallel output(BCD) - its bcd output can be easily interface to a bcd-to-sevensegment decoders.
Ripple clock output - you can cascade many 74190 to form 2digit, 4digit and Xdigit counters.
Single input pin for up/down - in case that the requirement is to control the count in a single pin, this 74190 is very applicable.

Please note that you need a switch debouncer on the switch so that you can have a clean count..

Traffic Light Circuit usid 4017

This is a simple design of a traffic light project that uses 4017 IC. This circuit demonstrate a simple two traffic light. 

The clock source is not included in the diagram but you can use 555 astable circuit as an oscillator.

The time of switching of the lights are in proportions.

3/10 for green
2/10 for yellow 
5/10 for stop


In the schematic, a traffic light model was used in the simulation. But in the actual, you can implement it using LEDs.

Here is the schematic of the traffic light circuit:



This is a demo video:



Simple utility amplifier (using LM386)

Simple amplifiers are easy to build. Specially if you're using amplifier ICs.

Here is my simple utility amplifier. I used this on project development, etc.

This is not an advisable design but enough if you just want to hear louder sound from you coming input.







Here is the schematic.

Simple Light or Dark Activated Switch Circuit

This is a basic circuit that can be constructed by students.

It uses a transistor as a switch, LDR as the sensor, variable resistor for calibration, diode as a snubber and the relay as the switching component.


Latching Relay Circuit

Latching Relay Circuit

There are situations that we need to implement latching relay action. This can be implemented by connecting the relay pins to proper configuration with respect to the button and the power source. In this blog post, I will present the circuit/schematic and demo video simulation of a latching relay.

Here is the schematic:


The components in this circuit are:

1. 1 latching switch --> serves as the reset
2. 1 normally open switch --> acts as the trigger button
3. 1 diode(1n4001) --> snubber diode against kick voltage
4. 1 spdt 5v relay
5. 1 LED --> serves as the load
6. 1 330 ohm resistor --> current limiting

**The power source is operating in 5volts.

The circuit can also be triggered by logic ICs(TTL/CMOS) using proper interfacing method. I usually use another relay that serve as the trigger button when interfacing ICs to latching relay circuit.

Here is the demo video:

Latching Relay Circuit

There are situations that we need to implement latching relay action. This can be implemented by connecting the relay pins to proper configuration with respect to the button and the power source. In this blog post, I will present the circuit/schematic and demo video simulation of a latching relay.

Here is the schematic:


The components in this circuit are:

1. 1 latching switch --> serves as the reset
2. 1 normally open switch --> acts as the trigger button
3. 1 diode(1n4001) --> snubber diode against kick voltage
4. 1 spdt 5v relay
5. 1 LED --> serves as the load
6. 1 330 ohm resistor --> current limiting

**The power source is operating in 5volts.

The circuit can also be triggered by logic ICs(TTL/CMOS) using proper interfacing method. I usually use another relay that serve as the trigger button when interfacing ICs to latching relay circuit.

Here is the demo video:

Latching Relay Circuit

There are situations that we need to implement latching relay action. This can be implemented by connecting the relay pins to proper configuration with respect to the button and the power source. In this blog post, I will present the circuit/schematic and demo video simulation of a latching relay.

Here is the schematic:


The components in this circuit are:

1. 1 latching switch --> serves as the reset
2. 1 normally open switch --> acts as the trigger button
3. 1 diode(1n4001) --> snubber diode against kick voltage
4. 1 spdt 5v relay
5. 1 LED --> serves as the load
6. 1 330 ohm resistor --> current limiting

**The power source is operating in 5volts.

The circuit can also be triggered by logic ICs(TTL/CMOS) using proper interfacing method. I usually use another relay that serve as the trigger button when interfacing ICs to latching relay circuit.

Here is the demo video:





Simple Analog Comparator Circuit using lm311

This is one of the common circuit blocks being used both in digital and analog electronics. Its output is dependent on the relationship of its two input pins. One of the inputs is set to give the reference voltage while the other one is commonly connected to different sensors. If the reference voltage was overcome by the input connected to the sensor, the output of the comparator changes.

In this circuit, the we'll use an LDR.


The advantage of a comparator IC than an opamp used as an comparator is the property of IC comparators to be open collector output. Having this feature, we can set the output of the comparator beyond its biased voltage.

LED Dot Matrix pinout (pin config)


LED Dot Matrix.

Pinout for led dot matrix

 7x5 LED Matrix


 8x5 LED Matrix


 8x8 LED Matrix



Enjoy working on your LED Matrix!