Designing Electronics with Linux

In many scientific disciplines, the research you may be doing is completely new. It may be so new that there isn't even any instrumentation available to make your experimental measurements. In those cases, you have no choice but to design and build your own measuring devices. Although you could build them using trial and error, having a way to model them first to see how they will behave is a much better choice—in steps oregano. With oregano, you can design your circuitry ahead of time and run simulations on it to iron out any problems you may encounter.

The first step, as always, is installing the software. Most distributions should have a package for oregano available. If you want to follow the source version, it is available at GitHub. Oregano also needs another software package to handle the actual simulation. The two packages it currently can work with are Gnucap and ngspice. Either of these two packages needs to be installed in order to do the calculations for the simulation. While this is handled automagically by your distribution's package manager, you will need to install this dependency yourself if you are building from source.

Once it's installed, you will get a blank new project when you first start up oregano (Figure 1). On the right-hand side, you should see a list of elements you can use to build your circuits. It starts up with the default library selected. This library provides all the standard electronic components you likely will want to use. But, this isn't the only library included. You can select from other libraries, such as TTL, Linear, CPU or Power Devices, among others.

Figure 1. On startup, you get a blank canvas and a parts list.

Each of these libraries contains a list of associated elements you can use in your circuits. Selecting one of the elements shows a preview of the schematic drawing of that element in the bottom window. You then can drag and drop the element onto your canvas and start building your circuit. Once you have an element on the canvas, you can double-click the element to edit its properties (Figure 2). You need to click on the "Draw wires" icon at the top of the window in order to connect the elements together into a proper circuit.

Figure 2. The property window depends on which properties are available for that element.

All circuits have some necessary components to make an actually functioning circuit. The first of these is the ground. This element is labeled GND in the default library. Along with ground, you need some sort of power source. In most cases, you will want some form of DC current. This is provided by the element labeled with VDC in the default library. With those two important elements in your circuit, you can go ahead and wire up the rest of the circuit.

Once you have a circuit made up, you will want to run a simulation to see how it behaves. Because of the nature of electrical circuits, you need to put sensors into the circuit to see its behavior. You can click on the "Add voltage clamp" icon at the the top of the window to select the sensor object. Then, you can click on the areas of your circuit where you want to measure during the simulation. At each point you click, you will see a new icon on your circuit marking a sensor location. Double-clicking on the clamp will pop up a window where you can set the parameters of what is being measured (Figure 3). You need at least one clamp in your circuit before you can run a simulation; otherwise, you won't have any measurements to study in your simulation.

Figure 3. Here you can select the properties for the clamp.

Once you have all of your clamp points selected, you can run the simulation and see what happens by clicking on the "Run a simulation" icon at the top of the window (Figure 4). When you do so, oregano opens a new window where you can see a plot of the data registered by the clamp (usually voltage or current).

Figure 4. Plotting the results of a circuit clamp.

When you do analysis, you have the choice of two different circuit analysis programs: Gnucap and spice. On Ubuntu, the default analysis program that is installed as a dependency is Gnucap. This means you need to install spice explicitly if you want to use it instead.

To select the analysis engine, click on Edit→Preferences. In this dialog, you also can set whether the log window will open automatically when needed, and you can set the data paths for the models and libraries that will be available for your circuits. In most cases, you will want to leave those as is.

To help you get started, oregano comes with several examples. Again, on Ubuntu (since that is my current desktop), these examples are located in /usr/share/doc/oregano/examples. You might want to load one of these examples first.

Once you have a completed circuit and want to run a simulation, you will want to set parameters to control this simulation. Click on the menu item Edit→Simulation Settings to bring up the dialog window. The first tab lets you see analysis parameters, such as transient options, fourier options, DC sweep options and AC options. Clicking on any of the check boxes will open up a subset of further options for each of those sections. The second tab lets you set a series of analysis options. You also can set parameters that may affect your circuit, such as the ambient temperature.

Once you have all of the options and parameters set, you can start the simulation by selecting the menu item Tools→Simulate or by pressing F11. Don't forget to attach some test clamps first; otherwise, you will get an error. Your simulation will run and pop up a new plot window where you can look at the values generated within your circuit. You can select whether to look at the transient analysis or AC analysis.

On the left, you will see a list of available plotting options. On the right-hand side, you will find the actual plot of your data. Only the items that you select from list will be plotted, so that means when this window first opens, nothing actually will be plotted.

You also can plot functions of the available values. For example, you could plot the difference in voltage between two separate test clamps. These functions will be available in the list on the left side, so you can select them and have them plotted on the graph.

Additionally, you can include even more complicated elements like full CPUs to your circuit. The problem with these is that the way they respond to electrical signals can be very complicated. These elements need a separate model file that describes this response to signals. Unfortunately, the licensing for model files means that many cannot be included with oregano. You can search the Internet and download the model files for the elements that interest you, or you can create your own model file. In either case, you can place the model files into the directory set in the preferences.

When you actually want to build your circuit, you can export the associated diagram by clicking on the menu item File→Export. You then can export the circuit diagram as either an SVG file, a PDF, a PostScript file or a PNG. Now, you can go ahead and build your new test equipment, secure in the knowledge that you did some initial testing and should get the behavior you need.

______________________

Joey Bernard has a background in both physics and computer science. This serves him well in his day job as a computational research consultant at the University of New Brunswick. He also teaches computational physics and parallel programming.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Pretty impressive work you've

juliaware's picture

Pretty impressive work you've performed here. I truly enjoyed reading most of your posts and I consider your blog great. Please, keep on producing such a quality content. Thank you!GMP Peptides Cosmetic Peptides

Fantastic beat ! I wish to

juliaware's picture

Fantastic beat ! I wish to apprentice even as you amend your web site, how could i subscribe for a blog site? The account aided me a applicable deal. I were a little bit acquainted of this your broadcast offered bright transparent conceptFRP Push Button Junction Box

Nice

honeywell mm14chcs's picture

Nice post! Glad I found this.

You would think as the

auto diagnostic tools's picture

You would think as the president of Belgacom, Bellens might choose to be a little less vocal about his concerns surrounding the use of WiFi and cell phones; however, he has no qualms about educating others about these issues, especially those of the younger generation.

Great blog

Anonymous's picture

I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article soonly.Thanks!!
Web Design New York

rine

Anonymous's picture

I like the valuable info you provide in your articles. I will bookmark your blog and check again here frequently. I’m quite certain I will learn many new stuff right here! Good luck for the next

info

Anonymous's picture

India Website Development Company I like the valuable info you provide in your articles. I will bookmark your blog and check again here frequently. I’m quite certain I will learn many new stuff right here! Good luck for the next!

Linux rules

Rajaa67.jar's picture

I am an electronic engineering graduate, I love using linux and i will give a try to create electric components but am not sure it will work. Is there any best linux supported softwares to edit/create 3d characters? Thanks for your post

Oregano online?

Signality's picture

Is there any way you can make this so that it can be run in the online?

Could it be integrated somehow with http://ngspice.com to provide a schematic capture front end and a nice GUI?

There are several online/cloud based schematic capture/simulation sites but they are all:

i) closed source;
ii) subscription (or becoming so);
iii) too basic to use for serious work.

Porting Oregano to work as an online tool would be a fantastic achievement for FOSS!

thanks, Linux could rule

Marjorie Lanphear's picture

thanks, Linux could rule microsift. I love linux OS. I can do anything and everything. But Microsoft has nothing but visual graphics. Its is true that In most cases, we will want some form of DC current.

  • Numerous australian gamblers are getting bored with pubs and land based betting site and they are usually generating the transition to dark knight pokies. You'll find loads of pros to on-line betting site .

Bless you for taking a few

Liza's picture

Bless you for taking a few minutes to publish this. I understand where you are coming from on this article however , I do believe that there are more desirable solutions.
voyance gratuite par mail

But, this is not the sole

Helen McLain's picture

But, this is not the sole library enclosed. you'll choose from alternative libraries, like TTL, Linear, hardware or Power Devices, among others.

The geda tools are pretty

Anonymous's picture

The geda tools are pretty nice for simple boards. gschem for schematic
capture. ngpspice and nutmeg for simulation. gnuoctave and gnuplot for
prettier plots. pcb for circuit board layout.

Reply to comment | Linux Journal

get ex girlfriend back from another man's picture

Howdy I am so glad I found your blog, I really found you by mistake, while I was looking
on Yahoo for something else, Regardless I
am here now and would just like to say kudos for a tremendous post and a all round
enjoyable blog (I also love the theme/design), I don’t have time to read through it all at the moment but I have bookmarked it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do
keep up the awesome jo.

Linux could rule microsift. I

David Roberts's picture

Linux could rule microsift. I love linux OS. I can do anything and everything. But Microsoft has nothing but visual graphics. Its is true that In most cases, we will want some form of DC current.

  • Betting at this excellent on the net gambling site could hardly be less difficult and you really are planning to enjoy each of the bell and whistles in the online gambling slots, craps and poker tables too.

It's always very useful and

Blogging's picture

It's always very useful and also packed with a great time for me personally and my office colleagues to visit your website nearly thrice a week to read through the fresh items you have

Great

Keijo's picture

I was not aware of this Oregano so thanks for that.

I really need to check this as the one I was using was some other Windows program through wine. This can compliment nicely Kicad in Linux :)

Reply to comment | Linux Journal

part time work from home's picture

Yesterday, while І waѕ at woгk, my сousin stolе my
apрle iρad and teѕted to see if іt can survive a fοrtу foot drοp, just so shе cаn be а уoutube
sensation. My iPad is now broken and she haѕ 83 views.

Ι know this iѕ totally off topіс but
Ι had tо share it with sοmeοnе!

Reply to comment | Linux Journal

business home based's picture

Keep on ωоrking, gгeat јob!

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState