Skip to content


An IR Led emitter combined with an IR receiver can make an opto-isolator.
By using an opto isolator we can transfer information between circuits without an electrical connection.
In opto isolators the emitter is always an IR LED.
The receiver can be a photo-diode or a photo-transistor.
Photo transistors are transistors using the base as "light" sensor. When light strikes the photo transistor's base, it will conduct otherwise it will insulate.
Photo-diodes, on the other hand, are semiconductors that produce current flow when they absorb light.
There are two types of photo-diodes the photovoltaics and the photoconductors.
The photovoltaics when they absorb light create a voltage difference between the edges.
Photoconductors are reverse biased photo diodes. When they absorb light the reverse biased resistance will decrease.
Notice that a photo-transistor is nothing else than a reverse biased photo-diode + a normal transistor.

Photodiode and photo transistor
Photo diode and photo transistor


...continue reading "Infrared emitters & receivers"

Generics - GUI

When you face the matter of writing duplicated code, an idea generally rises about how to not waste time.

In strongly typed coding languages a simple mechanism exists, aiding the coder to solve the problem.
The so called Template.

They are designed so that classes and functions able to work with generic types, giving them the possibility to operate on different data types without the need of rewriting code for each of them.

Maybe you've just thought about the concept key: the abstraction.
Indeed we're dealing with it in the sense described above: a template is a try to avoid useless repeating code writing, and to do this we're forced to find a more general way than the direct and boring one.

...continue reading "Generics and templates"

Interfaces2 - GUI

By reading the introduction of the interfaces, you obtained a mechanism that makes a class really and completely abstract.

From the article we highlighted their total abstraction.
We noticed that it's contained methods must be overridden by the inherited class(es).
Furthermore a interface does not have any attributes.

Finally we wrote - just on the rush - that the Interfaces mechanism overpasses one compiler's weak point, about the inability to support the multiple inheritance.

In brief: the multiple inheritance in FreePascal grants that an inheriting class can inherits from more than one more abstract class.
It so expands its possibility to enrich itself, always  by keeping the order and the hierarchy achieved with the interfaces.

And that's very good... in theory.

...continue reading "Interfaces and multiple inheritance"

Interface - GUI

We've finished the previous article on inheritance talking about the way used in FreePascal (and in Delphi too) to make a class abstract; we've learned that by declaring just one method as virtual abstract is enough to get the result.

But again we've seen that is not true, indeed.
Theory says one thing, and reality another one! This is a rule you should always keep in mind, because reality always doesn't care of your thoughts. 😉

Back to our example... is there a way to get a true abstract class? Luckily yes!

Ladies and Gentlemen, here the interfaces!

...continue reading "Interfaces. An introduction"

Ok, let's say you want to do a measurement of the short-circuit impedance relating to the electrical system of a house/room/lab/whatever. This is something you usually have to do if you want to choose the correct level of the protective devices.

I'll show you how to do a measurement of:

  • short-circuit impedance in case of a single-phase failure;
  • short-circuit impedance in case of a two-phase failure.

All you need is an impmeter and a multimeter.

...continue reading "How to do a short-circuit impedance measurement"