Everything’s ready! Before turning on the system, ensure that everything is as follows:
- Electronic components placed on the diorama and properly connected to the sensor shield;
- Sensor shield inserted above Arduino;
- Arduino connected via USB to Raspberry;
- Power supply connected to sensor shield (for powering: Arduino + sensor shield + all components);
- Raspberry power supply connected to Raspberry;
- USB webcam (if present) connected to Raspberry;
- Other power supplies connected to motors and lights (if present) via the relay module;
- Raspberry software written on MicroSD and MicroSD inserted in Raspberry.
To turn on ArduTrain WiFi, connect the two power supplies (Raspberry and Arduino) to the electric socket, and then any other power supplies for the lights and motors (if present).
Wait for a few seconds while Raspberry is turning on and a WiFi network called “ArduTrain-XXXXXX” (where XXXXXX are numbers) appears. The default WiFi password is: wlegotrains (you can change it later in Settings section). If you cannot connect to the network, please wait a moment and try until you be able to connect.
To reach ArduTrain control panel navigate through a browser of any device at http://ardutrain/ or http://192.168.1.42/
If you prefer, you can connect Raspberry to your network (and then to the internet) with an ethernet cable.
With the system started, we will be able to view the menu of the ArduTrain WiFi application, which consists mainly of the Setup, Routine Configurator, Control and Settings sections.
On the Trains tab we can specify which trains are present on the diorama; in this way, in the control screen, we will find only the speed sliders of the trains that we have enabled. As you can see, there are the same channels and colors of the LEGO remote control: four channels and two colors (red and blue) for each channel; in addition, we can assign a short description to each train and specify whether we need to activate the “Reverse” (if we had the locomotive in the rear of the train instead of in the head).
On the Switches tab we will be able to name our motorized switches and set the straight/diverted position of each of them: the servomotor arm moves from 0 to 180 degrees; my advice is to try different settings for each of the motorized switches (trying to set straight/diverted in the Control section): make sure the yellow lever moves, changing the switch position and that the servomotor does not strain when it is at rest: after switching the position, verify that you don’t hear any buzzing noise, otherwise the servomotor may overheat. If you have bought 4DBrix motors, never set a value higher than 105° or less than 25°, otherwise motors will be damaged irreparably.
On the Lights tab we can name each of the four relays that control the lighting, Power Function motors or eletrified tracks in the diorama.
On the Sensors tab we can name each of the sensors on the diorama.
On the Audio tab we can upload MP3 files (sounds) that we can reproduce through the routines; the limit for a single file is 30 MegaByte.
Now we can click the bar at the top (with the house icon) to return to the ArduTrain WiFi menu.
In this section we can create routines (no more in this website, is all on ArduTrain!). A routine is a list of steps (actions) that are executed sequentially when a sensor is activated (for example when a train passes in front of it).
We can create infinite routines; each routine can contain infinite steps. A step can be these types: “Train” (to send a command to a train), “Switch” (to send a command to a motorized switch), “Wait” (to wait a few seconds), “Disable sensor” (for ” fall asleep” a specific sensor for a few seconds) and “Play audio” (to play an audio previously loaded from the Audio tab in the Setup section).
When we edit a routine, it’s automatically disassociated from any sensors it is associated with: we will therefore have to re-associate it.
We can duplicate a routine (with related steps) and we can order, edit and delete single steps with the small icon on each step line.
On the Trains tab we can move the slider to set the speed of each enabled train (remember to turn on the trains on the diorama from the setup page!), the red STOP button sets the speed to zero, the red STOP ALL TRAINS button stops all trains; to do some tests we can switch on a train (making sure that the channel and the color are the same in ArduTrain WiFi) and we can move the slider, checking if the train moves. In case the train does not move, we can try to fix the pointing of the IR LED modules.
On the Switches tab we can set straight or diverted the motorized switches; let’s remember that the first time we will have to closely monitor the straight/diverted position of every switch. Then, in the Setup section, modify the values slowly and go back to this section to try the straight and diverted positions until the values are correct.
In the Lights tab, we can turn on and off lighting, power Functions motors or eletrified tracks placed in the diorama.
In the Sensors tab we can associate the routines to the sensors for an automatic execution (when a passage of a train activates a sensor) or execute a routine manually.
WiFi connection: here we can change the WiFi password, default password is: wlegotrains
If you have changed the WiFi password and you don’t remember it, you can reset to default password by connecting together these Raspberry pin just for one moment with a jumper (Raspberry will reboot with default WiFi password):
Serial communication: here we can change the Arduino serial port; please don’t touch this value if all is working!
Server address: here we can change the IP address of the ArduTrain server, please don’t touch this value if you don’t know what you are doing! Default value is: default
Export backup: here we can export a complete backup of ArduTrain like elements name, servo positions, routines… but no MP3 audio files: please make backup frequently!
Import backup: here we can import a previous generated backup file to restore all the data (after an ArduTrain upgrade, MicroSd card corruption, Raspberry Pi explosion, … 🙂
Camera mode: here we can choose if we want to see USB camera image or Raspberry Pi camera image in the menu page (we can connect both in the same time).
This was ArduTrain WiFi: have fun! 🙂
You can follow this project on the Facebook page: https://www.facebook.com/ardutrainwifi
You can support this project with a small donation .
You can share this project with this link: www.ardutrain.com .