Arduino WiFi shield

I just realised I haven’t blogged now for over a month!

Life has been very busy with work and stuff and this project has taken a back seat. That’s ok with me as I don’t want to just charge into this and finish it all because then all the fun is over.

I’ve been working (in my free time) on getting the WiFi shield integrated into the DCC++ base station code. It’s currently connecting to my home WiFi network and I can ping it successfully but it’s not accepting a client connection using telnet. I’ll probably have some time to work on that over Easter – probably only needs a couple of hours.

I’ve also started looking into detection hardware so I can tell when a locomotive or car passes a point on the track. Looks like RFID is the best solution but I’m holding off until I finish the WiFi connection.

Points are switching

I got back onto the points this morning and after a fair bit of messing about figured out that you have to program the Arduino with the points it will switch using this command

<T id addr offset>

for each of the points where id is the id referenced in the controller and addr and offset are the physical address of the point. Once they are all set, then issue

<E>

to write the data to the Arduino EEPROM.

These values can be written using the serial monitor in the Arduino software.

Doing this enables the Controller to send <T id n> to the base station to activate the point servo with ID id where n is 1 or 0 to set or unset the point.

The controller software now looks like this. I’ve changed the look of the track (so it looks more like track) and I’ve made the switches show up on the layout so I can see where to click.

DCCpp_Controller2

Bluetooth … Harold is not happy

I purchased a Bluetooth module to attach to the Arduino today. I connected the leads from it GND – GND, 3.3V – 3.3V, RX – TX, TX – RX. I got the little flashing red light happening on the Bluetooth module, but no communications. In fact, it kept locking up the program which was a bit of a nuisance.

Ah well! The best laid plans of mice and men as they say… I screwed the Ardui-Motor to the table so I could make safer semi-permanent connections and got the locomotives moving again. This time, I also connected DCC power and set the jumper on the Octocoder and got the turnouts running under computer control! Unfortunately I have 11 turnouts and the Octopus3 will only run 8 of them at a time, so I’ll eventually have to get another Octopus3 to complete the setup. That’s ok because I plan to have an additional 4 turnouts on the layout yet.

This is the DCC++ Controller screen on my PC. I’ve diverged from the codebase pretty substantially.

DCCpp_Controller screen

I’m very still pleased to see that I don’t need an expensive controller to run things. Hooray for Arduino and DCC++ (Thanks Gregg)!