Friendly Wire

Discover the joy of electronics

Category: Uncategorized

Useful software in hobby electronics

The computer has long entered the stage of hobby electronics. Sometimes I think this is a good thing, and sometimes I kind of dislike the idea. I mean, back in the day before computers were around it was already possible to build amazing pieces of equipment. But in this post I want to look at computers not as a distraction but rather as a useful companion for anyone who wants to get stuff done in hobby electronics.

What is useful software that anybody interested in hobby electronics should know about?

Some software in this list is free, some is not or only to some extent. I have used all of the software presented here in real-life applications and I am convinced that they are useful, one one situation or the other.

Lastly, I want to say that software alone is of course not enough. Software is only ever a tool that becomes useful once we have made up our mind about what we want to build or repair or understand. And, consequently, the piece of software that you need for your project depends a lot on the specific kind of project you are working on. In what follows I will list a few pieces of software I have found useful in the past, but if you feel that I forgot one that is particularly important to you, please do let me know in the comments and I will gladly include it.

Sprint Layout

Sprint Layout is a simple-to-use editor that lets you design your own PCBs. I recently wrote an article on whether you should build and design your own PCB or rather work with breadboards, and maybe you want to check it out here. Say you have decided to make your own PCB. Great! But now what?

You could in principle design it in Paint or any other primitive drawing program. But of course that is quite tedious. Sprint Layout is an affordable software (around $50 as the time of writing this article) that lets you design your own PCB.

Important: you have to design it yourself! That means that all connections, components, lanes, through-holes, and whatever else you can think of have to be placed by you. That can be quite daunting for involved schematics, but for simple enough projects with around 25-50 components it can work wonderfully well.

When I first bought Sprint Layout back in 2006 or so I was distraught because I thought I could just create my schematic, place the components, and then Sprint Layout would create the PCB for me. I later learned that this is called auto-routing and Sprint Layout does not offer this kind of capability.

But, as I said, for small projects this is not really needed anyway, so Sprint Layout is perfectly capable to help you a lot in your first steps! I find that in North America this software is a but unknown, but in Europe it is certainly rather popular.

Eagle Layout Editor

Eagle Layout is a piece of software that does come with auto-routing. Naturally it is much more expensive, but it is the tool of choice when you have complicated, multi-layer PCBs that are just too difficult to route by hand.

There is a free version of Eagle available, and this is the main reason I include this software in this list. I primarily use the free version of Eagle for creating schematics. It may seem ridiculous to you, but I have yet to come across a more complete, freely available schematic editor than Eagle.

The device library contains thousands of items, and if your device is missing you can simply create your own. Eagle also comes with a bunch of schematic-only symbols: those do not have a real-life counterpart that gets mounted in the PCB, for example, the GND symbol for the ground potential, or +5V symbols to indicate which lanes are connected to the positive supply.

All schematics can be exported to a high-resolution image file and they are more than sufficient for the documentation of any hobby electronics project. For that purpose alone I highly recommend the free version of Eagle.

Fritzing

Fritzing is an amazing piece of free software that can be used to model and design breadboard circuits, with a wide variety of third-party tools (Arduino, Raspberry Pi, and so on). In that sense, Fritzing is the Eagle equivalent for breadboards.

I have not used Fritzing for much of my career in hobby electronics because I am just getting used to breadboards, but it sure does look impressive. What impresses me most is that Fritzing identifies as a “hardware initiative,” that is, it comes with a forum and an entire community. In that sense it is much more than just a piece of software: it is a platform where anybody and everybody can share their creations on breadboards.

I sure will be using it more in the future! Learn more about Fritzing here!

LTspice

This is a serious piece of software, and I have only used it a few times. It is a simulator that you can use to simulate just about any circuit imaginable. It is very powerful but also very complex, learn more about it here. And the best part: it is completely free!

LTspice can not only simulate digital circuits, which are perhaps a bit boring. Its true strength and potential lies in simulating analog circuits. If you want to build a bandpass filter for your next audio project, LTspice is a great place to do your virtual experiments. You can decide how fine you want to adjust the time steps for numerical simulation, and you can hook up as many virtual probes to different parts of the circuit as you want.

Since I am not very knowledgeable in analog electronics I have not used this software much, but it sure is impressive. I would definitely keep an eye out for an opportunity when this software could potentially help you with a more complicated project. Also, there are many tutorials available!

MPLAB X IDE

Whenever I use microcontrollers I tend to use PIC controllers from the company MicroChip (but they also offer a wide variety of other controllers). At any rate, one of the big advantages of using PIC controllers–in my opinion– is the existence of the MPLAB X IDE. IDE stands for Integrated Development Environment, and the X stands for version 10. This last bit is important because version 10 came with a major overhaul along with many bugfixes of previous versions. I was used to version 7 or 8, and I had to re-learn quite a bit when switching to version 10. It was totally worth it!

This piece of software is freely available and allows you to create projects with PIC controllers. This is a story on its own, and I won’t go in too much detail here, but the MPLAB IDE X comes with two key features: support of external devices that you can use to program your PIC (in my case, I use the PICkit3, a serial USB programmer) and it brings along a range of compilers that are needed to transform the code you write for your controller (say, in C) into machine language (the so-called “hex file”).

Okay, that may sound confusing to you. I just read the above paragraph again, and it also sounds confusing to me. What do I want to say? If you want to get started with microcontrollers (and I may write about this super-exciting topic in an upcoming blog post) then it is a good idea to remember MPLAB X IDE. It is a professional environment, and there are professional paid-for versions available that come with certain additional features.

So why use MPLAB and not a completely free version? The reason is simple: MicroChip is the world’s perhaps best microcontroller company. If you learn how to use their software it will come in handy when you are interviewing for that engineering job a few years down the line. Okay, the choice is of course up to you, but if a company like MicroChip offers phenomenally good software for free, why not use it?

Have I forgotten something?

Please do let me know in the comments what is your most favorite piece of software and I will be glad to include it here! Thanks for reading!

LEDs 101 – what do you need to know?

LEDs, or Light Emitting Diodes, are everywhere. Your smartphone? Check. Your microwave? Check. Your electric toothbrush? Check. In this article I want to present the basic ideas of how LEDs work and how you can use them in simple projects without having to rely on expensive after market solutions (such as wired LEDs with battery drivers that are expensive and often of questionable quality). Here we go!

Basic parameters that describe an LED

There are a few parameters and technical terms that you should keep in mind when looking at LEDs. They have the following names and meanings:

  • Current: Usually around 20mA, this is how much current your LED needs to glow. There are also low current LEDs out there that require less current, typically around 2-5mA. The exact value will be listed in your LED’s datasheet.
  • Voltage: Depending on the color of the LED, the voltage that drops across them is slightly different. You can calculate it using Planck’s constant and the exact wavelength of your LED, but typically the voltage is around 2V – 2.5V. It is a bit higher for blue LEDs (they have a shorter wavelength and therefore one blue photon requires more energy) and a bit lower for red and infrared LEDs. Again, the exact value will be listed in your LED’s datasheet.
  • Clear or diffused: This is pretty self-explanatory, but it is important to keep in mind. Some LEDs come with a diffused body, that is, the light will spread more isotropically, whereas others come with a clear body that will direct the light in a narrow cone.
  • Beam angle: In case of a clear LED, light exits the LED body in a cone shape and there is usually an opening angle specified somewhere in the datasheet. A typical beam angle is between 30 – 60 degrees, but you can also look for more focused LEDs that have angles below 10 degrees.
  • LEDs come with a different diameter. Typical LEDs have 3mm, 5mm, 8mm, or 10mm diameter. There are other sizes and shapes as well, but they are less common. The larger the LED is, the more current it typically needs to glow. The voltage will be the same (for differently sized LEDs of the same color), provided there is only one LED chip in the body. If the LED consists of several chips in series, the voltages will add up.
  • RGB: Yes, there are also RGB LEDs. These LEDs are special types that actually contain a red, green, and blue LED combined in one housing. Treat each one of these LEDs as a separate LED 🙂
  • Blinking: Some LEDs have a blinking-circuit built-in. This can be useful but it can also be pretty annoying if you don’t pay attention and actually needed a static LED instead of a blinky one. The datasheet is your friend!
  • Pre-wired: Especially on online stores such as Amazon or Ebay you can often find “LEDs for 5V” or “LEDs for 12V.” What does that mean? These LEDs come with a resistor that is calculated to work well with the specified voltage. These LEDs then do not need a current limiting resistor (see more below) and can be directly connected to the specified voltage.

Why are they called diodes?

LEDs stands for light emitting diode, and diodes are devices that have a polarity. The positive terminal is called the anode, and the negative terminal is called the cathode. The short leg is the cathode, and the long leg is the anode. But don’t worry: if you wire up an LED correctly and just get the polarity wrong, nothing happens. It just won’t glow. In that case just switch the plus and minus cables and then everything will be alright. But don’t forget the current limiting resistor that we will talk about next!

How do I calculate the LED resistor?

Usually, there are three parameters that you know when you are dealing with LEDs. The first one is the supplyvoltage that your circuit works with. That can be 5V, 9V, 12V, whatever you want. The second parameter is the LED current. If it is too high, it dies. Typical LED currents are in the range of 10-20mA (but the exact value is listed in the datasheet). We also know that LEDs have a typical voltage drop across the chip (this is the energy that is needed to emit light). This is roughly between 2V – 2.5V.

It is not very difficult to calculate the resistor that is needed to limit the LED current. You simply take the supply voltage and subtract the voltage that drops over the LED. Say your circuit works with 9V and your LED has a voltage drop of 2V. Then you need your resistor to kill the remaining 9V-2V=7V. You also know that the current should be, say, 20mA. Then we just use Ohm’s law:

R = V / I = 7V / 0.02A = 350 Ohms

To be safe you can just go with 470 Ohms in that case. Another example? Sure! Say you have a 10mA LED at a 5V circuit (and the LED drops, again, 2V):

R = 3V / 0.01A = 300 Ohms

You get the idea. These parameters are not super critical. For standard LEDs I typically use 470 Ohms at 12V or 9V, and 220 Ohms at 5V.

Deluxe variant: constant current source!

Sometimes it is important to get the current exactly right. What, for example, if you have three LEDs in series? Then the voltage drop over all of these add up, sure. But manufacturing inaccuracies can lead to fluctuations of a few 0.1V when you have more than two or three LEDs in series. And what if one LED shorts out at some time? Then all other LEDs will surely die because the voltage drop is too high resulting in an increased current.

The solution is given by the voltage regulator IC LM317. Here you can see how to wire it up:

All you need to know now is the current you want to achieve. Say, it is 12mA. Then the resistor R1 in the above diagram has to have the value

R1 = 1.25V / 0.012A = 105 Ohms.

That was easy, wasn’t it? The reason this is so simple lies in the fact that the LM317 is a smart device: an integrated circuit that regulates the current if it is wired up as indicated above. The voltage drop that was killed by the current limiting resistor in the previous example is now just dissipated as heat through the heat sink of the LM317.

A word of caution: This works well when you want to drive, say, four LEDs in series at a voltage of 12V. It does not work well if the voltage drop is too high because then the LM317 will have to dissipate too much heat.

Sometimes it is a good idea to combine these tools: put in a small current limiting resistor (to kill, say, 5V or so) and then do the fine-tuning with the LM317-circuit in series. Then you have the best out of two worlds: current regulation (in the word’s true meaning) and not too much heat dissipated. Great!

The LED rainbow – have fun!

LEDs are everywhere, and I hope that with this article you feel more confident when it comes to choosing an LED for your next project. Let me know if this article was helpful or not, and what you want to read about next! Thanks for reading 🙂

© 2019 Friendly Wire

Theme by Anders NorenUp ↑