Jump to content
 

Using Ardunio to control signals


mwrosebury2000

Recommended Posts

  • RMweb Premium

I've used Arduinos for several things including controlling colour light signals on my layout Waton. Very easy to program and you can get the Arduino Pro mini for a couple of quid.

 

Cheers

Dave

Link to post
Share on other sites

Hi

 

Yes, tried it, I have part written a program to do this, which interlocks the levers (uses a red led to indicate a locked lever, rather than an actual lock) with the point and a bracket signal. I'm using servos for semaphore signals, but the principle is similar.

 

I haven't worked out how to implement an FPL, but it would be nice to do so in a reasonable fashion.

 

Trouble is that the levers require a pin each, as do the LEDs, and the servos. So with the FPL, you're looking at 12 pins, from a possible 14, and this for a single facing point and 2signals.

 

Whilst easy to program, and connect, it isn't the cheapest route to a lever frame.

 

I've just joined MERG, so will have a look at their offerings in due course. You could look at that option too.

 

Kind regards

SD

Link to post
Share on other sites

  • 3 weeks later...

Hi all, I did invest in an original Arduino Mega (£40), but once I had some experience in programming, I bought one of the compatible boards (£15). 

It looks the same and appears to work the same, and for £15....a bargain!

 

hi Trainshed

 

any weblinks?

 

thx

SD

Link to post
Share on other sites

If you run out of digital inputs and outputs it might be worth looking at the Arduino Mega which has 52. More expensive but...

 

 

Shift registers are a very cost effective way to add extra digital I/O when device pins are limited.

You only need four pins to add almost any quantity of inputs and outputs.

Link to post
Share on other sites

Hi Simond,

Unfortunately, the ebay seller that I got mine from has stopped listing, which is a shame, as I was going to buy another one.

 

I did a quick search and came up with this...

 

.http://www.ebay.co.uk/itm/REVISION-3-Arduino-compatible-Mega-2560-ATmega2560-Free-USB-Cable-/130838706117?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1e769837c5

 

or this....

http://www.ebay.co.uk/itm/Arduino-Compatible-Mega-2560-R3-ATEMAGE16U2-Latest-Ver-for-Arduino-IDE-01054-/221372214177?pt=UK_Computing_Other_Computing_Networking&hash=item338acfeba1

 

There are quite a lot of people selling Arduino clones, but as the board is open source, they (should) work the same.

 

As someone said earlier, regarding multiplexing outputs, I have used a 4051 multiplexer which gives 8 outputs from 3 Arduino pins. I have also cascaded the 4051s to give 42 outputs from 6 Arduino pins. Be warned though, this entails soldering a quite a lot of wires!

 

I use VB.net to interface and control the Arduino via USB.

Link to post
Share on other sites

As someone said earlier, regarding multiplexing outputs, I have used a 4051 multiplexer which gives 8 outputs from 3 Arduino pins. I have also cascaded the 4051s to give 42 outputs from 6 Arduino pins. Be warned though, this entails soldering a quite a lot of wires!

 

You only need three pins to give any number of outputs using shift registers. Add a fourth pin and you can read in any number of inputs too. As an example, using a single page of RAM (256 bytes) for each direction as a memory store, that adds up to 2048 outputs and/or 2048 inputs.

Conventional multiplexing gets increasingly unwieldy once you start having to cascade devices.

Link to post
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • RMweb Premium

For anyone interested here is a sketch for the Arduino to control up to 6 semaphore signals operated by servos. There is a facility to reverse the movement and set the limits of throw for each servo using a push to make switch. There is also a 5v output on analogue pin 1 whenever the servo power supply needs to be on to move a servo which can be used to switch a relay via a transistor or somesuch.

 

The servo movement includes an initial pull-up as the signal is cleared and a bounce when it is returned to danger.  I've used this with an Arduino pro mini for controlling a couple of signals on one of our club layouts.

 

Semaphore6_0_1.ino

 

Cheers

Dave

Link to post
Share on other sites

  • 4 weeks later...

I have a couple of Arduino clones, a Mega 2560 and a Nano. They're both fine, and were dirt cheap, the Mega was on sale and cost about $14AUD I think.

 

The Mini Pro clones seem to be the best value for money, I'll probably use them from now on. It seems you can get these for less cost than buying the chip, never mind all the supporting circuitry.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...