The bigger picture

Now, that the Open IoT Challenge is over, we have some spare time, therefore I try to explain for you how the hardware works and how was made. It won’t be a very long post, you shouldn’t read long paragraphs about electrons or voltage, but I will insert a tons of pictures into it, I should insert a read more link here. But trust me: it is worth watching them!

Superbeagles are on the road!

Previously one of my colleague, Bálint already wrote about why the Beaglebone Black board is so amazing, but in an other post I mentioned our little problem with the hardware – so I did managed to make a Cap for the beagle to make it Superman Superbeagle.

The design:

image

And the reality:

image

With this Cap, the Beaglebones could accept any power source between 7V and 20V, we have 8 pin headers to attach expander panels… oh wait, did I mentioned that we designed expanders also? No? My bad.

Not a rinse commercial: turnout sensation

One of the many responsibility of the hardware is that it need to sense somehow the status of the turnouts. These informations are highly important: some cases, in which trains are moving towards each other, they could collide, so we should stop them; but if the turnout is in the right position, then we could pass one of them through the turnout and even avoid the collision. With this knowledge, we could make the movement of the trains continuously beside the safe operation.

Therefore we made some measurements about how the turnout actuators are work and after that we created a PCB to handle this.

Here is the design:

imageimageimage

And the reality:

imageimage

Section enablers

Okay, let assume that we are getting every information about the track that we need: the location of the trains, the turnouts’ status, and so on, and one time, we need to stop one train: but how, you may ask. That’s the reason why we designed and assembled the section enabler or disabler PCBs: in the near past I wrote about the mechanism.

Design:

imageimage

Reality:

imageimage

The past and the future of the hardware – Part 2

As part 1 depicted, using microcontrollers have serious implications. For the future uses of this project, we decided not to focus on the code generation side, and compress the code into the AVR, but instead invest in a bigger hardware.
With a faster computing unit running a Linux operating system, many projects, and addons can run in the same time, allowing much more people to experiment. With a central deployment system, you can easily deploy applications, operating systems onto the embedded hardwares.

Although Raspberry Pis are great embedded computers, it turned out they are not reliable. It’s not a big deal for everyday applications if the Pi restarts suddenly, but in our application this can be fatal, therefore we have choosen the BeagleBone Black single board computer (SBC). Let’s not forget, our environment is safety critical one, so we need not only computing power, but reliable hardware as well. 

The Beaglebone Black

It has 4 GB onboard flash memory, so you don’t need SD card. The expander header has more than twice the pin count of a Raspberry Pi 2. The Ethernet is not USB-based, it’s handled by the processor. The BeagleBone Black (BBB) is like a Raspberry Pi, but it is more designed for embedded applications, where media capabilities are not priority.

Designing the PCB for Beaglebone Black

In the previous entries, we already talked about that we would use Beaglebone Black units to run our safety logic, but in my opinion, these systems have a problem: they could work only if you provide them 5V power source. Of course it’s not that big problem if you are starting a new project based on these computers, because you could choose your power source as you want.

But in our case, we already had a 12V power source under the hood. Furthermore we should use 12V source to feed railway lights, so we had to find out a solution. In one of my previous entries I already made a prototype, which would do the trick for us. But we need to install this solution somehow on the Beaglebone, so this weekend I designed a PCB (printed circuit board) to place this solution. 

Here is the final version:  

image

Disclaimer: I may call it final version, but every evening I find something to modify. So this is maybe not the final version, but it will have no major modification in the near future.

First try, first failure

At the beginning, I started to design our board with Eagle: this program is a lightweight designer for PCBs, and it’s lovable for its multiplatform quality, so it was perfect for me. But I merely started to design anything, one problem came after another. The biggest of all, I couldn’t find any libraries which would give the footprint of our chosen power module, the TI LMZ22005.

Intermezzo: we chose this module because it’s super easy to install on any design. You should only use some capacitors and resistors, and you are done (not to mention, the values of these elements are also provided by TI).

So, I had to make a decision: shall I go on with eagle and design the footprint of the power module myself, which hold the danger of faulty design, or choose another program and learn how to use it. Bálint pointed out that he heard good reviews about the Altium Circuit Maker program, and after a short test, we decided we should give it a try.

Can I invite you for a cup of coffee?

If you are starting to use a new software, first it’ll be totally unfamiliar for you. So you should learn how it works, how can you accomplish what you want, etc. For PCB designer applications, it’s more difficult: they have great set of functionality, tremendous preferences. That’s why for the first couple of hours I had to work as “we were just getting to know each other”.

image

But in the end, I managed to design the circuit. I chose every elements of it (it’s a big help that you have oodles parts from Octopart which you could use), I “just” had to route the PCB itself.

The routing

So, after the logical design, you have to place every element on the board and figure it out how you should make connections between them – that’s the routing. For a senior PCB designer, it’s not that hard to do, but for me, who had no experience at all in making PCBs and in the program also, I had my lesson.

image

This work was all about patience: routing every single wire to the right place was not that hard, just time-killing, because measuring distances, the calculating and designing the perfect layout was hard. Not because of the math: if you do something wrong the board would be useless, you have to fix the problems and print it out again, but it costs a lot of money, so you kind of have only one shot. In the consciousness of this I took my time and measured everything twice, rethought anything at least once and I pursued the perfect solution.

image

Everything that has a beginning has an end

After finishing it, I talked to people who had more experience in designing, took their pieces of advice, and now I am waiting for the bid and I am hoping that it will not take us into bankruptcy.

image
image
image
image

Great invention: the buck converters!

Today I worked on the hardware stuff and I managed to build this circuit:

image

And the result is:

image

But what is this and why do we need it? Or, do we need it at all? Keep reading, and you will find the answers for all these questions!

Buck converters

In our future plans the layout will have some signaling lamps beside the tracks, and these signals need 12V to operate. But our chosen embedded systems, the BeagleBone Black cards need only 5V. Therefore, if we want only one power source which feeds all these devices, then we need to scale down
12V to 5V somehow.

Intermezzo: why would we use only one power source? It’s really simple: it makes the wiring simpler, there will be no more power sources and power lines, and the power loss on the wires will be no harm for us. Furthermore, it makes the future maintenance lot more easier.

With linear voltage regulators this would waste 7V on heat, and that means we will have efficiency of ~41%. Just waste of energy!

About 6 months earlier, I’ve started searching on Youtube for channels working with electronics, and I must admit that the whole idea came from this video:

So buck converters do a little magic trick: they get an input
voltage and they transform it up or down to higher or lower voltage –
with really high efficiency (about 90%). This is a very good news for us,
because that’s what we want and we can’t find a better solution for this purpose!

Some measurements – only for the hardcore readers

So, after I put the layout together I made some measurements. First, I connected the BeagleBone card to my power supply directly without any buck converters. That’s what I measured:

image

In this case it’s clear, that the output voltage is 4.99V and the card consums 310mA.

Then I added our new prototype as you can see in the following picture:

image

On the image you can see that the BeagleBone is connected to the output of the buck converter, and the buck converter is connected to the power supply by the black and red hook. Then I started to turn up the voltage on the power supply:

image

At 7,78V the current consumption is started to decrease…

image

And that’s what I am talking about! If we supply our card from 12V, it consumes only 70mA, only 22% of the original consumption!

Do the math (don’t hate me)

First, let’s Google the definition of Electric power:

The electric power in watts produced by an electric current I consisting of a charge of Q coulombs every t seconds passing through an electric potential (voltage) difference of V is:

image

Then some calculation:

  1. If consumption is 0.3A on 5V, our system will consume 0,3A*5V=1.5W power on each BeagleBone card.
  2. but, if it consumes only 0.07A on 12V, then the power consumption is 0.07A*12V=0.84W.

This is 45% more efficient than the other solution, and we just saved 0.66W power on each BeagleBone. That’s where I became so happy that I started to write this entry, so… the story ends here. Thanks for your attention, I hope you found this entry useful!

zsoltmazlo

What this project was all about

Before we start to post videos, photos and other stuff about this project, I may say something about this project’s history.

It started back in 2014, when we jumped into a project to desing embedded systems and a model railway demonstrator. So with one of our member, Benedek, we started to build something. We literally had no experience with embedded systems neither with model railways, so the first attempt to create this system – let’s be honest – failed. We wanted to use model based techniques for the development, but we were not able to upload any complex, generated code to the system, which was based on Arduino Ethernet boards. We could only use hand-written code with small complexity.

Intermezzo: why we choose Arduino for the first place? Because I was the one who had some experience with embedded systems, and I only knew Arduino, and needles to say, I was convinced that it would do the work.

Furthermore, these units (like one on the picture) were so customized ones that even uploading code was a disaster – I don’t know what we did wrong, but our serial-converters which needed to upload the code were starting to die after a short time of usage.

But, either way we managed to implement an interface for the layout to be able to stop trains. We could read from the layout where the trains were, but nothing more. So our safety logic was a bit harsh with the trains – they had to be stopped a lot. This was the time when we realized that we need the proper hardware for this project. And then we could speak about any further developments.

Researchers’ Night (Kutatók éjszakája in Hungarian)

But, we worked a lot, we had some results in the field, so we went to the Researchers’ Night to present the system. There we showed this small and stupid system to people, we talked about it, showed it to kids and adults and tried to brought them closer to IT. And grab their attention.

image

It was a huge success, I think I could say that they loved it (especially the kids). We were really happy with the feedbacks, so we decided to enhance our system, change the components and the software and to build a completely new sytem on top of the former experiences.

And that’s where the IoT Challenge came across.

Because when we heard about this challenge we decided – we are getting back to square one, start to redesign everything (beside the track), start to make better plans, make more research about embedded systems, modern techniques and make a project which could be really used to demonstrate the model based development of complex systems.

zsoltmazlo