I Sensor a Disturbance

IR SensorWell, Terry Terrance has done it again. After watching a video he posted recently and reading his description of the circuits he used to create a Back ‘n Forth Shuttle, I had to rush out and buy some photoelectric sensors. The idea, of course, is to position these at ends of tracks to sense when a train gets to the end of its run. Combine that with the relays mentioned in an earlier post and either the Raspberry Pi or some other controller, and I should be able to completely automate a small shelf switching layout. Such as my EuroNook.

What I need to do now is get building. The programming really shouldn’t be very hard – just sense the train when it crosses the sensor, set the switches to whatever desired position, and then send the appropriate power to the tracks to make the loco move. My problem is that I am much more comfortable with that programming and electrical part of the build than with the actual creation of the little layout. I am sure it would be exactly the opposite for a lot of folks, but putting knife and glue and paint to wood and such is a whole lot harder for me than programming.

If only all of life was as easy as just hooking up a few sensors and then reacting to what they tell you. If “train” then “buy”. If “cat” then “pat”. If “wife” then “apologize”. See how simple?

TI LaunchPad, Relays and Rail In Action

More fun with the Texas Instrument’s Launchpad! But sorry, but not mine. This belongs to Model Rail Radio contributor and great RR guy Terry Terrance. Terry has been working late tonight to put together a diorama for he Streetsville Junction NMRA Regional this weekend. He has a TI LaunchPad controlling the back ‘n forth shuttle of an On30 loco across the diorama. Pretty simple, but it could be expanded to arbitrary complexity to include automatic routing, etc. Terry saus he made one error in the narration – the relays are SPDT not SPST. The two SPDT relays are wired as a DPDT and are thrown simultaneously by the LaunchPad. Here’s a video of it in action.

[tterrance1]

I am hoping to build something like this soon, and I will update this blog as I make some progress. Basically I would like to automate the EuroNook that I started building in an earlier post. Whether I will use the LaunchPad to control it or maybe the Raspberry Pi has yet to be seen. Actually I was thinking that if I design the interfacing correctly I could swap the control mechanism between totally manual, LaunchPad, Arduino, Raspberry Pi, or maybe even JMRI just depending on what I hook up.

Automating Apple with AppleScript

If you have a Mac and are even the least bit interested in automating the work you do on it, you need to pick up a copy of AppleScript 1-2-3 This is part of the Apple approved training series of books and is written by Sal Soghoian.

Apple AppleScript BookSoghoian being the author of this book is significant for two reasons. First, he is the product manager for AppleScript. He has been using and working with AppleScript for years. Simply put, nobody knows more about what AppleScript can do that Sal Soghoian. Second, he is a great teacher. If you have ever heard him speak at a conference or maybe seen one of his podcasts on MacBreak Work, you will already know this. If not, you are in for a pleasant surprise. His style is light and friendly without being causal and silly. He has the rare ability of making technical subjects easy to read – and not a cure for insomnia.

AppleScript 1-2-3 is a large volume of nearly 900 pages that is broken down into three broad sections. Starting with the absolute basics in the first section, Sal and his co-author Bill Cheeseman, take you through the fundamentals of scripting with plenty of examples and explanations. The second section takes what was gone over in the first section and expands on it. This second section goes into more tools, tips, and methodologies to make your scripts both easier and more powerful. Finally, the third section of the book takes you through specific examples of fully working useful scripts that you can use, modify, and make suit your own purposes. This section give you a strong toolbox to start you on way scripting.

Many people who move to the Mac lament the fact that they can no longer use their trusted MS-DOS batch files. Or, as in my case, don’t have VisualBasic aka VB to play around with. The truth is that Apple’s AppleScript is much more flexible and powerful. The problem is, as with using VBScript in Windows, there is a bit of a learning curve to unlocking the real power. This book is the answer to that problem. From automating repetitive actions to performing complex series of actions, the power you need is there. This book can help you harness that power.