2013. február 2., szombat

Beginning a new project


Below is my 10 points I follow when a new project hits my mind. This may differ from people to people but it works for me at last. I always start like this:



  1. Search for many information, like textbooks, articles, examples, datasheets
  2. Write down your requirements
  3. Organize the information, make folders, download datasheets
  4. Select the main parts You can or want to use, this depends on your knowledge or source of parts
  5. Check if the known parts are capable of doing what it should or search for the appropriate part, manufacturers page can help in that a lot
  6. Begin to draw the schematics, I use Eagle in my projects
  7. Decide on the building method, like surface mount or trough hole, desired PCB size or just protoboard
  8. Start your layout with the part in the most important positions, the others must fit around that
  9. If you are happy with your layout, double check for possible improvements
  10. Before going shopping and sending the files to a professional PCB shop triple check everything, take some time between two checks, like a day, to see if you are still sure everything is as intended to be

I think myself an amateur in electronics design but hopefully an intermediate amateur. For trying out new things and learn how their work a beginner needs some tools. I will talk about microcontroller based projects, in the future, so when your plan is to learn tube technology you will not find many useful information below.

Once I learned C and had my very first microcontroller programmed, I saw how many possibilities lying before me. At this point I made a statement.
First, I am not a professional, I won't use 132 legs MCU with 32bit architecture. I am not a linux programmer either.

So I went to the part store, and checked the Atmel Attiny and Atmega family microcontroller prices. For my initial ideas I decided I will not be using MCUs above 1000 Forints, about $5.
Building more complex programs, the first you will notice 2kbyte RAM is plenty! I have to tell you I did never fill a 2k microcontroller program memory to even 90% with my most complex design.
Storing lookup tables is another story. For that I may use I2C memory that is cheaper but that depends on the table.
Well, for that price limit I have many choices, I still do not ever buy a microcontroller that cost me more!

The next step is to use SMT parts.
Why use SMT parts?
Surface mounted parts has some benefit when you are designing a nice little circuit. For me after thinking of the drawbacks are still the preferred technology. I made a list why:


SMT 
"Surface mount"
THT
"Though hole"
Cheaper parts Costs more

Less PCB area needed

Uses more pcb space

Often need 2 sided PCB Fine with 1 sided pcb
PCB needs conductive vias Fine without vias
Difficult handling and soldering Easier to solder
Quicker to solder More assembly time
Some parts only available in SMT DIP ICs not always available


My first complex circuit was a breadboard monster. Some parts were SMT cased and for that I bought a few DIP adapters from eBay that worked perfectly. When I realized the benefits of surface mount technology It turned out a professionally manufactured PCB is always better. First I used the bigger parts like 1206 size, now I use 0805 where I can. A PCB populated with SMT parts are always smaller and smaller PCB area is cheaper.
It could turn to a habit to make the circuits as small as possible. In my designs I use the less possible space to stuff things on. There are always some THT parts, at least the connectors and somethimes capacitors. I use THT relays for example.

Now we are good for the first few items in the checklist, the next one needs a CAD program to draw schematics and do board layout. There are some free alternatives too but I recommend Eagle from Cadsoft. The free version can do 2 layer boards in 100 x 80 mm dimensions which is plenty if you use SMT parts.

If You are new to SMT technology, I recommend you to watch a video how to solder really small parts, on YouTube there are very good videos on that. Search for "SMT soldering". Its fun.

2013. január 10., csütörtök

The love of headphones turned to DIY audio


Once I had a very good sounding headphone. I think it started all the love for headphones for me but only a few years later. It was a Philips, I bought in a warehouse. I walked trough the rows to buy a headphone but with my 50 pounds in my wallet I felt rich then, and wanted the most expensive one. Back then I had no clue such manufacturers existed like AKG or Grado. And guess what, I bought the most expensive headphones I could find in a shop for about 38 pounds and it was the Philips SBC HP 840!

That poor headphone died after many years together, and I felt so sad. I started to get know the names AKG, Sennheiser, Beyerdinamic, but after some search in the high-end audiophile realm I realized I am not feeling the same when checking my wallet as I felt a few years before.
What I wanted to say I had high expectations, even after a Philips headphone that soon turned out it was an exceptionally good pair of headphones!

I learned a lot from DIY audio forums and blogs. I learned that for a good pair of headphones I need good sources, and a headphone amplifier made of quality parts. Those things was not entirely available in my country so I searched trough American and far east sites to gather knowledge.

Finding some very good DIY pages, I thought I could build something myself that could be affordable, very high quality and not least fun to do. After this I was searching for a headphone amplifier kit I knew I would need for my next headphones. Even if I couldn't yet decide which headphones to buy.
In my study of amplifier circuits, power supplies, attenuators, cables and connectors, I found audio volume controlling the most interesting. It could be a good start to try something new.

That was the first high-end and yet unfinished digitally controlled volume control I started to design.


What was it all about? Once I read an article about an LDR based volume controlling method. The LDR is a photo-resistive component, which changes its resistance according to the light it gets. Some forum members found it very pleasing to listen trough that, some already declared it to the best sounding passive volume control.

Controlling this was not far from the blinking LED projects, as the easyest way to control the light intensity next to an LDR is controlling an LED.
The task is to make a resistor devider, both the serial and parallel part is controlled in inverse. This way it is theorically possible to make an electronic potentiometer. In real world it is not so perfect.
A potentiometer could attenuate from zero to some degree. But an LDR can not reach zero Ohm resistance at any state. Checking a manufacturer datasheet the resistance of the LDR could go down to 40-80 Ohm but no lower. It depends on the product, not every LDR is the same. I could find LDRs that went down to 17 Ohm! And that is a really good value when talking about LDRs.
Another aspects of using a potentiometer like device is channel matching or channel equality. We want at least two channels when talking about hi-fi. In a two gang or two channel potentiometer there are two almost identical resistive element. If we want to copy that we need similar working elements. And LDRs has no tight tolerance. You have to match them to build two voltage dividers for each channel. A few man offers matched LDRs for builders on the internet, you can buy them or match them yourself but that means you have to buy 10 or 20 to have a few pairs.

Long introduction... but what if you would not have to match them?!
Well I had the idea. Take a few individual LDRs, and measure the characteristics of them with a 24bit precision ADC.
This involves using some microcontrolled smart measuring tool. Using this information later this way each LDR could be driven to the same discrete resistance level. Take as many value as possible and store the needed settings for each LDR. Lets see how:
Each LDR has a driver to control the LED attached to it. At each setting from minimum to maximum the LDRs resistance value is read by an ADC. This data is stored in memory. Each LDR has a minimum resistance value. But if you select the highest, you have a value that every of the measured branch can have. This will be the lowest setting, so all data below this value can be omitted. Selecting the highest and the lowest value to the possible voltage dividers the rest in between can be divided into lest say 500 levels. For the 500 levels the data for setting the LDR-LED combo to that particular value must be stored in memory.
If it is working well, you get a pair of LDR-s that was not matched only at 2, 5, or 8 levels but matched at 500 levels! But this is not restricted for two pairs. With this technique you can match 8 of 8 LDRs and build a balanced volume controller. This was not done before. Will this be the ultimate LDR volume controller? We will see.
*Early prototype


Now the development of this device yet to be finished. It took a year and I had to learn a lot of things to build a prototype. And it is not finished yet. I had other things to do and put the plans away for a while. But this was something that made me learn many things. First of all, to not just think, but to make things happen. In the next few posts I will talk about this.

2013. január 1., kedd

The beginning of my life with electronics, way before the 8th note brand


All this started many years ago. My interest in electronics goes back to my childhood. My dad used to do some small projects he saw in a magazine, including electronics. It was an early DIY magazine way before blogs and even internet turned up.

My interest in such things has began with some dead walkmans, LEDs, batteries and electronic model motors. I have made some clever things I can remember. I liked to tape a mechanical pencil lead to a model motors shaft, then powering it with a battery it started to turn and open a little bit. If it was ready, I gently pushed it to a drawing paper and start to draw things. If I did push it too hard the lead broke so I had to be careful. But it was fun.
Many years later I went to a school to learn more about electronics. Four years of study started from Ohms laws. Later we made an end-of-year project every semester. After school it could have been turned out well in this speciality but I wanted to try other things and my study of electronics ended.
Many years and an engineering degree later which has nothing to do with electronics I have got the itch again.
I am writing this blog about my experiments and projects I started since, and I hope it will be useful or at least interesting for other DIY enthusiasts like me.

Do you know how does it feel when You are 24 and know nothing about binary numbers? And then You want to know more? Nobody? Well, I had been thinking that by then. I was searching the internet for interesting projects and I realized something happened since the transistor radio we made once for an end of year project in electronics school. It was microcontrollers.


Microcontrollers being so popular and available, to be exact.
I forgot to tell I had been learning some computer programming back in basic school. But these days nobody use Pascal any more. So I bought an Atmel Attiny25 breadboard adapter, an USB programmer and opened a book called Embedded C in microcontrollers.
Anyway I learned C and I was ready to do my very first "led blinks in 1 sec interval" scientific project. Sounds interesting does it? This was only a beginning.
One of my first attempt to do something useful too was a car seat heating thermostat and an RGB colour changing lamp. 

When I felt that I was ready for more complex work, I think that was the time when I turned my interest to audio related DIY. I wanted to do something that involved external memory chips, 24bit ADC and digital controlled LED drivers. But I will introduce it later when I get there. What I was learning next and I want to tell about is how to turn an idea to something working (or partly working) on your desk.

At this point I want to clarify I will do no tutorials here, but one can definitely learn something from reading further. Sometimes I skip a learning curve or two here but I try not to make it difficult to follow.