2017年4月28日星期五

Microchip 8bit MCUs get up to 128kbyte flash

Microchip’s PIC18F ‘K42’ microcontrollers are available with up to 128kbyte (from 16kbyte) of flash memory in packages from 28-48 pins. Max clock speed is 64Mbit/s and there is up to 1kbyte data EEPROM and 8kbyte of SRAM.
The firm has gone big on its ‘core independent peripherals’ (CIP) to allow functions to be implemented in hardware, saving code, validation time, core overhead, and power consumption, said Microchip.
Microchip PIC18(L)F24-25K42
Intended for automotive, industrial control, IoT, medical and white goods, they include peripherals for safety critical applications including cyclic redundancy check with memory scan, a windowed watchdog timer, a 24bit signal measurement timer and a hardware limit timer, as well as up to eight hardware PWMs, complementary waveform generation for power bridges, and multiple communications interfaces.
Analogue peripherals including a zero crossing detector, constant current I/O (see below), a comparator, and a 12bit ADC with computation – the latter for automating capacitive voltage division (for touch sensing), averaging, filtering, over-sampling, and threshold comparison.
Constant current I/O
The constant current I/O feature allows the sink and source current of a pin to be set to 1, 2, 5 or 10mA. This has to be used with caution because the pin circuitry cannot dissipate much static power, so an “external resistor must be inserted in series with the load to dissipate most of the power,” said Microchip.
It has an example, with a 5V rail and a load which needs 1mA and whose voltage drop can be between 1.0 and 1.5V. The external resistor and pin circuitry has to make up 3.5-4V difference, so the resistor  needs to be chosen to drop 3.5V at of 1 mA, said Microchip, then the pin can make up the 0-500mV variable difference.
A ‘memory access partition’ supports data protection and bootloading, and the ‘device information area’ is a dedicated memory space for factory programmed device ID and peripheral calibration values.
Building blocks
  • ADC with computation
  • zero crossing detector
  • 10bit PMW
  • complementary waveform generator
  • numerically controlled oscillator
  • data signal modulator
  • hardware limit timer
  • 24bit signal measurement timer
  • configurable logic cell
  • crc/scan module
  • windowed watchdog timer
  • peripheral pin select
  • direct memory access
  • temperature indicator
  • data signal modulator
  • 5bit DAC
  • UART, SPI, and I2C

2017年4月20日星期四

lm386 amp Audio Amplifier

LM386 IC Audio sound Amplifier home made schematic and circuit diagram

Small Audio amp using LM 386 IC

This is simple and Small Audio power Amplifier project that you can make at home easily. We will make this project using a Small lm386 IC which is a 8 pin IC. You can make your own tiny simple amplifier using this lm386 IC. Due to its small size lm386 is perfect for various projects like radio amp, tiny Guitar amp amplifier.
It supports various range of supply voltage, 4V - 12V or 5V - 18V. The Audio amplification Gain can be adjusted. You can find the schematic and other additional components below. If you are planning on some hobbyist projects which includes sound systems, then amplification can be handled by this lm386 audio amp. There are many schematics available on internet based on lm386, so you can change the components based on your requirements in the schematic.
The gain is adjusted with a potentiometer. You will need an external power supply for this amplifier. Since the voltage supply can be in between 5V - 18V so you can use batteries.
This schematic was given to me by my professor, while working on an audio system in lab for some project long time ago. Hence I am sharing with you. Please don’t mind for my hand drawn model of this amplifier schematic.

Requirements for Amplifier

ComponentsValueQuantityNotes
Resistance22K1-
Resistance1R51-
Capacitor10uf1Between Pin 1 and 8
Capacitor100n1-
Capacitor330u2-
ICLM3861Amplifier

lm386 schematic for Audio Amplifier

lm386 Amplifier Schematic and Circuit Diagram






Schematic for lm386 small amp Audio

lm386 pin diagram

lm386 pin diagram for amplifier

 







lm386 on breadboard

lm386 amp audio amplifier circuit
Power amplifiers are something which converts low voltage input to high voltage output; hence this audio amplifier amplifies the low voltage audio into high output. During my college days I wanted to make a small audio power amp that you can put in your pocket and tune up sound in headphone hence I used this IC. For more specifications on lm386 you can refer the data sheet. A short Google on lm386 must let you to various data sheets for the same. Please refer the lm386 data sheet before changing components.
The voltage gain can be adjusted by adding a potentiometer across pin 1 and 8. Choose the speakers according to your requirement. I suggest keep gain to as low as zero when you done with schematic and then gradually tune up the potentiometer to avoid the speakers to damage. (if speakers you choose are not powerful enough). A pretty powerful amp with a low voltage battery.
PS: Just in case if you are doubtful then, pin 7 is unused pin in the IC.

lm 386 amplifier small project for audiolm 386 amplifier project picture circuit





lm 386 Audio Amplifier project
Thanks for reading

2017年4月18日星期二

Utility Power Supply

This is a standard bench power supply for prototyping electronic circuits.
Its main feature is a selection of outputs at standard fixed voltages used in electronics. Because the outputs are fixed you do not have to worry if the voltage is correct, you just plug the wire in. It is quick and easy to use.
You will probably still need a conventional variable power supply to test circuits over a range of voltages - but this is the one that you will use for day-to-day development.
It features four fixed outputs with an overall 1 amp capacity:
  • +5V and +3.3V
  • +9V or +12V or +15V
  • -9V or -12V or -15V
Design Criteria
This power supply was intended to be straight forward and easy to use without controls that needed to be adjusted. It should supply all the standard voltages commonly used in electronic circuits at 500mA or more.
Description
The power supply offers two fixed outputs of 3.3V and 5V, and two other voltages (plus/minus 9V, 12V or 15V) which are selected by the toggle switch.
All are referenced to the black common terminal.
The outputs are enabled by the output switch. This instantaneously disconnects the output, compared to the power switch, which, when turned off, can leave the outputs powered for some seconds due to the charge in the filter capacitors.
The Design
The circuit was designed around the LM317 and LM337 three terminal regulators. These are simple, rugged and used in many such power supplies.
The only downside is that there is no provision for current limiting... in the event of a short or something similar going wrong this power supply will attempt to drive 1.5 amps through your test circuit. Current limiting was left out because it would be difficult to properly implement and it would result in something that had to be adjusted - which was just what this project was trying to avoid.
Standard range fixed resistors are used to set the output voltages, and because of this careful attention given was to ensure that the values selected gave an result that was as close as possible to the desired voltage. In this design the maximum error due to the values of the resistors chosen is 0.89% and in most cases it is less than 0.5%. These resistors are specified as 1% tolerance and the LM317 and LM337 regulators have a tolerance of 1% also. So, the maximum error would be the sum of these (ie, 3%), but in most cases would be somewhat less. This is much better than the standard tolerance for these voltages which is 5%.
In the prototype the 3.3V output actually produced 3.299V, an error of 0.03% (close to the error of the measuring DMM). The 5V output actually produced 4.994V or an error of 0.12%.
Variable resistors could have been used to trim the output voltage to a precise value but, given the results, that would have been unnecessary and would have introduced a source of unreliability.
Schematic
This schematic is also available from the download section at the end of this page.
The circuit is reasonably conventional. The two diodes around each regulator are there to protect the regulator from unusual events such as the output being connected to a negative or higher voltage.
No specialised components are used, the voltage select switch (+/- 9/12/15V) is a center off switch with three positions. All resistors (with the exception of the current limiting resistors for the LEDs) should be 1% metal film.
The +5V and +3.3V regulators take their input from the output of the regulator which supplies the +9/12/15 volts. The reason for this is to spread the heat dissipation involved in supplying a low voltage like 3.3V across two regulators rather than one. For example, when the top regulator is set to 12V and the 3.3V regulator is supplying 1 amp both the regulators will be dissipating approx 9 watts. Whereas, if one regulator was used to supply 3.3V from the 21V supply the dissipation in that one regulator would be almost 18 watts.
Construction
The power supply was built into a small bench case with each regulator and its associated components assembled on small pieces of veroboard. The regulators were bolted onto a heatsink and the veroboard that they were attached to were simply supported by the legs of the regulators. The power supply was so simple that nothing more sophisticated than that was required.
Each regulator must be attached to a substantial heatsink. If a single heatsink is used then it should be of reasonable size as it could be called on to dissipate up to 20 watts. Typically a heatsink with less than 2.5 degrees per watt should be selected. For example, Altronics H0574 or Jaycar HH-8570. Note that insulating grommets, mica shims and heat conducting grease should be used to electrically isolate the mounting tab of each regulator from the heatsink and each other.
If separate heatsinks are used for each regulator then less than 5 degrees per watt heatsinks should be used. Also, insulating hardware is not needed if the heatsinks are electricially isolated from each other (e.g. attached to the plastic case).
The front panel was made by designing the panel in Visio and printing the output onto paper with a sticky backing that was suitable for laser printers. This printout was trimmed and stuck onto the drilled front panel. Finally a layer of clear sticky film (often used to protect book covers) was stuck over the paper and trimmed to size.

2017年4月14日星期五

Easy High Voltage Power Supply

Easy High Voltage Power Supply
This article will walk you through making a High Voltage Power supply .
Before attempting this project, be aware of some simple Safety Precautions.
1. Always Wear electrical gloves when handling the High Voltage Power supply.
2. The Voltage produced by this Power supply is not lethal, but can be damaging.So it is advisable to keep one hand in your pocket,or behind you while using it.(especially if you ignored Precaution #1).
3. Flyback transformers tend to hold charge for days after powered off, so always make sure to discharge(mentioned later on) it before touching the output wires.
Finally,i am not responsible for whatever damage(if caused) by this project to you.
PLEASE GO THROUGH THE ENTIRE INSTRUCTABLE BEFORE ATTEMPTING THE PROJECT.

Step 1: Gather the Materials

Gather the Materials
MATERIALS REQUIRED:
1. Flyback Transformer
You can get this from any CRT TV or Monitor.Be careful while removing it,as it can hold a charge for days after it is powered off.(precaution #3)
Alternatively,you can also buy it online, but it is rather expensive.(at least 20$)
2. Electronic Ballast
you can get this in a traditional tube light set.
You can also buy this online ,but make sure it is suitable for your country's power outlet.
3. Electrical plug with wire
you need this to connect your power supply to the power outlet of your house.
you can make one with a plug head and some wire,or buy it online.
4.Electrical tape(black and yellow)
you need colored tape only for the decoration part, but you need to have it for insulation.
TOOLS REQUIRED:
1.Soldering Iron
you may be able to manage without one,but it is highly recommended.
You need to be able to measure resistance to find out the primary coil of your flyback transformer.
3.Wire strippers and other common tools
you will need some common tools like screwdrivers and pliers.

Step 2: Identification

Identification
IDENTIFYING THE PINS OF YOUR FLYBACK TRANSFORMER
*If you can get a Datasheet for you flyback transformer,it will have the pin out.
MAKE SURE THAT THE DATASHEET IS FOR YOUR TRANSFORMER.
To find the datasheet, you need to know the part number. It may be written on the transformer or even in the service manuals of the device you acquired it from.
*If you couldn't find a datasheet for your transformer you have to identify the pins manually,by following the steps given below.
-The High Voltage output positive wire will be connected to a suction cup.You can keep it, but i chose cut it off.
-The HV output ground(negative) will be found later on.
-You need to find the Primary coil of the transformer. For this measure the resistance between every two consecutive pins. The pair of pins with the resistance closest to 1 ohm are the two ends of the primary coil.
Refer to a YouTube Video If you are confused. There are quite a few dedicated to this topic.
IDENTIFYING THE OUTPUT TERMINALS OF THE BALLAST
You need to open the ballast to get two of the four output wires that are not connected to a capacitor. Refer to the images.

Step 3: Connecting Them All Together

Connecting Them All Together
The two wires in the ballast that don't go to the capacitor are connected to the primary coil of the flyback. Connect the plug and wire to the input of the ballast. Polarity doesn't matter as it is AC. Make sure to insulate the connections from each other and from you.

Step 4: Finding the Negative(ground) Pin

Once all the connections are made, wear your gloves and boots,then power it up. It is normal for the ballast to create a small whirring sound.
-Use pliers to carefully move the HV+ wire near all the pins of the flyback, except the primary coil pins.
-The negative pin and the Positive wire will create electric arcs.
-Disconnect it from the wall outlet, then touch the HV+ wire to the negative pin to DISCHARGE the flyback.
-Now,it is safe to touch.
-Solder a thick wire to the negative pin for easier access to it.
-High quality wire is recommended to prevent any leaks.(High voltage of electricity can get through low quality rubber and plastic)


Step 5: Encasing and Decoration

Encasing and Decoration
Choose a good box that can accommodate both the ballast and the transformer.
-Avoid using a metal box for electrical projects
I chose a cardboard box that could fit both the ballast and the flyback. Then, i used black and yellow electrical tape to make the Eye-catching design. To make it, start with black tape from one corner of a side(of the box) to the other. Then use yellow tape along the edge of the black one on both of it's(black tape's) sides. Then continue using alternative colors of tape. Once you get to the edge of one side,continue to the other with the same strip for better results.
You can make holes in the box for the wires, but i jut brought them out through the corners.
I also had an extra wire in my transformer,which i guess goes to the high voltage capacitor that is built into my transformer. You should have only three wires coming out of the box, the HV+,HV- and the power input(that goes to the wall outlet).
HERE is the link to the video shown above.
You can use a high voltage power supply for various other projects like a Jacob's ladder or a Tesla coil.

2017年4月12日星期三

The Simplest Amplifier Circuit Diagram

I have been looking for a good stereo amplifier circuit diagram for a long time. I am not a HiFi geek, I just wanted to build a simple stereo amplifier that could drive some speakers for my desktop computer.
stereo-amplifier-board-layout
All the schematic diagrams that I could find seemed to involve lots of hard-to-find components or you had to use it together with a pre-amplifier or some other amplifier stage. It was always something that made me hesitate.
But recently I found this awesome little chip called TEA2025! You only need a few capacitors to make a decent stereo amplifier out of it. It is so simple to build that I put it together on a strip board in just a few hours.

2.5W * 2 Stereo Amplifier

The amplifier circuit diagram shows a 2.5W * 2 stereo amplifier. You can also make a 5W mono amplifier out of it. (Check out the TEA2025 datasheet for more information on that)
Stereo Amplifier Circuit Board
On the input side, you should use a dual potentiometer. A dual potmeter allows you to connect both left and right channel on one potentiometer.
This amplifier is great to use together with some speakers to get sound on your desktop computer. I am thinking of putting one in my kitchen and in my bathroom also. Then maybe hook them up to my home network and stream music from a server =) There are many possibilities when you can make such a cheap amplifier.

Amplifier circuit diagram and parts list

A Stereo Amplifier Circuit Diagram

Parts list

PARTVALUEDESCRIPTION
C1100µFPOLARIZED CAPACITOR
C2100µFPOLARIZED CAPACITOR
C3100µFPOLARIZED CAPACITOR
C4100µFPOLARIZED CAPACITOR
C5100µFPOLARIZED CAPACITOR
C6470µFPOLARIZED CAPACITOR
C7100µFPOLARIZED CAPACITOR
C8470µFPOLARIZED CAPACITOR
C90.22µFNON-POLARIZED CAPACITOR
C100.22µFNON-POLARIZED CAPACITOR
C110.15µFNON-POLARIZED CAPACITOR
C120.15µFNON-POLARIZED CAPACITOR
TEA2025TEA2025BAmplifier chip
SPKR14-8 Ohm speaker
SPKR24-8 Ohm speaker
R1+R210KDUAL Potentiometer
Total cost of the components (excluding speakers) is about $9. The most expensive component is the potentiometer (about $3-4).

Download Eagle schematics and board layout

Here is the schematics (Eagle), PCB board layout (Eagle) and Gerber files. This board was made to comply with the design rules of Seeed Studio (May 2013).

2017年4月11日星期二

How to Change the Resistance of a Resistor With Another Resistor

How to Change the Resistance of a Resistor With Another Resistor.
Sometimes you need a resistor with a value you don't have in your kit. Instead of ordering and wanting for a resistor with a value you need you can change the resistance of a resistor by using another resistor or many. By installing resistors in a parallel or series circuit you can change the value in Ohms.
Parts:
  1. You will need a few resistors
  2. Multimeter
  3. Breadboard
Here is a link to a resistor calculator.

Step 1: Resistors in Parallel.

Resistors in Parallel.
Resistor in parallel:
Using the calculator
100 Ohm resistor in a parallel circuit with a 100 Ohm resistor you give you a total resistance of 50 Ohm's
470 Ohm resistor in a parallel circuit with a 470 Ohm resistor you give you a total resistance of 235 Ohm's
The two resistors don't need to have the same value. You can also use two resistors with a different value.
100 Ohm resistor in a parallel circuit with a 50 Ohm resistor you give you a total resistance of 33.33 Ohm's
100 Ohm resistor in a parallel circuit with a 25 Ohm resistor you give you a total resistance of 20 Ohm's
You can also use more then two resistors.
100 Ohm resistor in a parallel circuit with a 25 Ohm resistor and a 25 Ohm resistor you give you a total resistance of 11.11 Ohm's
100 Ohm resistor in a parallel circuit with a 25 Ohm resistor and a 20
Ohm resistor you give you a total resistance of 10 Ohm's

Step 2: Resistors in Series.

Resistors in Series.
Resistor in series:
Using the calculator
100 Ohm resistor in a series circuit with a 100 Ohm resistor you give you a total resistance of 200 Ohm's
470 Ohm resistor in a series circuit with a 470 Ohm resistor you give you a total resistance of 940 Ohm's

The two resistors don't need to have the same value. You can also use two resistors with a different value.
100 Ohm resistor in a series circuit with a 50 Ohm resistor you give you a total resistance of 150 Ohm's
100 Ohm resistor in a series circuit with a 25 Ohm resistor you give you a total resistance of 125 Ohm's
You can also use more then two resistors.
100 Ohm resistor in a series circuit with a 25 Ohm resistor and a 25 Ohm resistor you give you a total resistance of 150 Ohm's
100 Ohm resistor in a series circuit with a 25 Ohm resistor and a 20 Ohm resistor you give you a total resistance of 145 Ohm's

Step 3: Resistors in Parallel and Series.

Resistors in Parallel and Series.
I don't have a calculator for this how ever you can use the same calculator as before.
Parallel circuit you have a 20 Ohm resistor and a 20 Ohm resistor with a total resistance of 10 Ohm's
Your parallel circuit is in series with a 100 Ohm resistor giving you a total resistance of 110 Ohm's.
Same as above but now your adding another resistor in the series circuit.
Parallel circuit you have a 20 Ohm resistor and a 20 Ohm resistor with a total resistance of 10 Ohm's
Your parallel circuit is in series with a 100 Ohm resistor and 100 Ohm resistor giving you a total resistance of 210 Ohm's.

Step 4: Ohm's Law

Ohm's Law
Ohm's law defines a linear relationship between the voltage and the current in an electrical circuit.
The resistor's voltage drop and resistance set the DC current flow through the resistor.
With water flow analogy we can imagine the electric current as water current through pipe, the resistor as a thin pipe that limits the water flow, the voltage as height difference of the water that enables the water flow.
R=Resistance(Ω)
I=Amps
V= Volts
Ohm's law definition
The resistor's current I in amps (I) is equal to the resistor's voltage VR=V in volts (V) divided by the resistance 9R) in ohms (Ω):
I=V/R (Amps=Volts/Resistance)
Voltage calculation:
When we know the current and resistance, we can calculate the voltage.
The voltage V in volts (V) is equal to the to the current I in amps (I) times the resistance (R) in ohms (Ω):
V=I*R (volts=Amps*Resistance)
Resistance calculation:
When we know the voltage and the current, we can calculate the resistance.
The resistance (R) in ohms (Ω) is equal to the voltage in volts (V) divided by the current I in amps (I):
R=V/I (Resistance=Volta/Amps)
Since the current is set by the values of the voltage and resistance, the Ohm's law formula can show that:
  • If we increase the voltage, the current will increase.
  • If we increase the resistance, the current will reduce.

2017年4月4日星期二

Beginner’s Guide to Eagle CAD

Have you tried the Eagle CAD software, but found it a bit confusing?
Don’t worry, I was also a bit confused the first time I tried it. In this guide I will teach you the basics on how to use Eagle, so that you’ll be able to start designing your own electronic circuits.
Eagle CAD (Computer Aided Design) is a software from Cadsoft. It works on Windows, Mac and Linux. A free version is available for hobbyists.

Control Panel

The first window you will be presented to when starting Eagle is the Control Panel.

The Control Panel is where you manage all your
  • projects
  • libraries
  • schematics
  • layouts
  • scripts/jobs
If you want to add a new schematic/layout/project/library, click on “File -> New” and select what you need.

Directories

If you want to add or change the directories where the different files are located, go to “Options -> Directories”.

Automatic backup

By default, Eagle creates automatic backups. The backups are saved in the same directory as the schematic and layout files. Backup files end with .s#1 (schematic files) or .b#1 (board layouts).
The default setting creates up to nine different backup files for both schematics and layouts. You can change these settings in “Options -> Backup…”

Schematic Editor/Layout Editor


To open the schematic editor or the board layout editor in Eagle CAD, you need to open or create a new Schematic or Board. You will find a few examples in the Projects/examples/ folder in the Control Panel.

Toolbar

On the left side of the schematic and layout editor, there is a toolbar with a selection of different tools and commands to create your circuit.
To use a command, click on the icon and click on the object to use it with or somewhere in the editor window.
You can also type commands into the command line.

Example: Move

  1. Click on the “Move” icon.
  2. Click on the red cross of the object you want to move.
  3. Move the object to its new position and click your left mouse button again.
(Note: If there are more than one object very close to one another, eagle won’t know which object you want to select. In this case one object is highlighted. If this is the object you want to select, then click again to select it. If this is not the object you wanted, right-click and a different object is highlighted. Keep right-clicking until the correct object is highlighted, then left-click to select.)

Group move


To perform an action on more than one object, this is what you have to do:
  1. Click the “Group” icon.
  2. Select the objects you want, either by dragging and dropping a rectangle over the objects or by left-clicking several times to create a polygon around the objects then do a right-click.
  3. Click on the desired action icon. For example “Move”.
  4. Hold the Ctrl-key on your keyboard while right-clicking with your mouse. You should now be able to move all the selected objects.
  5. Left-click to place to group at the new location

Useful tools

Add

Lets you choose a part from a library and add to the schematic.

Copy

Create a copy of one or more objects.

Info

View and edit information about a component or wire.

Value

Change the value of a component.

Name

Change the name of a component or a wire. To connect two or more wires without having to draw a wire between them, you can give them the same name.

Smash

Separate the labels and the rest of the component. This is useful if you need to move the labels of your component. Very useful for cleaning up when designing layouts.

Net (Schematics editor only)

Create connections between components. Net vs Wire: Be aware that the “Wire” command also creates connections, BUT it does not create junctions (the green dots) automatically. Therefore, always use “Net” to make connections.

Label (Schematics editor only)

Creates a name-label of the net you choose. You can choose between two types of labels: “Off” or “On”
That’s all you need to know to get started using the Eagle CAD program.