How to drive train models
#21
Posted 05 April 2012 - 12:57 PM
#22
Posted 05 April 2012 - 05:40 PM
#23
Posted 05 April 2012 - 05:41 PM
#24
Posted 05 April 2012 - 06:01 PM
can you give a look at this thread?
http://www.avrfreaks...ewtopic&t=60979
It looks like leveraging low data frequencies, some result can be obtained.
I cannot understand the technical details, but someone agrees, some other not! :-)
Andrea
#25
Posted 05 April 2012 - 06:54 PM
http://www.ti.com/li...441/slyt441.pdf
It looks interesting.
Andrea
#26
Posted 05 April 2012 - 09:06 PM
Threads will always have people that disagree. There are some basic recommendations in the thread you found:
- use a slow clock speed, the SPI interface becomes more reliable when you slow down the clock,
- use filters to try and remove high frequency noise,
- use logic chips to clean up the signals before they go to the next device,
- use cables that have shielding (a metal screen around the outside of the cable).
If you have the time and some parts you might try it out with one or two shift registers to see if it can work on your railway. I'm sure there would be lots of interest in your results on the forum.
The Texas Instruments note goes into detail on what the problems are.
They end up suggesting using some transceiver chips (SN65C1167) that are used for RS422/RS485 interfaces. This will cost more to implement, but it will be more reliable and may make the system work.
Regards - Paul
#27
Posted 05 April 2012 - 09:41 PM
#28
Posted 09 April 2012 - 02:01 PM
I still didn't try any of the solutions already kindly proposed (for example, direct SPI connection with a 74HC595): I made e new order of components, but they failed to arrive (it's Easter time! :-)).
So I went on looking at ways to solve *easily* the problem (SPI is not certain to function over a distance...).
Now I spot this component: http://www.nxp.com/d...eet/PCF8575.pdf
...that for a newbie like me looks like what I'm looking for! May I control this component (many of them) directly from a Netduino?
Thanks again to whoever will help me in choosing the solution.
Andrea
#29
Posted 09 April 2012 - 02:40 PM
That device looks very good - especially since it gives inputs and outputs. But, I don't think it will be any better than using SPI.
Finally, I do *NOT* suggest the I2C. That's because it's an (awesome) bus, but it's not targeted for long wiring, nor for "noisy" environments, such where are motors, AC, etc.
There is one small advantage with SPI, the signals in SPI are not bi-directional. This means it should be easier to add some logic gates or analogue electronics to boost the signals if necessary.
Don't eat too much chocolate - Paul
#30
Posted 09 April 2012 - 03:38 PM
Coming to the problem, yes, I read about not too long distances with I2C, but then I also read documents like this:
http://www.esacademy...ns/i2c-faq.html
or this:
http://ics.nxp.com/products/i2chubs/
where is explicitly said about hundreds of meters or even kilometers...
Do you think they are believable, or is there something hidden? :-)
Andrea
#31
Posted 09 April 2012 - 04:32 PM
Yes I think they are reliable.
The question is what will work on your railway.
The first one talks about reducing the clock speed to achieve very long distance communication (100m) - I assume this is with perfect conditions (no electrical noise).
It also talks about using better cable (twisted pair and/or shielding) to help stop noise causing bad signals.
I liked the "galvanic decoupling" circuit, I had not seen a circuit to do that before. It would be great to use this to drive a set of fibre-optic cables on the railway - expensive, but that would really be immune to electrical noise!
The second link has a list of the devices that are available (from NXP) that can be used to extend or clean up the I2C bus. It looks like they have thought of almost everything!
Again it looks like you will need to try it and see what you get. It should be really simple to slow down the clock*. If that works - great. If not try the better cable. If still not, maybe use some of the NXP devices.
It all comes down to how much time (and money) you are willing to spend experimenting.
* - check this is possible, I have not tried using I2C on the Netduino.
Note that you can only have 8 x PCF8575 on the same bus. So you will be limited to 8 x 16 input/output pins.
Regards - Paul
#32
Posted 09 April 2012 - 04:40 PM
Thanks for the offer of a free dinner and well done on the research!
Threads will always have people that disagree. There are some basic recommendations in the thread you found:
I think all of these things will help, but the railway may still have too much electrical noise for the system to work reliably.
- use a slow clock speed, the SPI interface becomes more reliable when you slow down the clock,
- use filters to try and remove high frequency noise,
- use logic chips to clean up the signals before they go to the next device,
- use cables that have shielding (a metal screen around the outside of the cable).
If you have the time and some parts you might try it out with one or two shift registers to see if it can work on your railway. I'm sure there would be lots of interest in your results on the forum.
The Texas Instruments note goes into detail on what the problems are.
They end up suggesting using some transceiver chips (SN65C1167) that are used for RS422/RS485 interfaces. This will cost more to implement, but it will be more reliable and may make the system work.
Regards - Paul
What about breaking the problem down into discreet components, all orchestrated by a master controller? This will require a little bit more on the cost side, but should allow for better expand-ability.
So the issue as I understand it is how to reliabely get a single over a longish distance? The a complete RF transceiver module with the NRF24L01+ chip can be had for $2.32 on eBay. Use that as the communication link between modules. And use a Netduino Mini at each point to do the comm and handle turning on the LEDs, etc.
Just a thought.
-dan
#33
Posted 09 April 2012 - 04:41 PM
#34
Posted 09 April 2012 - 05:04 PM
Hi Dan,What about breaking the problem down into discreet components, all orchestrated by a master controller? This will require a little bit more on the cost side, but should allow for better expand-ability.
So the issue as I understand it is how to reliabely get a single over a longish distance? The a complete RF transceiver module with the NRF24L01+ chip can be had for $2.32 on eBay. Use that as the communication link between modules. And use a Netduino Mini at each point to do the comm and handle turning on the LEDs, etc.
Just a thought.
-dan
Its two problems in one - the distance (I think Andrea said its around 10m) and the noise caused by the trains on the railway.
I think the distance is not too much of a problem, others have used I2C to read temperature sensors at several meters OK.
The potential killer is the electrical noise causing false clock edges that appear on the serial lines causing bad data.
Mario felt that I2C would be unreliable, he is a good source of information for analogue electronics - I don't have any experience of using I2C in this sort of environment to be able to say yes or no.
I like the "NRF24L01+" RF transceiver idea, but it may also have issues with noise working in the electric railway environment.
(do they sell Perugina's Baci - Kisses, in Reading? Ever tried one? :-))
...
P.S.: next in list would be the automation of the 'crib' in my church, for Christmas... (I don't know if 'crib' is the righe word, I found it with Google Translate)
Hi Andrea,
No I have never had "Perugina's Baci - Kisses", I just Google'd them - they look good!
A "crib" is a bed for a baby.
Do you mean the nativity scene (small models of Jesus, Mary, Joseph, ...)? No trains there!
Paul
#35
Posted 09 April 2012 - 05:54 PM
#36
Posted 09 April 2012 - 05:57 PM
http://www.baciperug...na_history.html
But don'ask for more boxes, I'll send one only to Paul! :-)
Andrea
#37
Posted 09 April 2012 - 06:21 PM
...and for anyone interested in Netduino AND chocolate, here it goes...
http://www.baciperug...na_history.html
But don'ask for more boxes, I'll send one only to Paul! :-)
Andrea
I can't accept any chocolate until the trains are working.
#38
Posted 19 April 2012 - 02:20 PM
#39
Posted 19 April 2012 - 05:18 PM
Unfortunately the transistor will only pass DC, not AC.
Also 0.5A is a lot of current, so you if you can make it work on DC, you will probably need a high power transistor (maybe a darlington).
(That might be why the 9V battery did not make the points move - 9V batteries can't give out very much current.)
Paul
#40
Posted 20 April 2012 - 03:12 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users