Translator

Smart ToyCar


Smart ToyCar:

MikroC Code For Reciver:
//PIC16F877A
//12MHz

float reading=0 , act_reading=0, volt=0;

void Get_Volt(void)
{
                 adcon1=0b0000;
                 delay_ms(50);
                 reading=Adc_Read(0);
                 act_reading=(reading*5)/1024;
                 volt=act_reading*2.25;       //volt_in

}

void Tone() //horn
   {
      Sound_Play(500, 10);

   }
void Tone_back()
   {
      Sound_Play(2000, 300);
      delay_ms(200);
   }

void main()
{
    TRISA = 0xFF;
    porta = 0x00;
    TRISC = 0x00;        // PORT B as output port
    portc = 0x00;         // Set RB0 to high
    TRISD = 0xDF;
    portd = 0x00;
    TRISB = 0x00;
    portb = 0x00;

    Sound_Init(&PORTC, 7);  //sound Initialization

  while(1)
   {
       if(portd.f4=1)
       {
                PORTC.F0=0;
                PORTC.F1=0;
                PORTC.F2=0;
                PORTC.F3=0;
                PORTC.F5 = 0;
                PORTC.F6 = 0;
                //Charge
                Get_Volt(void);
                if(volt>9)
                {
                 portd.f5=1;
                }
                else portd.f5=0;
               
       }
      
      
      
       else
        {
                 portd.f5=0;
                  //headlight
                 if(portd.f6==1)            portc.f4 = 1;
                 else                       portc.f4 = 0;

                //forward
                if(portd.f0==1 && portd.f2==0 && portd.f3==0)
                {
                  PORTC.F0 = 1;
                  PORTC.F1 = 0;
                  PORTC.F2 = 1;
                  PORTC.F3 = 0;
                  PORTC.F5 = 0;
                  PORTC.F6 = 0;
                  portb.f0=0;
                  portb.f1=1;

                }
                //backward
                if(portd.f1==1 && portd.f2==0 && portd.f3==0)
                {
                  PORTC.F0 = 0;
                  PORTC.F1 = 1;
                  PORTC.F2 = 0;
                  PORTC.F3 = 1;
                  PORTC.F5 = 1;
                  PORTC.F6 = 1;
                  portb.f0=1;
                  portb.f1=0;
                 
                  Tone_back();
                }
                //right
                if(portd.f2==1)
                {
                  PORTC.F0 = 0;
                  PORTC.F1 = 1;
                  PORTC.F2 = 1;
                  PORTC.F3 = 0;
                  PORTC.F5 = 0;
                  PORTC.F6 = 1;
                    portb.f0=1;
                  portb.f1=0;
                  Tone_back();
                }
                //left
                if(portd.f3==1)
                {
                  PORTC.F0 = 1;
                  PORTC.F1 = 0;
                  PORTC.F2 = 0;
                  PORTC.F3 = 1;
                  PORTC.F5 = 1;
                  PORTC.F6 = 0;
                    portb.f0=1;
                  portb.f1=0;
                  Tone_back();
                }

                //To Stop motor
                 if(portd.f0==0 && portd.f1==0 && portd.f2==0 && portd.f3==0)
                {
                PORTC.F0=0;
                PORTC.F1=0;
                PORTC.F2=0;
                PORTC.F3=0;
                PORTC.F5 = 0;
                PORTC.F6 = 0;
                }

                //horn
                if(portd.f7==1)
                     Tone();
         }
        
   }

}






MikroC Code for Transmitter:

 // PIC16F73 X-TAL= 8MHz
 float reading=0 , act_reading=0;
 float volt=0;

void Get_Volt(void);

void Tone()  //volt
    {
      Sound_Play(3500, 20);
      delay_ms(100);
    }

void main()
{
  TRISA = 1;
  TRISB = 0;
  TRISC = 0x00;
  PORTB = 0;



  UART1_Init(9600); // Initialize UART module at 9600bps
  Delay_ms(100); // Wait for UART module to stabilize

  Sound_Init(&PORTC, 0);  //Sound initialization

  while (1)
  { // Endless loop

       UART1_Write(portb); //send data via UART
       Delay_ms(500);
       Get_Volt(void);
       if(volt>=4.95)
       {
       portc.f1=1;
       Tone();
       }
       else
       portc.f1=0;
  }
}

void Get_Volt(void)
        {
                 adcon1=0b000;
                 delay_ms(50);
                 reading=Adc_Read(0);
                 act_reading=(reading*20.11)/1024;
                 volt=act_reading;
        }

500w 12v to 230v inverter circuit diagram



D313=2SD313

Touch controlled musical bell

Description.
This circuit produces a musical tone whenever someone touches the touch point designated as TP in the circuit. The circuit works from two AA cells and produces enough sound.
The circuit uses IC UM 3481 commonly used in musical circuits. The IC contains a ROM with 512 musical notes, tone generator, rhythm generator, modulator, run off control, oscillators, frequency divider and preamplifiers,.  So a very few number of components is  required for this circuit.C1 and R1 act as  the timing components for  the built in oscillator. The transistor Q1 is used for driving the loud speaker. The base of the transistor Q2 is used as the touch point to trigger the musical bell.

Circuit diagram with Parts list.
touch-controlled-musical-bell-circuit

Notes.

  • The circuit can be assembled on a general purpose PCB.
  • Use two AA cells in series for powering the circuit.
  • The speaker can be 2 W, 8 Ohm.

Latest Touch Alarm System circuit schematic


Touch Alarm circuit is widely used for security, which is installed on the door. The advantages of this alarm is because the cost is cheap and difficult to detect by burglars / intruders. The following is an example of a touch of alarm circuit which is designed by Tony Van Roon.

 Components List:

R1 = 100K
R2 = 56K
R3 = 10M
R4 = 220K
P1 = 100K
D1 = 1N4004


T1 = 2N3904, or equivalent
U1 = 555 Timer*
C1 = 47μF/16V**
C2 = 33μF/16V**
Re1 = Relay***
Notes:
*The 555 can be a LM, NE, or MC(cmos) type, they’re all pin-compatible.
**C1/C2′s operating voltage should be elevated to 25V if you decide to go with a 12V energy source. Rule of thumb: the operating voltage of capacitors are at least double the supplied voltage, in other words, if the powersource is 9Volt, your capacitor(s) is a minimum of 18V. Transistor T1 could be any approximate substitute.
*** Use any suitable relay for the project and if you are not tight on area, use any size. I’ve develop this specific circuit to prevent students from fiddling using the security cameras in pc labs in the University I’m employed. I made certain the metal casing was not grounded. But as the schematic shows you can essentially hook it as much as any type of metal surface. I utilized a 12-vdc power adapter. Use any appropriate relay to handle your requirements. A ‘RESET’ switch (Usually Closed) can be added between the constructive and the ‘arrow-with-the-+’. The trigger (touch) wire is connected to pin 2 of the 555 and will trigger the relay, utilizing the body resistance, when touched. It is apparent that the ‘touching’ component has to be clean and can make good get in touch with with the trigger wire. This particular circuit may not be suitable for all applications. Just in case you wonder why pin 5 isn’t listed within the schematic diagram; it isn’t truly required. In certain noisy conditions a little ceramic capacitor is placed in between pin 5 and ground. It does no harm to add one or leave it out.