Now that I have figured out a cheap way of controlling the things (Cheap RC servo and a microcontroller), has anyone seen plans on the internet for building them from scratch…
I know that MR had an article on it in 2003 something - but it’ll be a while before I will be able to get to the one library that has back issues of MR…
I don’t have an answer to your question but could you let the rest of us in on the cheap way you’ve found of controlling the things? It would be a good thread and you might be someone’s hero.
After Googleing, “Scratchbuilding Semaphores,” I came up with this site.
1 RC servo - I have seen them as cheap as $10 cdn…
1 custom programmed micro-controller… Actually this should be able to manage at least 2 servos. Cost of that little device - varies, but I think that this part of it - along with the other odds and end shouldn;t cost more than $10 to $12 - and each one should be able to at least 2 servos (have to give this some more thought)…
Some of the features that I can think of include:
Capability to calibrate the positions of the arm : set the low, middle and up positions electronically rather than have to fiddle with the mechanics. One approach would be to use little trim pots to set this, but my tendancy would be to use a “calibration box” that plugs into the servo driver - and then is unplugged once the points have been defined.
for an example of this concept applied to a car sensor see
www.members.shaw.ca/Villy.Madsen
Another possibility is to pre-code a number of different sets if conditions into the microcontroller, and then pick the desired configuration using the calibration box…
example
1 microcontroller controlling 2 semaphores A & B with # inputs X, Y Z
Active inputs Semaphore A B
none Semaphore is high, green light lit high,Green
X Semaphore is middle yellow lit high,Green
Y Semaphore is low red lit&
Have you figured out what sort of controller to use yet? You could probably run a whole layout worth of semaphores with a single microcontroller - the Motorola S12X might be a good choice. The trick would be the inputs and outputs. The S12X has a few inputs and outputs, but it also has a Serial Peripheral Interface (SPI) input/output bus. It can be used to “shift” inputs into or outputs out of the processor, for example to/from a gang of digital latches or buffers. The S12 can be programmed in C using a PC and a BDM adapter (possibly the most expensive part, but there may be a simple com-port interface option too). The processor itself is inexpensive, as would be the digital buffers for I/O.
The software would first shift in values for all the sensors. Then run the logic to calculate the semaphore outputs. Third, shift the data out to the latches and clock the semaphores.
What do the servos need? I’m guessing a discrete output switching a transistor or relay for a specified period of time?
I would use one of the ATMEL AVR - I am familiar with them and I have a programmer for them. It’s an expensive piece of kit - by the time I bought some headers and a ZIF socket, I think that it cost me $100 .
The AVRs come in a variety of sizes - from 5 usable IO ports to 32 or more. Timers, ADCs, uarts and SPI and TWI and xyz and what not else …
For the most part, the pins can be assigned to function as a simple IO pin, or reassigned to another function. (In the case of the 8 pin one to one of a variety of functions). They run anyway from $1.47 to about $7 or $8 for the 40 pin monster (with 32 IO pins).
The servos need (IIRC) a 1.5 to 2.0 ms pulse every 20 ms. The AVRs all have more or more programmable timers with PWM capability. I suspect that one could probably drive the servo directly - but that might be pushing it. The IO pins will source ~ 30ma. I do believe that the servo requires any significant current for that. The servo itself requires about 5 volts.
The standard AVRs will work from 2.7V to 5.5 V (at up to 20mhz). A low voltage version that will go down to 1.7V is also available - max freq for it is 10mhz. I run them using the internal RC oscillator that runs at 8mhz. As they come that’s prescaled to 1 mhz, but that’s changeable under software control - or by burning a fuse (not really burning it but that’s what they call it)
Once I’m happy with the way they work, I will post the information on my web site. - not a fancy one, but the info’s there
www.members.shaw.ca/Villy.Madsen
I finally got something working last night - but I’m not too happy with it - I spent all of Sunday trying to get it to work - not realizing until I was half way to work Monday morning that when the pulse occurs every 20 ms or so, the frequency is 50 hz not 500hz…
If the darned thing had just not worked at all I might have clued in earlier that I can’t divide anymore. As it was, it sort of worked
I have it programmed so that it slowly moves from from one exteme to the other in 3 seconds.
The last step is to set it up so that the actual settings for the 3 positions can be programmed in the field. A calibration box such as the one pictured on my web site can then be used to set the actual positions of the 3 settings.
The orginal article referenced above used a white led with filters - I am going to use a red/green bipolar led and flash it for yellow. This probably means that I will have to allow the user to calibrate the led as well (% of time that the red/green are lit to give yellow).
So I’m getting there - albeit slowly. Picked up the makings for the semaphore today - a 2x2 sheet of 20mil styrene that should be enough for many thousand semaphores