Saturday, December 21, 2013

Beaglebone Black GPIO - 8x8 LED Matrix with C Program - Part3

STEP-4 : Setting up the Start-up Script and make active at boot-up

  • In order to work with device tree overlay what we have created in previous step, we need to write a start-up script.
  • The C code we are going to use is have some issues with GPIO ports like "Bus Error" when the compiled file is executed.
  • Based on this website the issue got resolved when we export one pin on each GPIO port. So this we need to add it on start-up script.
  • This start-up script will be executed every time the Beaglebone Black is started.
  •  Make a start-up script with the following steps:
       root@beaglebone:# vi /usr/bin/init_boot.sh
   
        Copy and Pase following lines in "init_boot.sh" file - Download

 #!/bin/bash
echo 5 > /sys/class/gpio/export

echo 33 > /sys/class/gpio/export

echo 65 > /sys/class/gpio/export

echo 115 > /sys/class/gpio/export

export SLOTS=/sys/devices/bone_capemgr.8/slots

echo GPIO-Test > $SLOTS

  • To save and exit the file press "Esc" type ":wq" and Enter.
  • Now start-up script is ready to make active at booting process.
  • To make start-up script active at booting process, make a service with the following lines:
      root@beaglebone:# vi /lib/systemd/init_boot.service

[Unit]
Description=Enable GPIO Pins
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/bin/init_boot.sh

[Install]
WantedBy=multi-user.target


  • To save and exit the file press "Esc" type ":wq" and Enter.
  • Make a symbolic link

    root@beaglebone:# cd /etc/systemd/system/
    
root@beaglebone:# ln /lib/systemd/init_boot.service init_boot.service

  • Make systemd take notice of it, activate the service immediately and enable the service to be started on boot-up
   root@beaglebone:# systemctl daemon-reload
  
root@beaglebone:# systemctl start init_boot.service   
   root@beaglebone:# systemctl enable init_boot.service
  • Now the start-up script is active.
  • To check whether start-up script is active restart the beaglebone black.
  • Run following commands:
    To check GPIO pins 5, 33, 65 & 115 are exported:
   root@beaglebone:# ls -al /sys/class/gpio

root@beaglebone:# ls -al /sys/class/gpio/total 0
drwxr-xr-x  2 root root    0 Jan  1 05:00 .
drwxr-xr-x 48 root root    0 Jan  1 05:00 ..
--w-------  1 root root 4096 Jan  1 05:00 export

lrwxrwxrwx  1 root root    0 Jan  1 11:30 gpio115 -> ../../devices/virtual/gpio/gpio115
lrwxrwxrwx  1 root root    0 Jan  1 11:30 gpio33 -> ../../devices/virtual/gpio/gpio33
lrwxrwxrwx  1 root root    0 Jan  1 11:30 gpio5 -> ../../devices/virtual/gpio/gpio5
lrwxrwxrwx  1 root root    0 Jan  1 11:30 gpio65 -> ../../devices/virtual/gpio/gpio65
lrwxrwxrwx  1 root root    0 Jan  1 05:00 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
lrwxrwxrwx  1 root root    0 Jan  1 05:00 gpiochip32 -> ../../devices/virtual/gpio/gpiochip32
lrwxrwxrwx  1 root root    0 Jan  1 05:00 gpiochip64 -> ../../devices/virtual/gpio/gpiochip64
lrwxrwxrwx  1 root root    0 Jan  1 05:00 gpiochip96 -> ../../devices/virtual/gpio/gpiochip96
--w-------  1 root root 4096 Jan  1 05:00 unexport

   To check the device tree overlay is loaded:
   root@beaglebone:# cat /sys/devices/bone_capemgr.8/slots

 root@beaglebone:/lib/firmware# cat $SLOTS
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,GPIO-Test

  • It is loaded on 7th slot. 
STEP-5 : Proceed for C code
  • Download C Coded from Here

Beaglebone Black GPIO - 8x8 LED Matrix with C Program - Part2


STEP-3 : Setting the Pin mux and enabling the pullup or pull-down resistors on Port_8
  • With the help of Device tree overlay we can set the pin mux and enable the pullup or pulldown resistors.
  • Make a device tree overlay file with the following code:
//---------File Name:GPIO-Test.dts---------------
/dts-v1/;
/plugin/;

/{
       compatible = "ti,beaglebone", "ti,beaglebone-black";
       part-number = "GPIO-Test";
       version = "00A0";

       fragment@0 {
             target = <&am33xx_pinmux>;
           
             __overlay__ {
                  pinctrl_test: GPIO_Test {
            pinctrl-single,pins = <

                0x018 0x07 // P8_3 38 OUTPUT MODE7 pulldown
                0x01c 0x07 // P8_4 39 OUTPUT MODE7 pulldown
                0x008 0x07 // P8_5 34 OUTPUT MODE7 pulldown
                0x00c 0x07 // P8_6 35 OUTPUT MODE7 pulldown
                0x090 0x07 // P8_7 66 OUTPUT MODE7 pulldown
                0x094 0x07 // P8_8 67 OUTPUT MODE7 pulldown
                0x09c 0x07 // P8_9 69 OUTPUT MODE7 pulldown
                0x098 0x07 // P8_10 68 OUTPUT MODE7 pulldown
              
                0x034 0x17 // P8_11 45 OUTPUT MODE7 pullup
                0x030 0x17 // P8_12 44 OUTPUT MODE7 pullup
                0x024 0x17 // P8_13 23 OUTPUT MODE7 pullup
                0x028 0x17 // P8_14 26 OUTPUT MODE7 pullup
                0x03c 0x17 // P8_15 47 OUTPUT MODE7 pullup
                0x038 0x17 // P8_16 46 OUTPUT MODE7 pullup
                0x02c 0x17 // P8_17 27 OUTPUT MODE7 pullup
                0x08c 0x17 // P8_18 65 OUTPUT MODE7 pullup
              
              
                      
                    /* OUTPUT  GPIO(mode7) 0x07 pulldown, 0x17 pullup, 0x?f no pullup/down */
                   /* INPUT   GPIO(mode7) 0x27 pulldown, 0x37 pullup, 0x?f no pullup/down */

            >;
          };
             };
       };

       fragment@1 {
        target = <&ocp>;
        __overlay__ {
            test_helper: helper {
                compatible = "bone-pinmux-helper";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_test>;
                status = "okay";
            };
        };
    };
};



  • Save file with is name "GPIO-Test.dts",
  • Compiling the overlay from .dts to .dtbo  
       root@beaglebone:# dtc -O dtb -o GPIO-Test-00A0.dtbo -b 0 -@ GPIO-Test.dts

  • Now you need to copy it to /lib/firmware so it can be found.
      root@beaglebone:# cp GPIO-Test-00A0.dtbo /lib/firmware
  • We need to define SLOTS to make it active
      root@beaglebone:# echo SLOTS=/sys/devices/bone_capemgr.8/slots
  •  Finally to make it active in SLOTS
      root@beaglebone:# echo GPIO-Test > $SLOTS
  • You can check with following command
 root@beaglebone:/lib/firmware# cat $SLOTS
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,GPIO-Test

  • It is loaded on 7th slot.
  • You can download HERE the file created by me
  • You can modify and make your own device tree overlay with this file "GPIO-Test.dts" (Open file in text editor like)
                                                     Further info  See Part3 - To be Continued

Thursday, December 19, 2013

Beaglebone Black GPIO - 8x8 LED Matrix with C Program - Part1

I made an 8x8 LED matrix circuit to work with GPIO pins on Beaglebone Black.

STEP-1 : Make LED matrix board with the following circuit:

Components Required:
1. Breadboard PCB or General PCB - 01
2. 3mm RED LED's - 64
3. 330 Ohms Resistors - 08
4. Male/Female Header - 01
5. Male/Female Jumper wires - 16
Note: If you don't want to make circuit you can use a standard 8x8 dot matrix module buy from local electronic shops or buy online.

Beaglebone Black: Connect all ROWS to Port_8 on  Pins 11 to 18 and all COLUMNS to Port_8 pins 3 to 10 using Jumper wires.

This application is tested on Beaglebone Black running Angstrom OS

Note: To use these GPIO pins you need to disable onboard emmc and HDMI port. 

STEP-2 :Disabling on-board emmc and HDMI port:
  • Connect Beaglebone Black to PC with USB cable. wait for storage media to initialize.
  • Go to My Computer and open "BEAGLEBONE" storage media.
  • Navigate the file "uEnv.txt" and open in text editor.
  • Paste this following line:  
 optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G 


  • Save & Close the file, restart Beaglebone
                                                                                                See Part2 - To be Continued

Tuesday, December 3, 2013

How to get the BeagleBone Black Drivers to work on Windows 8 computer

To install the drivers, the windows 8 computer needs to be restarted in the mode where it allows you to install unsigned drivers.

Here's a quick step-by-step guide:

1. Press win+c on the keyboard to bring up the charms side bar (or move mouse to right top corner of the screen)

2. Click the Settings button.

3. Click the Change PC Settings at the bottom of the sidebar.

4. On screen that shows up, select the General option from the sidebar then scroll down the page that appears.

5. Click the Restart now button under the Advanced startup section.

6. You will momentarily see the restarting screen, then it will switch to a blue screen titled "Choose an option"

7. Click the Troubleshoot button.

8. Click Advanced options.

9. Click Startup Settings

10. Click Restart

11. You should then see a Startup Settings screen after your computer reboots.

12. Press 7 or F7 on your keyboard to Disable driver signature enforcement

13. Now Windows 8 will continue starting up.

14. For Windows 8 64-bin: Log-in as normal, and then run BONE_D64.exe again (Click on Link to download)

15. For Windows 8 32-bin: Log-in as normal, and then run BONE_DRV.exe again (Click on Link to download)

16. Now you should see 4 warning dialogs about "unsigned driver installation", click OK for all of them.


Courtesy: elinux.org

Tuesday, July 19, 2011

Ultrasonic Position System

The ultrasonic position system uses ultrasonic transmitters/receivers to triangulate position of the robots used in GE423. Each of three transmitters uses a distinct frequencies: 23 kHz, 31 kHz, and 40 kHz. The 2812 DSP is used to measure signal timing and calculate position based on these values. The design of the electronics, as well as discussion of the software development is presented below.

The electronics were not intergrated with the 6713 DSP on the robot.
Note: To get around the issue of clock syncing, the robot will start in a known position, and calculate position for four cycles before proceeding. An alternative to this would be to add a fourth transmit frequency and use the 4th signal to sync the robot clock with the transmit clock.

1.0 Hardware

A wide variety of hardware was used for this project. The hardware was chosen based on availability and price. By no means is the solution presented "the best"or the only way to achieve the desired results, but it is a workable solution.

1.1 Ultrasonic Transmitters/Receivers

The ultrasonic sensor were purchased from Massa. The TR-89/B series where chosen because they come in 3 different frequencies, and they were stock parts. There is no pdf data sheet available on the Massa website, all information if available here. The main drawback of using Massa is there $500 minimum order, and the sensors aren't cheap at about ~$30 each.

1.2 Transmit Circuit

A schematic of the transmit circuit looks like:

Images of the perf-boarded transmit circuits:

Details on the components of the transmit circuit can be found in the subsection below:

1.2.1 Frequency Generation

The transmit circuit take from the Massa Website looks like:
Source:http://www.massa.com/datasheets/graphics/tr89_data.gif
Where R1 is a 10k 10 turn precision wound potentiometer, and U1 is a CD4039B NAND Schmitt Trigger. The tuning resistor R2 and L where left out to increase the transmit power around the base frequency. The potentiometer was adjusted until the frequency was the desired base frequency. A 1k resistor was added in parallel with the potentiometer to give a higher resolution. For the 40 kHz case, a smaller capacitor was required to reach the base frequency. Make sure to tune the circuit with the ultrasonic transducers attached, because the additional impedance will change the transmit frequency. The 12 Vdc was generated by a lab supply.
The output at point TP1, is a 12V peak to peak is a square wave at the desired frequency. The point TP1 was connected to the Driver Signal Circuit presented below.

1.2.2 555 Timer Circuit

The documentation for the 555 timer can be found here. An a picture of how it is wired can be 


 
seen below:
Source:http://www.williamson-labs.com/480_555.htm
Using the handy calculator for Ra, Rb, and C found here, Ra=100k ohm, Rb=200k ohm, and C=2.2 mircoF.

1.2.3 Driver Signal Circuit

The 35 Vdc supply is manufactured by Ultravolt, part number 1/4Aa24-P30. This supply is actually a 0-250 Vdc supply that uses a potentiometer to control voltage output.. The transistor used is an IRF520 n-channel MOSFET.

1.3 Receive Circuit

A block diagram of the receive circuit can be seen below:

And a picture of the perf-boarded receive circuit can be seen below:

Details on the components of the receive circuit can be found in the subsection below:


1.3.1 Low Signal Amp Circuit

An instrumentation amplifier made by Analog Devices was used to amplify the low signal output of the ultrasonic receivers. The actual part used was the AD620, one is recquired for each receive channel. Analog has a nice tool here, to size the gain resistor, Rg. Based on experiments, a gain value of 33 was chosen, resulting in a Rg of 1.5k ohm. The AD620 was wired as follows:
Source:http://www.analog.com/images/Product_Descriptions/3888333375812882340AD620_fbs.gif

1.3.2 Comparator Circuit

The analog comparitor used was part number LM339. The volatage divdier was powered using +5 Vdc to creat the digital level output signal. The output from each instrumentation amplifier was wired to the "+" terminal, and the "-" was wired to 3 volts. The 3 Vdc signal was created from the +15 Vdc supply using a voltage divider. The output of the comparitor was wired to a 5 Vdc via a 3k resistor.

2.0 Software

The timing of the hardware interrupts from the 2811 is calculated, and from the times, position is calculated in the 2D plane using a combination of least squared fit and Jacobian iteration.

2.1 Matlab Triangulation Code

The first algorithm was developed using Matlab. This code can be found here. The algorithm is not stable for all input parameters, a good set of test conditions are:
[x,y]=blah(.010,.012,.012)
[x,y]=blah(.009,.014,.012)
[x,y]=blah(.011,.011,.011)
Note the highly descriptive function named blah

2.2 DSP C Code

The c code for the 2812 DSP is in the attached zip file. The code works as following:
  1. Hardware interrupt pin get triggered
  2. Record absolute clock time when pin transition occurs
  3. Go back to step 1,and once all three pins have been triggered:
    1. (only do this step the first time through the code) Assume robot stationary, acquire base transmit period for each frequency by averaging first 4 values, this step syncs the clocks of the transmitters to the robot
    2. Calculate time from transmitter to robot for each frequency
    3. Triangulate position of robot using least squared fit to data points
    4. Wait for fixed amount of time, ignore hardware interrupts during this time because of the nature of the transmit signal
    5. Go back to Step 1

3.0 Lessons Learned

  1. A resistor was needed in parallel with the tuning potentiometer to give better resolution
  2. A resistor was required in parallel with the US transmitter for the circuit to function because the transmitter is like a capacitor.

4.0 Acknowledgments

Various people and online resources aided in this project:
  • GE423 Lab Instructor: Dan Block
  • GE423 TAs: Dave Johnson, Daniel Herring
  • My officemate: Steve Tschopp
  • Misc. Consultation: Tim Cargol
  • Misc Websites:
    • http://ourworld.compuserve.com/homepages/Bill_Bowden/555.htm
    • http://www.williamson-labs.com/480_555.htm
    • http://www.massa.com
    • http://www.digikey.com (source for datasheets)

Car Wireless Alarm Circuit Diagram

This FM radio-controlled anti- annexation anxiety can be acclimated with any agent accepting 6- to 12-volt DC accumulation system. The mini VHF, FM transmitter is adapted in the agent at night back it is anchored in the car balustrade or car park. The receiver assemblage with CXA1019, a distinct IC-based FM radio module, which is advisedly accessible in the bazaar at reasonable rate, is kept inside. Receiver is acquainted to the transmitter's frequency. Back the transmitter is on and the signals are actuality accustomed by FM radio receiver, no hissing babble is accessible at the achievement of receiver.


Appropriately transistor T2 (BC548) does not conduct. This after-effects in the broadcast disciplinarian transistor T3 accepting its advanced abject bent via 10k resistor R5 and the broadcast gets energised. Back an burglar tries to drive the car and takes it a few metres abroad from the car porch, the radio articulation amid the car (transmitter) and anxiety (receiver) is broken. As a aftereffect FM radio bore gene-rates hissing noise. Hissing AC signals are accompanying to broadcast switching circ- uit via audio transformer. These AC signals are rectified and filtered by diode D1 and capacitor C8, and the consistent absolute DC voltage provides a advanced bent to transistor T2.

Appropriately transistor T2 conducts, and it pulls the abject of broadcast disciplinarian transistor T3 to arena level. The broadcast appropriately gets de-activated and the anxiety affiliated via N/C contacts of broadcast is switched on. If, by chance, the burglar finds out about the wireless anxiety and disconnects the transmitter from battery, still alien anxiety charcoal activated because in the absence of signal, the receiver continues to aftermath hissing babble at its output. So the burglar anxiety is fool-proof and awful reliable.

Hot Water Level Indicator

Notes:
Save fuel bills and the economy of the planet with this circuit. SW1 is a normally open press button switch which allows you to view the level of hot water in a hot water tank. When pressed the voltage difference at the junction of the thermistor and preset is compared to the fixed voltage on the op-amps non-inverting input. Depending on the heat of the water in the tank, the thermistors resistance will toggle the op-amp output to swing to almost full voltage supply and light the appropriate LED.
Construction:
Masking tape was used to stick the bead thermistors to the tank. Wires were soldered and insulated at the thermistors ends. A plastic box was used to house the circuit. Battery life will probably be 4 to 5 years depending on how often you use the push switch, SW1.
Sensor Placement:
Thermistors NTC1-4 should be spread evenly over the height of the tank. I placed NTC1 roughly 4 inches from the top of my tank and the others were spaced evenly across the height of the hot water tank. As hot water rises the lowest sensor indicates the fullest height of hot water and should be about 8 to 10 inches from the bottom of the tank.
Calibration:
With a full tank of hot water adjust P1-4 so that all LED's are lit. As hot water rises, the sensor at the bottom of the tank will be the maximum level of hot water. "Hot" can be translated as 50C to 80C the presets P1-4 allow adjustment of this range.
Parts:
I have used a quad version of the LM324 but any quad opamp can be used or even four single op-amps.
R2-R5 I used 330ohm resistors, but value is not critical. Lower values give brighter LED output.
NTC1-4 The thermistors maximum resistance must roughly equal the resistance of the fixed resistor and preset. As negative temparature coefficient (NTC) thermistors are used, then their resistance decreases for increases in temperature. I used a thermistor from the Maplin Catalogue. Cold resistance was around 300K, hot resistance 15k. Alternative thermistors may be used with different resistance ranges, but the presets P1 to P4 must also be changed as well.
R7-10 series resistance, only required if your thermistors resistance is several ohms at the hottest temperature.
P1 - P4 Chosen to match the resistance of the thermistor when cold.
R1 & R6. These resistors are equal and bias the op-amp inverting input to half the supply voltage. I used 100k.

Water Level Indicator Alarm


This ambit not alone indicates the bulk of baptize present in the aerial catchbasin but additionally gives an anxiety back the catchbasin is full.
The ambit uses the broadly accessible CD4066, mutual about-face CMOS IC to announce the baptize akin through LEDs.
When the baptize is abandoned the affairs in the catchbasin are accessible circuited and the 180K resistors pulls the about-face low appropriately aperture the about-face and LEDs are OFF. As the baptize starts bushing up, aboriginal the wire in the catchbasin affiliated to S1 and the + accumulation are shorted by water. This closes the about-face S1 and turns the LED1 ON. As the baptize continues to ample the tank, the LEDs2 , 3 and 4 ablaze up gradually.
The no. of levels of adumbration can be added to 8 if 2 CD4066 ICs are acclimated in a agnate fashion.
When the baptize is full, the abject of the transistor BC148 is pulled aerial by the baptize and this saturates the transistor, axis the buzzer ON. The SPST about-face has to be opened to about-face the buzzer OFF.
Remember to about-face the about-face ON while pumping baptize contrarily the buzzer will not sound!

Sunday, March 27, 2011

Electronic mosquito repeller using CD4047


Description.
Here is the circuit diagram of an ultrasonic mosquito repeller.The circuit is based on the theory that insects like mosquito can be repelled by using sound frequencies in the ultrasonic (above 20KHz) range.The circuit is nothing but a PLL IC CMOS 4047 wired as an oscillator working at 22KHz.A complementary symmetry amplifier consisting of four transistor is used to amplify the sound.The piezo buzzer converts the output of amplifier to ultrasonic sound that can be heard by the insects.

Circuit diagram with Parts list.

Notes.
Assemble the circuit on a general purpose PCB.
The circuit can be powered from 12V DC.
The buzzer can be any general purpose piezo buzzer.
The IC1 must be mounted on a holder.

Electronic Mosquito Repeller Circuit


This circuit produces a tone above the human audible range and this is supposed to keep the mosquitoes away. You need a piezo diaphragm that will respond to 15kHz and these are very difficult to find. 

This electronic mosquito repellent schematic circuit diagram based on the 555 timer IC is a simple and useful mosquito repellent circuit . This mosquito repeller circuit generate an ultrasonic sound with a high output frequency that  allows spreading mosquitoes within a wide radius . The circuit is quite simple and require few external components . The oscillation frequency is given by the value of the R1, R2 and C1 components and can be modified changing the value of components or replacing the R2 fixed resistor with a variable resistor ( potentiometer ) .
The actual oscillation frequency of this electronic mosquito repeller circuit is around 45 KHz ( 46.5 KHz) so you need to use a good high frequency speaker , you can use a piezo speaker .

The circuit can be supplied from a 9 V DC power supply  . This repeller circuit can be used for almost any animal , it works on  : cats , dogs , rats  . Even if you don’t hear the sound generated by device don’t worry  because the high frequency is less audible by the human ear .

60W inverter using transistors


Description.
Here is the circuit diagram of a fully transistorized inverter that can drive up to 60W loads. Transistors Q1 and Q2 forms a 50Hz astable multivibrator. The output from the collector of Q2 is connected to the input of the Darlington pair formed by Q3 and Q4.Similarly the output of Q1 is coupled to the input of the pair Q5 and Q6. The output from the Darlington pairs drive the final output transistors Q7 and Q8 which are wired in the push pull configuration to drive the output transformer.
Circuit diagram.


Notes.
The circuit can be assembled on a vero board.
T1 can be a 230V primary to 9-0-9V, 6A secondary transformer.
Transistors Q4, Q6, Q7 and Q8 must be fitted with heat sinks.
Use a 12V, 7Ah battery for powering the inverter.
Slight adjustments can be made on the value of R3 and R4 to get exact 50Hz output.

Simple 100W inverter circuit


Description.
Here is the circuit diagram of a simple 100 watt inverter using IC CD4047 and MOSFET IRF540. The circuit is simple low cost and can be even assembled on a veroboard.

CD 4047 is a low power CMOS astable/monostable multivibrator IC. Here it is wired as an astable multivibrator producing two pulse  trains of 0.01s which are 180 degree out of phase at the pins 10 and 11 of the IC. Pin 10 is connected to the gate of Q1 and pin 11 is connected to the gate of Q2. Resistors R3 and R4 prevents the loading of the IC by the respective MOSFETs. When pin 10 is high Q1 conducts and  current flows through the upper half of the transformer primary which accounts for the positive half of the output AC voltage. When pin 11 is high Q2 conducts and  current flows through the lower half of the transformer primary in opposite direction and it accounts for the negative half of the output AC voltage.

Circuit diagram.
Notes.
B1 can be  a 12V/ 6Ah lead acid battery.
Q1 and Q2 must be fitted to a proper heat sink.
T1 can be a 9-0-9 V primary, 230V secondary, 150VA transformer .
Do not expect much from this circuit. The is very simple one suitable for low grade applications.

How to make an Inverter- Simple 40 Watt Inverter


How to make an Inverter

Description:This is the schematic of a simple 40W , 12 volts to 220 Volts inverter.You don’t believe, this is simple and cheap and working for me for last 4 years.The heart of the circuit is a CD 4047 IC which is wired as an astable multi vibrator here.Resistance and Capacitance at pin 1&2 determines the out put frequency.Here it is set to 60Hz.Due to this a two 180 degree out of phase ,120 Hz , 50% duty cycle waveforms will appear at pin 10 & 11.These waves are amplified by the complementary symmetry amplifier made of transistors BC 337 & TIP 3055 to drive the out put transformer.Don’t get feared of the technical terms, just wire it on a all purpose PCB.It is simple and will work.Don’t worry about the transformer windings ,buy a 220-110-0 primary,12-0-12 secondary , <50W transformer.You can select output voltage of 110V or 220V by a two way switch using such a transformer.Don’t worry if you don’t have such a transformer, a simple 220 to 12-0-12 will also do the trick sacrificing the 110V option or vice versa.The best way to get a transformer is to break all useless electronic devices in your trash.Most probably you will find the transformer or more components needed here!

Simple Inverter Circuit Diagram:


Tips : First wire to oscillator part only.Then check out put Pin 10 &11 of CD4047 to obtain the required wave forms ( two 120Hz ,180 degree out of phase,50% duty cycle waves. Then connect transistors ,transformer and load (25 W bulb for test).See it working!.

555 Timer IC Pin configuration



The 555 Timer IC is available as an 8-pin metal can, an 8-pin mini DIP (dual-in-package) or a 14-pin DIP.
This IC consists of 23 transistors, 2 diodes and 16 resistors. The explanation of terminals coming out of the 555 timer IC is as follows. The pin number used in the following discussion refers to the 8-pin DIP and 8-pin metal can packages.



Pin 1: Grounded Terminal. All the voltages are meas­ured with respect to this terminal.
Pin 2: Trigger Terminal. This pin is an inverting input to a comparator that is responsible for transition of flip-flop from set to reset. The output of the timer depends on the amplitude of the external trigger pulse applied to this pin.
Pin 3: Output Terminal. Output of the timer is avail­able at this pin. There are two ways in which a load can be connected to the output terminal either between pin 3 and ground pin (pin 1) or between pin 3 and supply pin (pin 8). The load connected between pin 3 and ground
supply pin is called the normally on load and that connected between pin 3 and ground pin is called the normally off load.
Pin 4: Reset Terminal. To disable or reset the timer a negative pulse is applied to this pin due to which it is referred to as reset terminal. When this pin is not to be used for reset purpose, it should be connected to + VCC to avoid any possibility of false triggering.
Pin 5: Control Voltage Terminal. The function of this terminal is to control the threshold and trigger levels. Thus either the external voltage or a pot connected to this pin determines the pulse width of the output waveform. The external voltage applied to this pin can also be used to modulate the output waveform. When this pin is not used, it should be connected to ground through a 0.01 micro Farad to avoid any noise problem.
Pin 6: Threshold Terminal. This is the non-inverting input terminal of comparator 1, which compares the voltage applied to the terminal with a reference voltage of 2/3 VCC. The amplitude of voltage applied to this terminal is responsible for the set state of flip-flop.
Pin 7 : Discharge Terminal. This pin is connected internally to the collector of transistor and mostly a capacitor is connected between this terminal and ground. It is called discharge terminal because when transistor saturates, capacitor discharges through the transistor. When the transistor is cut-off, the capacitor charges at a rate determined by the external resistor and capacitor.
Pin 8: Supply Terminal. A supply voltage of + 5 V to + 18 V is applied to this terminal with respect to ground (pin 1).

555 Timer IC Working Principle

Block Diagram of 555 timer IC:

Comparator 1 has a threshold input (pin 6) and a control input (pin 5). In most applications, the control input is not used, so that the control voltage equals +2/3 VCC. Output of this comparator is applied to set (S) input of the flip-flop. Whenever the threshold voltage exceeds the control voltage, comparator 1 will set the flip-flop and its output is high. A high output from the flip-flop saturates the discharge transistor and discharge the capacitor connected externally to pin 7. The complementary signal out of the flip-flop goes to pin 3, the output. The output available at pin 3 is low. These conditions will prevail until comparator 2 triggers the flip-flop. Even if the voltage at the threshold input falls below 2/3 VCC, that is comparator 1 cannot cause the flip-flop to change again. It means that the comparator 1 can only force the flip-flop’s output high.
To change the output of flip-flop to low, the voltage at the trigger input must fall below + 1/3 Vcc. When this occurs, comparator 2 triggers the flip-flop, forcing its output low. The low output from the flip-flop turns the discharge transistor off and forces the power amplifier to output a high. These conditions will continue independent of the voltage on the trigger input. Comparator 2 can only cause the flip-flop to output low.
From the above discussion it is concluded that for the having low output from the timer 555, the voltage on the threshold input must exceed the control voltage or + 2/3 VCC. They also turn the discharge transistor on. To force the output from the timer high, the voltage on the trigger input must drop below +1/3 VCC. This also turns the discharge transistor off.
A voltage may be applied to the control input to change the levels at which the switching occurs. When not in use, a 0.01 nano Farad capacitor should be connected between pin 5 and ground to prevent noise coupled onto this pin from causing false triggering.
Connecting the reset (pin 4) to a logic low will place a high on the output of flip-flop. The discharge transistor will go on and the power amplifier will output a low. This condition will continue until reset is taken high. This allows synchronization or resetting of the circuit’s operation. When not in use, reset should be tied to +VCC.