Thursday, 21 January 2010

Rotary encoder for ATS transceiver series

This equipment is dedicated for an easier control of the popular mini-transceiver AT Sprint known by ham radio operators as ATS (series ATS-2, ATS-3, A, B, B.1 compatible). Originally the ATS has just four push buttons on the top cover and in combination with the paddle it is possible to send all commands to ATS including the tuning, scanning etc. After connecting the rotary encoder accessory module an easy tune, scan and other functions are available as same as on the big size desktop transceivers. Comfort and operation is much higher even with this mini transceiver.



Description:
Some times ago my friend and colleague Petr (OK1RP) bough and built ATS transceiver. When he showed me how it works I saw that tuning is not very comfortable. I thought that would be nice to be able to control tuning with rotary encoder in the same way as it is possible on large desktop transceivers. Petr was very excited about this idea. We looked at the schematic and the idea of schematic was born in my had. I built first prototype and it worked quite well. And now you can see final version of the rotary encoder module.

The heart of the rotary encoder module is microcontroller Atmel ATtiny2313. The firmware in the microcontroller is watching the turning or pushing of the main tuning knob on the encoder module. According to movement of the tuning knob the microcontroller control three transistors which are connected in parallel with push buttons in ATS.

Block diagram of the rotary encoder

The rotary encoder consisting the main blocks as follows: microcontroller, encoder unit with knob, LED indicators, transistor switching circuit, voltage regulator and connector for connection with ATS.

Schematic of the rotary encoder kit

I designed the double side PCB. The size of the PCB is 38x36mm and it has two mounting holes. Really nice, isn't it.

Assembly diagram (top side)

Assembly diagram (bottom side)


Interconection with ATS:
For correct functionality of the rotary encoder module is necessary to connect five wires as follows:
1) connect the GND of the ATS to the GND of the rotary encoder
2) connect Vcc voltage from ATS board to rotary encoder board
3) connect the push buttons MENU, UP and DOWN on the ATS board to the rotary encoder board

Rotary encoder pins description

The five wires cable should be used for interconnection between ATS and rotary encoder module. Due to this interconnection it is possible to easily disconnect encoder and use ATS alone as originally designed. On the ATS side the wires are soldered to push buttons pins, power supply and GND pins.

Interconnection between encoder and ATS transceiver

Control options:


Rotation 1 step to the left
- simulates pushing the button DOWN (tune down)



Rotation 1 step to the right
- simulates pushing the button UP (tune up)



Pushing the tuning knob once
- simulates pushing the button MENU once (frequency reading)



Pushing the tuning knob long time
- simulates pushing the button MENU long time (go to MENU)



Double click to the tuning knob
- “tuning” mode is activated which is indicated by the both green LED's flashing. Encoder is waiting at this moment for the direction where to go to tune the transceiver. It can be done by simply rotation right/up or left/down of the main tuning knob. After setting the directions as mentioned the encoder simulates holding the push button up/down on the ATS to tune through the band without necessity to hold any button or knobs! We are talking about the automatic scanning through the band. The selected direction is indicated by the flashing of corresponding green LED. To stop the tuning through the band just press or rotate the tuning knob in any direction.


Conclusion:
It took few months from first idea to the final version of the kit, but it was nice work with good result. I would like to thank you to OK1RP and OK1SA for support and testing of this kit. On the following pictures you can see one of the last version of the rotary encoder module on the professionally made PCB. Actually the last version is using 1206 size of resistors and capacitors instead of 0805 size for easier soldering. I will post photos with 1206 part soon in the next post where I will public step-by-step procedure how to assembly this kit (so stay tuned).

Rotary encoder modul (top view)


Rotary encoder modul (left view)

Ordering Information:
Because I thought that this device could interest other ATS radio operators I made a kit with all parts including pre-programmed microcontroller and the PCB. If you would like to buy the kit, please contact me on my mail address diy4fun@gmail.com. The price of the kit is 25USD. The shipping is 5USD worldwide for one kit, 6USD for two kits and 7USD for three kits. I prefer PayPal for the payment and I'm sending the kits by standard postal service.


Read more ...

Sunday, 3 January 2010

Make a Sound Card with PCM2704

This article relates to my previous article Make a sound card with PCM2702. In this time I used newer IC from Texas Instruments PCM2704. Thanks to this circuit with all necessary features inside 28pins SSOP package I was able to built quite small sound card. The result is sound card with size of gumstick.



Description:
This device is fully functional sound card for PC. The main advantage of using PCM2704 against PCM2702 is much easier construction. As you can see on the block diagram it has built-in 5V and 3.3 voltage regulator, HID interface (MUTE, VOL+, VOL-), S/PDIF output. The circuit can be powered directly from USB port. Next advantage is that the outup DAC is able to drive directly 32ohms headphones, but the ouput power is only 12mW. For all details please refer to the PCM2704 datasheet.

Block diagram

The schematic is very simple. It is almost copy of the datasheet circuit diagram. You can see the core IC PCM2704 (U1), crystal with supporting parts (X1, C1, C2, R1), connection to the USB (USB connector, R2, R3,R4, L1), a lot of blocking capacitors for all voltages (C3, C4, C5, C6, C7, C8), S/PDIF output header (J1), HID header (J2), output filter (R5, C11, R6, C12, R7, R8), coupling capacitors (C9, C10) and output 3.5mm Jack connector (J3).


Schematic of sound card with PCM2704

Realization:
I designed my own PCB. The dimensions of the PCB are 55x18mm, including USB and Jack connector it is 73x18mm. To keep the size as small as possible 0805 size of capacitors and resistors were used. The L1 is ferrite bead which reduce high frequency hum. With good soldering iron and litle experience it is possible to assembly the PCB by hand.

Assembly diagram (top side)

Assembly diagram (bottom side)


PCB (top side)

PCB (bottom side)


Assembled PCB (top side)

Assembled PCB (bottom side)

Conclusion:
I built two pieces of this sound card. I have tested the sound card under Windows XP and Windows Vista and it works without any problem. I wanted to use this device for my Internet radio receiver, which I'm building according to the project published on mightyOhm.com. The receiver is based on Asus WiFi router WL-520GU with OpenWrt Linux distribution. The sound card works under the Linux as well, but it stop and start playing the sound periodically (the period varied from few minutes to one hour). I guess it is driver problem (if somebody has any idea how to fix it I will be very grateful).

You can ask me why to build this sound card when you can buy similar device for few bucks. I have also one sound card from China which cost around 5$ but the quality of the sound is very bad, so the main difference is sound quality.

Links:
PMC2704 (TI)
PCM2704 Evaluation Board (TI)


Read more ...

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 ...