RoseOnRails – LEDs and Rails

Yesterday night, Alexis managed to control the LEDs with a STM32 discovery.
We then pierced a rails segment and stuck the strip under it to see how it all worked out !

In fact, it was quite easy to have the strips fit under the railway, and the result is mesmerising … see for yourselves!

However, the way the LEDs were controlled for this test, does not enable us to have other threads in our programme because we need a quite precise timing to send information to the LEDs strips.

What we will do is :
Transfer our data (LEDs colors) to the external port of our development board through DMA and send the information from the board to the LEDs strips thank to SPI.

RoseOnRails – A new lead regarding our position issue!

Hi everyone,

We have a now lead for our train positionning issue. We would like to keep certain LEDs lit up on the railway. Each of those LEDs would be landmarks and have different colors. The color of those LEDs would be detected thank to color sensors placed underneath our locomotives, so that each locomotive would be able to know its position when they run on those LEDs.

As  a matter of fact, we don’t need to know the position of the locomotives at every single moment, this information is only useful when a locomotive runs above a LED which is part of the game.
As we’ll know which of these LEDs wil be lit up, the train will be able to count the LEDs they run on with regard to the last landmark they were on. Consequently, this system will enable us to know above which LED the trains will run when they do so.

The only thing we need to implement this system now are color sensors. I have looked  up the color sensors models on the internet and have reduced my choice to 5 of them. I just need to find the right one today!

Have a nice day!

RoseOnRails – Guess what we received !

Hi everyone,

We finally received our thirty one-meter LED  strips!!
I am going to start playing with them tomorrow !


After the turmoils of Friday … preparing for next week’s PSSCs!

Hi everyone,

Over the past few days, I have worked and learnt a lot.

First off, I have had the occasion to learn a lot about my STM32, notably during Friday’s Challenge! I have spent more than 10hours with my beloved development board and have tried to make my way through the diverse url of the test with it. Friday has been a tough yet challenging day for my STM32 and I!

After this day of great turmoil, I have decided to focus on the BLE. I have thus had the pleasure of making acquaintance with my Nordic chips. I have started by flashing an example given by Nordic on both boards, but unfortunately, I have not yet managed to make it work since I cannot communicate properly with my dongle through minicom … on both my computer and the A406 machines …

Concerning RoseOnRails, Gleison, Valeh and I have split tasks for the week. As usual, I am going to tackle the issues regarding the LEDs stips. Since we won’t receive them for two to four more days, I am going to write a test for them on my STM32, so that I can play with them as soon as we they arrive! I also need to recover the Hall effect sensor from a former project and borrow some coils from PLUME to test the possibility of deriving the position of the locomotives with Hall effect sensors.

RoseOnRails – LEDs everywhere!


On Friday, I found an interesting LED strip which is called Neopixel and is sold by Adafruit. This LED strip seemed to be exactly what we were looking for: a strip of addressable LEDs individually controlled by a PCB which can be modulated through the use of  a 8 bit PWM … However, as we  need 28 meters, 17$ a meter seemed somehow expensive!

I then looked up for LED strips on aliexpress and alibaba and found out that there were mainly 3 types of LED strips. The LEDs in those LEDs strips can be controlled bu PCBs such as : WS2811, WS2812/WS2812b or LPD8806.

The LPD8806 controllers are poorly documented (it is very hard indeed to find proper information concerning timing constraints in the datasheet) and after having navigated on various forums, notably on the adafruit forum, it seems that the timing for LPD8806 is somehow hard to control, and thus the PWM and the LED colours are hard to control.

The WS2811 are 6 pins controllers for LEDs, seem easy to use and are well documented. Though very interesting, the WS2812 and WS2812b provide better performances (more powerful LEDs), with fewer pins (only four) and are easier to find on the internet. WS2812b is merely an enhanced version of WS2812 and provides mainly mechanical improvements to the IC.

In the light of the above, we have decided to use ws2812b LED controllers.
We will run some tests to see if it is possible to locate the trains thank to the LEDs, as soon as we receive our first meter of LEDs strip!

RoseOnRails – LEDs … It’s on !

Hi everyone,

This week I am in charge of answering all the questions we have about the LEDs we are going to put underneath the railway. Today, I answered some of them:

– How will we control the LEDs ?
After having discussed with Alexis, we found two solutions:
1. We can put independent LEDs underneath the railway and control them thank to PCBs ; each PCB would them be wired to one of the railway switches PCBs. This solution involves a lot of wires !
2. We can use ribbon of LEDs. Though the LEDs would we on a same line, each of them could be controlled independently thank to a ribbon controller. Each ribbon would then be linked to a railway switch PCB.
I personally prefer this solution, because it involves less wires than the first one …  Moreover, I have looked it up on the internet and have found numerous models of ribbons with different number of LEDs per meter, and different caracteristics. We will choose the LEDs ribbon according to how many LEDs we want, the length of the ribbons, the colours and the way they are controlled.

– How many LEDs ?
It would depend on the ribbons we can find, but approximately one for 5 centimeters.
I will measure the total length of the railway tomorrow.

– Will the LEDs be used to determine the position of the train ?
In our game, the only moment when we need to know the exact position of the train is when the train rolls over a LED ; so that it seems logical to determine the position of the trains thank to the LEDs. We will put an optical sensor underneath the train which will be able to determine when the train actually rolls over a LED.
However, we need to know which LED a locomotive rolls over. In order to do so we will modulate the light of each LED differently so that they send the accurate information to the central station and the good LED is shut down. (We now need to make sure the ribbon we will find will enable us to modulate the light of the LEDs).

– In which colors ?
If we use LEDs ribbons, we can easily use LEDs which can change colour.

Today, I answered a lot of questions regarding the LEDs ; but the answers have brought a lot more questions!
All those questions should be answered by Sunday.

By the way, I also managed to light the LEDs in my STM32 thank to the buttons! I think I have finally understood the events in ChibiOS!


RoseOnRails – Crazy game ideas !

Hi everyone!

As Gleison mentioned in his post, on Friday we decided that our project would be a multiplayer game in which every train and the railway switches would be controlled by a player through a smartphone, a tablet or  a pc.

A few hours ago, I ran into allegrem and we discussed a bit about this game. After an intense brainstorming session, we came up with several ideas for RoseOnRails: The ideas we had were based on the fact that each user would control a train, and see the state of the railway on his smartphone and that we’d put virtual (or not) “coins” on the rails which each player would be able to see on their screen. With this system, we ‘d be able to implement games such as Pacman, Snake, multiplayer snake, Mario Kart (Mario Train in this case), simplified versions of Railroad Tycoon, etc.

When I submitted those ideas to the team, we discussed more about those games and especially their feasibility. Finally we decided that we would  put LEDs on/near to the railway to represent the “coins” or “tokens” in our game and that every player would control their train in order to gain more “coins”. Each player would be able to see the state of the railway on their device and only the one with the largest amount of “coins” would be able to control the railway switches. If we manage to implement such a game, we reckoned it wouldn’t be too hard to transform it in  a Snake or a Pacman game afterwards.

Today, Valeh, Gleison, Yann and I also discussed a lot about the BLE modes in our system (Valeh did a scheme! I think you’ll be able to see it soon!), the steps of our project and we are currently working on the PSSC.

I also finally found the magnetic sensors under the railway which were used to detect the position of the locomotives in the SaMoRa Project. Tomorrow, if I find a mutlimeter, I’ll try to figure out how those work and see if we can put such magnetic sensors underneath the locomotives.


RoseOnRails – We learnt some useful facts today !


This morning, Valeh, Gleison, Yann and I had the opportunity to meet with Clément Perron who had worked on the locomotive for ROSE in 2011 and thus we learnt a lot on his project : SaMoRa. He explained to us how they had built their architecture etc. which helped us understand how the locomotive and railroad were controlled and determine what we had to do next.

Thank to this encounter plus several discussions we had with Alexis and Samuel throughout the day, we made up our minds about some aspects of our project.
And because a picture is a worth a thousand words, you’ll find our idea of architecture bellow… this is a draft



(Only one railroad switch and light are represented, but there would be several sets as such. Ideally we’d like to have a PCB underneath each “railroad switch-light” set)

While designing our new draft of architecture a lot of questions arose:
– What kind of technology should we use to locate the locomotives ? RFID ? Optical sensors ? Magnetic sensors ?
– How will we regulate the voltage in the locomotive ?
– How will we control the motor ?
– Which kind of microcontrollers should we use ? Should we use STM32 like SaMoRa did, or a microcontroller with a BLE interface ?
– Cost-wise, will it be possible to put a PCB with a BLE interface underneath each railroad switch ?

We’ll try to tackle those questions in the following days !

PS: This afternoon, we finally managed to open the locomotive! Yay! We now know exactly how much space we have to integrate a PCB and other cool stuff in it 😉 Tomorrow we’ll try to understand better how it works, and determine what we have to change and what we have to keep.