Wednesday, 29 April 2009

Coreduino

Coreduino is another clon of amazing Arduino board. Main advantage of Coreduino is compact size, minimized price and easy connection to a breadboard. If somebody don't know what Arduino is please visit website www.arduino.cc for more information, because Coreduino is based on the Arduino concept. In this post you can find information about Coreduino module, USB and Serial programmers for Coreduino.



Coreduino:

When I first met the Arduino I was really impressed by this great idea. Arduino is very powerful and extremely easy to use. Big Arduino community share projects, components, libraries and codes, which save time to all people who wants to do similar projects. Programing of the Arduino is very simple. Thanks to bootloader, which is programmed inside the ATmega by clicking on one icon in Arduino IDE, the code is loaded and executed in the microcontroller.

I wanted to have my own Arduino but I also wanted something more universal. I took only core components from Arduino and put them to as small PCB as I was able to manufacture practically at home and Coreduino came to light. It consists only from few components: microcontroller ATmega168, crystal 16MHz, reset button, some resistors and capacitors and header for ISP, USB or Serial programmer and also headers for connecting to breadboard.

I put the programmer to stand alone PCB because you can built only one and use it for as many Coreduino boards as you want. This save your money against Arduino board, where each board has his own programmer.

Coreduino is compatible with Arduino Decimalia. It also supports RESET from RTS or DTR line.

Coreduino has three solder bridges (W1, W2, W3), which allow you to make following settings:
W1: allows to supply Coreduino from ISP programmer
W2: connects Vcc to Aref pin
W3: allows to supply Coreduino from USB programmer (see bellow)


Schematic of the Coreduino


Assembly diagram (top side)


Assembly diagram (bottom side)


3D model made in Google SketchUp


Assembled Coreduino (top side)


Assembled Coreduino (bottom side)


Description of pins

USB Programmer:
USB Programmer is actually USB-to-Serial interface. It consists from USB-to-Serial converter chip FT232RL. It is more or less connected as in datasheet schematic. RTS line is also connected to the programming header to allow reset function of Coreduino.

USB Programmer has three solder bridges (W1, W2, W3), which allow you to make following settings:
W1: logic levels will be set to +5V
W2: logic levels will be set to +3.3V
W3: connects supply voltage to programming header. It allows supply Coreduino from this programmer. Supply voltage depends on logic levels voltage set by W1 or W2.

Schematic of the USB programmer


Assembly diagram (top side)


Assembly diagram (bottom side)


Assembled USB Programmer (top side)



Assembled USB Programmer (bottom side)


Serial Programmer:
The serial programmer is easier and cheaper solution for programming of Coreduino. It consists of two level shifters. LEDs on the board indicate sending or receiving data. Serial programmer is not able to supply power for Coreduino.

USB Programmer has two solder bridges (W1, W2), which allow you to make following settings:
W1: use RTS line to reset Coreduino
W2: use DTR line to reset Coreduino


Schematic of the serial programmer


Assembly diagram (top side)


Assembly diagram (bottom side)


Assembled Serial Programmer (top side)


Assembled Serial Programmer (bottom side)

Bridge:
Serial or USB programmer can be connected to the Coreduino with help of small bridge.


Assembly diagram (top side)


Assembled bridge (top view)


Coreduino <-> Bridge <-> USB Programmer

I think that somebody of you could be interested in Coreduino and because the board is on the edge of home manufacturing, I'm willing to arrange ordering of PCBs in professional PCB manufacturing company (PCB would be with vias, solder mask and silk screen). The more people will append the better price will be. In case of interest please write an email to diy4fun@gmail.com.


Read more ...

Sunday, 4 January 2009

Simple Serial Programmer for AVR

This is a very simple and easy to build programmer for Atmel microcontrollers from AVR family. The microcontrollers must support serial programming. This programmer is connected to a PC through the RS232 serial interface and can be used with the PonyProg or Avrdude software programmer.



Description of the serial programmer:
The programmer is quite simple and it is based on the SI-Prog from the author of PonyProg software. The Zener diodes D2, D3 with the resistors R2, R3 reduce the voltage from the ouput pins DTR, RTS on the serial port to around 5V which is suitable for microcontroller (MOSI, SCK). MISO signal is connected directly to the input CTS pin. The Zener diode D1 with the resistor R1 drive the NPN transistor T1, which controls RESET signal. The AVR microcontrollers are in reset when the signal has low level. The resistor R5 works as a pull-up for reset signal. The resistor R4 helps to close the transistor T1. The programmer has standard 10 pins header.

Schematic of the serial programmer


Assembly diagram


PCB (top side)


PCB (bottom side)


Panelization (When you need more pieces.)


Assembled PCB (top side)


Attention:
The transistor T1 should be in opposite position then is depicted in the assembly diagram.
Please check the position of Base-Colector-Emitor on your transistor.

I use this programmer for programming Attiny13, Attiny26, Attiny2313, Atmega48, Atmega88, Atmega168, Atmega16 and it works very well. I also use the programmer with desktop computer, laptop, with and wihout USB-to-RS232 adapter and it works in all cases.


Using PonnyProg2000:
When you want to program your microcontroller with the PonnyProg2000 you have to setup the program as you can see on the following picture. You have to select chosen COM port, where is connected your programmer.

Ponyprog I/O port setting


Using Avrdude:
When you want to program your microcontroller with Avrdude you have to select the keyword "ponyser" as a programmer type and appropriate COM port. I'm using this method to program my microcontroller directly from the Atmel AVRstudio when I'm debuging my application. I create a batch file with the command for the avrdude and I call the batch file directly from the tool bar. It is very fast and easy. Avrdude is also part of the WinAVR package.

Microcontroler programming by avrdude


Programming header reduction:
Sometimes you have to program microcontroller in a aplication where is only 6 pins header instead of 10 pins. I created small adapter for this purpose. The adapter has 10 pins header, 6 pins header and 6 pins header in one line. 6 pins header in line is useful when you want to bring the signals to the breadboard.

Schematic of the programming header reduction


Assembly diagram


PCB (bottom side)


Assembled PCB (top side)


With this equipment you should be able easily program your AVR microcontrollers. Good luck.


Read more ...

Tuesday, 22 April 2008

Make a Sound Card with PCM2702

Make a sound card is no more a complex issue. If you use great IC PCM2702 from BURR BROWN / Texas Instruments you can create a fully functional USB sound card. This sound card can be powered from USB port and has one stereo output. You don’t need to install any driver for Windows XP and Vista, because they are already inside. This is really plug and play.



Few months ago I have seen USB sound card called Alien DAC. The construction on the project web page inspired me to build this thing also.

Description:
The core of this construction is 16-Bit Stereo Digital-To-Analog Convertor with USB interface PCM2702.


PCM2702

Schematic of sound card with PCM2702

PCM2702 needs only few additional parts to work. The schematic is not complex. Sound card can be powered directly from USB port (jumper W1) or from external power supply (jumper W3). PCM2702 needs two power supply 3.3V (3V-3.6V) and 5V (4.5V-5.5V). I used fixed output voltage LDO TPS76733Q for 3.3V (IO2) and adjustable output voltage LDO TPS76701Q for 5V (IO3). Both LDO are produced by TI, I used this because I had it in my drawer. Any similar LDO can be used. Output voltage of IO3 should be set to little bit lower than input voltage to allow LDO good stabilization, in my case output voltage is set to 4.8V. Output voltage can be set by adjustable resistor R33. In case of low power supply, IO3 can be shorted by jumper W3. LED D3 signalizes power on.

Small ferrite beads are placed before all power pins of PCM2702 and in Vbus and GND of USB. These small beads reduce high frequency hum. I had a problem find this small SMD ferrite beads in local stores but finally I acquire few of them from old hard drive. They are not absolutely necessary, you can use zero ohm resistors instead of them.

Low-pass filter is placed in output signal path to reduce sampling frequency. An OPA2353UA dual op amp is configured as a stereo 2nd-order low-pass filter.

Led diode D1 is illuminated when PCM2702 plays audio data received from the USB bus. Led diode D2 is illuminated when USB bus suspends audio data transmission to the PCM2702.

Realization:

PCB Assembly diagram


Bottom side (single side PCB, made by standard etching method)


Assembled top side


Assembled bottom side

Conclusion:
This circuit works very well. I only shorted crystal during soldering so the circuit didn’t work, but after removing the short the sound card started to work. I have tested in Windows 2000, XP and Vista. It works in all mentioned systems. Drivers are present in operation system so the sound card is ready in few seconds after you connect it.

During writing this article I have found that PCM2702 is now not recommended for new design, but TI offer even better solution. PCM2704, PCM2705 have same functionality as PCM2702, but they include output filter. They are able to drive directly headphones. Volume and Mute can be controlled through SPI bus in PCM2705 or with pushbuttons in case of PCM2704. PCM2704 and PCM2705 are in TSSOP28 package. PCM2706 is similar to PCM2704 and PCM2707 to PCM2705 but in addition they have I2S bus. PCM2706 and PCM2707 are in TQFP32 package. I recommend using these new chips for new design (look at the TI web page).

LINKS:
PCM2702 Texas Instrument

PCM2702 Evaluation Board

Alien DAC

Download project including schematic, assembly diagram and PCB.


Read more ...

Tuesday, 1 April 2008

ATmega48/88/168 Development Board

This is versatile development board for AVR microcontrollers ATmega48/88/168. It is good for testing and debugging embedded programs. It has many built-in peripheries connected to microcontroller so you can use them without soldering. ATmega microcontrollers are produced by ATMEL and they include a lot of features: I/O, Timers, PWM generators, ADC, RS232, TWI, SPI, Analog Comparator, Oscillator, EEPROM… These microcontrollers are very versatile, easy to program and easy to use. This is the reason why I like these microcontrollers and why I decided to make development board for them.




The development board consists of:

1. ATmega AVR microcontroller in DIP28 package
The development board is designed to use ATmega48 with 4kB flash memory or ATmega88 (8kB), ATmega168 (16kB). New version of these microcontrollers ATmega48P/88P/168P and ATmega328P (with 32kB) are pin compatible with old version, so they can be used also.

External crystal X1 is placed in socket, so it is easy to change it or remove it. If internal oscillator is used then two PB6 and PB7 pins dedicated for crystal can be connected to the Port B connector.

Microcontroller can be reset by pressing reset button S1.


2. AVR Ports B, C, D headers
If built in peripheries are not used another device can be connected to the PORT B, C and D. Each port is connected to the 10-pin header. You could connect LCD display, Rotary Encoder, SD Card Reader, etc. with microcontroller. See my future posts.


3. 5V Power supply
Both AC and DC voltage can be plugged in, because of using rectifier bridge. Input voltage can be connected to 2.5mm power jack connector or screw terminal. Power can be switch on / off by SW1. Power supply voltage is stabilized by common IO 7805. When the power is switch on red LED6 is lighted.


4. 4x LEDs
Four green LEDs can be connected to the Port D shorting jumpers JMP6-9.


5. 4x Buttons
Four buttons are connected to the Port B.


6. Piezo
Piezo speaker can be connected to pin PB1 through JMP5.


7. ADC accessories
The microcontroller has built-in 10bits AD converter. On the board is LC filter for power supply of this ADC. You can use internal or external reference. The rotary trimming resistor R2 is connected to Aref input for playing with the external reference.


8. Potentiometer
For simulation of varying ADC input voltage the rotary trimming resistor R1 can be connected to PC1 (ADC1) through JMP12.


10. Temperature sensors
If you want to play with temperature sensor, you can connect temperature sensor with either analog or PWM output. Temperature sensor with analog output can be connected to the PC0 (ADC0) through JMP10. Temperature sensor with PWM output can be connected to the PB0 through JMP11.


10. RS232 line
Standard serial interface is placed on the board. Level shifter MAX232 is used. MAX232 has two receiver and two transmitter lines. You can connect RXD and TXD of RS232 with RXD and TXD of microcontroller with help of config header. RTS and CTS of RS232 can be connected with PD6 and PD7 through JMP3 and JMP4. See config header part.


11. Config Header
Config header allows interconnect different I/O microcontroller pins with RS232 line or with screw terminal.


12. Srew terminals
Screw terminals allow easily connect wires to microcontroller. Through this terminal you compose for example frequency counter of voltmeter, etc. Ground and 5 Volts are also presented on screw terminal.


13. ISP
Development board includes serial port interface to allow direct in-system programming (ISP). Microcontroller can be programmed trough RS232 serial port by using program Pony Prog or Avrdude (ponyser). To avoid interference with RS232 signals, programmer can be disconnected using analog switches 4066. These switches can be closed manually by SW2 or automatically when the reset is active (using JMP13).


14. Mounting Holes
In each corner of PCB is placed one ø3.2mm mounting hole.




And the result ...

Assembly diagram

Top Side

Bottom Side

LINKS:
Following web side inspired me to build the development board.
AVR Development and Application Boards

You can download this project including whole schematic, assembly diagram and PCB.
ATmegaa48 Development Board


Read more ...

Sunday, 11 November 2007

CMoy

CMoy is very simple portable headphone amplifier. The amplifier was originally posted by Chu Moy on headwize.com. The best source of information about this amplifier is article How to Build the CMoy Pocket Amplifier. If you use Google, you will find many pages and pictures about CMoy. Few months ago I decided built this amplifier also. In my post you can find my experience with creating this simple but very good amplifier.



First of all I prepared the schematic. It is standard CMoy schematic, non-inverting amplifier with gain 11. The power supply is making virtual ground (half of supply voltage). My power supply unit has two possibility. Firts possibility is use passive voltage divider, consist of two resistors R1a and R1b. In this case it is necessary use also two electrolytic capacitors C1a and C1b. The second possibility is used active divider TLE2426 from TI. In this case it is necessary connect only one capacitor between Vcc+ and Vcc-.

1. Schematic

After I had schematic I designed the PCB. My PCB is prepared for both variants of power supply. I can connect also one or two 9V batteries. In first case it is necessary shortcut one supply connector P1a or P1b. Power switch can be connected to P2.

2. Design of PCB

I let make the film in Prague's design studio Winter.

3. Film

The PCBs were made in Prague's company PLspoj.

4. PCB

I assembled CMoy during one hour. Instead of R5 and R25 is used only wires. These resistors are assembled only in case of oscillation. The value should be few ohms. Now I have to find some good box, and put my CMoy inside. It will be maybe most difficult part of building CMoy amplifier :-).

5. Finished CMoy

The sound is very good for so easy and small device. It can improve the sound of MP3 players, mobile phones and other portable devices. I would like to make some measurement of frequency characteristics, THD and also try to use different OpAmps, but unfortunately I don't have enough time to make it now.

LINKS:
A lot of information about CMoy : http://tangentsoft.net/audio/cmoy-tutorial/

Step by step tutorial how to make CMoy: http://williamneo.blogspot.com/


Read more ...

Let's start :)

Hello Everybody,
welcome on my blog DIY4FUN. After long time thinking about making my own web site, I decided to create blog site, because I don't want waste my time fighting with HTML, CCS, ... even if I have some experience with this. On this blog I would like to share with you my experience with building electronic devices and my new ideas, advice, opinions about electronics.

For those who don't know what means DIY, it means Do It Yourself. Even If we can buy almost everything, there is still good reason why build small electronic devices yourself. You can learn new thinks, obtain new experience, save some money and the most important think you can taste great feeling when your devices is working.

Let me shortly introduce myself. I'm now 27 years old. I live in Prague in Czech Republic. I graduate Czech Technical University and I was focused on measurement, technical diagnostic and aircraft electronics. I'm working as a product engineer in ST Microelectronics. Company which produce semiconductor parts. Even if electronics is my job, I like it and electronics is also my hobby.

I'm looking forward for your comments.
You can contact me trough email diy4fun@gmail.com

Best regards
Miroslav (Mirek) Batek

PS: English is not my mother tongue. I would like to apologize for mistake which I will make. I will be glad if you will correct me, because I can improve my English.


Read more ...