Skip to main content

Replies sorted oldest to newest

If Stan is confused than I know I am in trouble.

 

However, I do have a crossing gate that I would also place on the IR circuit to active it.

 

I also purchased AXIOM RELAY V23026A SPDT 5VDC PC MOUNT item#381441676844 to hook up the AC part of the circuit. I just have not figured out how to hook it up to the IR circuit.

Not sure exactly what you have and what the "loose" AXIOM 5V relay is for.  I don't know what you mean by "AC part of the circuit."

 

He is what mean by the A/C part of the circuit. I would like to use the IR part of the circuit to active a 5 VDC relay. When the IR detect a train it energized the 5 VDC relay.  The relay itself uses 5VDC however the NC, common and NO would be 18 V AC hence the AXIOM 5 V relay. I was hope to use the IR to trigger the Maiden Rescue or other track accessory. I also have Coal shed No. 97 and the barrel loading accessory that I was hoping that I could IR circuit trigger these events as well.

 

As I have demonstrated before I have great ideas but I lack the skill and know how that you yourself and the  electronic gurus have to make the project a reality but I am willing to learn.

 

This is in the idea stage and suggestion, comments or guidance is welcomed.

ogr%20IR%20module%20itad%20with%20delay%20hookup%205v

The relay on the existing 5V relay module can switch your AC accessory voltage as shown.  I believe you have AC-to-DC buck regulator modules which supply the DC voltage for the IR circuit.  A single buck regulator module can supply 5V DC to multiple IR circuits if that makes wiring simpler.

 

Per discussions in other thread, note that the "-" of the 5V DC supply is NOT the same as either AC power signal. 

Attachments

Images (1)
  • ogr%20IR%20module%20itad%20with%20delay%20hookup%205v

Hi Stan

Sorry about the on and off again with this issue.  Having 4 year old and a solder iron do not mix very well. I need your help again.  Here is a picture of how far I gotten with this project. I am not sure how to hook up the oscillator/timer module into the above circuit.  The To-92 leg E is connected to relay in.  However oscillator/timer module out is also to connected to the relay in.

ogr%20ne555%20drives%20relay from 3-19-2015%20module

Are they both right or am I just very confused?  Any comments, suggest or advise is welcomed.

 

Attachments

Images (1)
  • IR circuit

The circuit from your post of 10/27 is a $3 DIY version of an ITAD.  Like an ITAD, there is a relay with an NO and an NC output connection.  The transistor you mention is indeed connected to this DIY circuit for the purposes of creating a time-delay.

An ITAD typically activates an accessory such as a crossing flasher circuit.  A crossing flasher circuit is shown in your latest post.  This is a separate circuit from the ITAD circuit.  It takes 5V and generates alternating 5V pulses to drive, say, lamps on a crossing gate.

So there are two separate circuits, 1) ITAD, 2) crossing flasher.  In this case both circuits happen to use one of those 99 cent relay modules.  That may be part of the confusion; they are separate relay modules!

If you confirm exactly what kind of crossing lamps you plan to use, what voltage they are, or if LEDs then what configuration, etc., then I will draw one big circuit that combines the two. 

Kris, unfortunately the flasher circuit shown above was switching of 5V between the alternating lamps.  To drive your higher voltage AC/DC it gets a bit more involved requiring another 99 cent relay module.  Here's a collage of various circuits that shows the 99 cent module approach.  There have been postings showing DIY flasher circuits that can drive bulbs without relays but by the time you gather the transistors, capacitors, etc. and solder it up I think you're better off using the eBay module approach.

You should be able to click on this photo to get better resolution.  The same circuit can handle either your AC or DC flashers.

diy itad and flasher

Attachments

Images (1)
  • diy itad and flasher

First thank you so much, I can not thank you enough.  I have looked over the diagram and it make sense. I do have one  question for you.  On the ITAD relay and the top flasher relay on the NC terminal has a green line but no instructions and they both are not wired to anything.  My question is so they are not wired to anything correct?

Nice.  Hard to describe that moment when you turn on something you've built ... and it works!

BTW, on the 555 timer module you can adjust the ratio of on-to-off timing (a.k.a. duty-cycle) using the blue trimmers.  In the video the right lamp looks like its duration is maybe twice that of the left lamp.  If it matters you can adjust it so left and right flash for about the same time each. 

diy%20itad%20and%20flasher

As I recall, the MP3 circuit simply operates on 5V DC.  That is, apply 5V and it starts playing.  In other words you want 5V DC that switches on when the ITAD turns on.  Well, you have that already on your circuit at point "A" in the diagram (note polarity red for +, black for -).  The left relay module supplies 5V at its "NO" contact when the ITAD is active.

As for the crossing gate, I'm assuming it operates on 14V accessory voltage?  That is, apply 14V and the gate goes down.  In other words you want 14V that switches on when the ITAD turns on.  Well, lucky you again!  You have that already on your circuit at point "B" in the diagram.  The upper right relay module supplies the higher lamp voltage (12V/14V) when the ITAD is active.

Note that the return or "-" sides of the voltages to the MP3 player and the crossing gate mechanism are different signals and should be connected as shown.

 

Attachments

Images (1)
  • diy%20itad%20and%20flasher

Hi Kris, I don't have that Semaphore but my understanding is it operates from 12-18V AC.  So if you're running your crossing lights on AC, then you have appropriate power.   Apparently there are 3 wires to the semaphore.  2 wires are simply connected to the AC power source all the time since a lamp is always on.  Then when triggered the 3rd wire gets power which moves the arm (and rotate a different the lens color into position).

So if using the diagram above, you'd power the lamp/light portion of the semaphore with your AC power source.  Then you attach the 3rd wire like that of point "B" which gets AC power when the ITAD is triggered.  I hope this makes sense.

Hi Stan

Thanks for the reply and yes it does make sense. I am currently making a second IR relay which will let me incorporate all these add on. I adding some 3 Poles/3 Pin 2.54 mm/0.1 PCB Universal Screw Terminal Block Connector to the PCB Board so that I could add or take away components without soldering.  I will let you know the outcome once it is built and operation. 

Yes.  For experimenting/prototyping, screw terminal blocks can be handy...especially if you can just remove the existing pins and drop in the connector.  I see the 3-poles are about 25 cents on eBay which seems reasonable.

I've even fabricated circuit boards to add screw terminal blocks to boards that don't have them or that aren't spaced to directly drop one in.  Here's the LM2596 DC-DC converter module converted to screw-terminal-block inputs and outputs.  On the input side I added 4 diodes (a bridge-rectifier) to make this an AC-to-DC converter module.

screw terminal block modifications

Attachments

Images (1)
  • screw terminal block modifications

The 2.5mm and 5.0mm parts from that kit should fit on 0.1" grid prototyping board.  I suspect part of the reason you haven't used any is because you need something to mount them to!   0.1" / 2.54mm  is arguably the most popular connector spacing for prototyping like on the push-in white boards and further anointed by its use on Arduino widgets.

IMG_0400.

 

Attachments

Images (1)
  • IMG_0400

Actually, I have been fiddling with the Arduino widgets. I also have some of the long breakable things, as in your picture, with the pointy things sticking out on each side. They fit in the Arduino holes, but I think the two wire (brown & red wires) you show might be better for connecting the wires to the widgets? 

It seems no matter what I get, or how many of them I get, I am always lacking the proper connecting device. Can one ever have too many of these things? I have some 3 & 4 wire computer fan connectors that seem to fit the pointy things, but the wire count is never right or in the correct locations?

Not to get off topic too far, but from this thread, I have ordered (and received) some of the above IR optical gizmos and am planning to start reworking my Arduino powered train direction indication and speed calculator. The photo resistors were somewhat of a failure, at least I hope that was the failure (surely it couldn't be my code?)? These things are a lot fancier than the photo resistors anyway and they also have blinking lights which the resistors were lacking.  

I should probably start a new thread on this after I see what happens with these new devices. Will either post success and how it works (probably the most unlikely scenario here?), or will be asking for lots of HELP! Please don't go away!

IMG_0401

The red-brown sockets are of course crimped wires inserted in housings that you must "stock" in 2, 3, 4, etc. positions.  This is always a bother.  So what I've done is to buy a long socket/female strip (DigiKey label shown) and then cut them to length to make 2, 3, 4, etc. positions.  I then solder wires to the exposed pins (3-position examples shown on top with and without heatshrink) to make my customized wire connectors of any length I want that plugs on the male/header pins on the eBay modules.  As I'm sure you've discovered, some of those Arduino modules and breakout boards can have a strip of a dozen or more pins.  How many hobbyists have a stash of 12-pin or 20-pin housings?!  I understand that soldering wires to a connector goes against the grain/purpose/intent of making cables without a soldering iron.  But that's what I do and it works for me...

I'd to see what you're going to do with a speedometer or whatever.  I'm sure I'll have something to say as a card-carrying member of the peanut gallery. 

 

 

Attachments

Images (1)
  • IMG_0401

Dear gentlemen

Your ideas are good and I will consider them. I already have the long socket/female strip and 2.5mm and 5.0mm in stock at home. In some application they might work extremely well. In regards to the 3 Poles/3 Pin 2.54 mm/0.1 PCB Universal Screw Terminal Block is for easy of use.  I just order them from our friends in the Far East and waiting for them to arrive and install them as soon as I can.  Stan thanks for the kit link, right now I will just experiment with it and let you know what I think of them. I also am not crazy about soldering but some times there is no way around it. I have seen some of you pictures and only wished that my soldering was a good as yours.

Hey rtr12

Please keep me in the loop I like your idea for an Arduino powered train direction indication and speed calculator. Please provide with the link to your thread so I can follow it.

I've bit the bullet and bought a crimp tool and a supply of the Lionel 2.54mm, 2mm. and 1.5mm connectors.  This allows me to make connectors for most occasions.

I like the train direction indicator, I'd like to figure out an easy and bulletproof way of determining which way a train car is moving.  Ideally, this could be done without wheel sensors, I'm thinking some sort of accelerometer, if out phones can do it, we should be able to as well.

 

I will check the Digi-Key parts you posted, Stan. Sounds like a good plan that would work for me as well.

And will also put together a post on the speed/direction thing. This came from an article in a recent Nuts & Volts magazine. It  was for, I believe, an HO layout (small 2 rail anyway). I haven't yet been able to make it work reliably (but I haven't messed with it since around Halloween).

I will post the article link in the new thread, however, it may only be accessible to subscribers, not sure on that? I have modified it some what and didn't use the parts they listed (I had some parts on hand). I will now be trying the IR sensors above (thier photo resistors did not work well for me here).

 

gunrunnerjohn posted:

I like the train direction indicator, I'd like to figure out an easy and bulletproof way of determining which way a train car is moving.  Ideally, this could be done without wheel sensors, I'm thinking some sort of accelerometer, if out phones can do it, we should be able to as well.

 

For less than $2 shipped you can get an eBay 3-axis accelerometer module with analog outputs based on the Analog Devices ADXL335B sensor chip which puts out 300 mV/g.  I'd think this could be the basis for an inertial direction indicator (no wheel connection) and doesn't require a microcontroller or programming.

  s-l500

But in train applications there could be the problem that you really want to indicate the "next" direction of motion even before it happens.  Like the backup light on a automobile (or warning beeper on a truck), it activates when you put the vehicle into reverse even before actual movement.  This makes sense in that the purpose of a backup light is to indicate/warn.  In a previous application, the objective was to turn on the reverse headlight on the last car in a subway consist.  Using a wheel indicator, the reverse headlight would only come on once the consist started backing up.  The alternative was to slave the reverse headlight to the lead car's reverse light via a wireless link (no tether).  So when the lead car with the motor drive was put into reverse (whether from conventional or command control) the trailing car's reverse headlight immediately slaved to the "next" direction of motion even before it started moving.  This is what I think you'd want.

Now, as for installing a direction sensor in a piece of rolling stock, what is the application?  That is, I assume it's not for directional headlight indication.

Of course to steer this on-topic, as we are talking about optical sensing, I've wondered if anyone has taken the time to unravel the mystery of the optical mouse which uses image processing to detect motion.  It's amazing that for $10 or whatever you're getting a device that is continuously taking what amounts to a video of the surface and comparing pictures to detect which way the mouse is moving...no moving parts!  So in principle such a device could be focused on the track bed to detect movement.  Unfortunately all the one's I've seen use red LED to illuminate the surface so you'd see a red spot on the track bed; but in principle the same optical processing should apply to illuminating the track bed with IR or something invisible to the eye.  Again, this method can only detect actual motion as opposed to the "next" direction of motion.

 

Attachments

Images (1)
  • s-l500

That definitely brings the discussion back on-topic.  A well-established method for detecting direction of motion whether rotational or linear is using a pair of IR detectors...and the so-called quadrature decoder.  So basically you could have 1 LED emitter and 2 phototransistor/photoresistor detectors.  Let's call them detector 1 and 2.  Positioning the detectors appropriately, in one direction the detectors will start both off, then 1, then 1&2, then 2, then both off again.  In the other direction the detectors will start both off, then 2, then 1&2, then 1, then both off again.  Very simple "logic" circuits can decode this into a direction of travel indication; in fact there have been IC chips that even perform this function.  Or if using an Arduino, the code is essentially trivial.

I think it comes down to what you're trying to accomplish.  If you need to detect direction of motion ONLY, then that's one thing.  If you also need some indication of velocity (direction plus speed) that's another thing.  If you're only interested in speed (don't care about direction) that's another animal.  And of course what I was discussing which is indicating the "next" direction of motion as in a directional headlight that's yet another animal.  So many animals running around you'd think this was a zoo...

That's a nice module Stan, and it would be useful for one of the applications I want to do.  I'd like to add flange squeal when rounding curves, this would be perfect to feed into my audio board and let me know when I was turning.  As far as the backup light, I suspect no many would notice it comes on right after the car start moving, so it might work for that as well.

He's doing a good job of training the monkey(s), well at least one of them (me) anyway.  

Stan, that is exactly what I was doing, the off, 1, 1-2, 2, off. The speed measurements were attempted between the timing of 1 on and then 2 on in this example. Will have to check, but I'm pretty sure that was the speed calculation. I also found some of the pointy things that will fit into the Arduino I/O's for soldering to the hook up wires. They were pointy on both ends, had to order the pointy on one end  with recepticle on the other thingies. 

Ok, since we are back on topic using IR sensors and NVOCC5 (Kris) is also interested in this, here is the link to the Nuts & Volts article (Aug. 2015 issue) that got me started on this: Microprocessors and Model Trains Meet Head On by Bob Fink. However, I have a feeling you may have to be a subscriber to view it? I could copy and post, but I have a feeling that might not be a good thing to do, as in maybe not legal?

Let me know if you can't get to the article, I will email them about posting it here or try to think of something I could post without causing problems. Maybe write up something on my own. I have butchered a few things from the article, so what I have now is a little different. I also used an ebay LCD display and other ebay items instead items listed in the article.

Also try this link: http://nutsvolts.texterity.com...p;pm=2&u1=friend. It said the magazine pages could be shared with friends and created this link for me to share it.

Last edited by rtr12

Your first link just takes me back to this thread.  But your 2nd link allowed me to preview the 1st four pages of the article - after that it solicited a subscription order.  But it did show enough.  So if you use a visible light photoresistor, then you can use the room's ambient lighting as the light source.   You place the detector in the track bed and when the train passes over it blocks the room light and the this triggers (turns "on") the detector(s).  So measuring the order of triggering and time interval between triggering you get direction and speed.

Of course it's the Arduino module that's doing the heavy lifting in this case...particularly in "doing the math" to convert time intervals into scale-speed and then to display it in "English" with a multi-line alphanumeric panel.

gunrunnerjohn posted:

I'd like to add flange squeal when rounding curves, this would be perfect to feed into my audio board and let me know when I was turning. 

That would be quite an accomplishment.  An accelerometer has no output at constant velocity.  However when going around a curve the X and Y outputs will show changing orthogonal components of acceleration even if the train is going at a constant speed.  I guess you can do the math but I'd think that at typical scale speeds in O-gauge, even at 300 mV/g (which seems pretty hefty), the outputs will be in the noise so to speak. 

I'd think a mechanical or optical sensor detecting the pivoting/turning of the wheel truck relative to the chassis might be an easier way to trigger the flange squeal.  Of course you'd still need to know that you're in motion so as not to squeal when coming to a halt on a curve.  I wonder if you could use the z-axis (vertical) output to fabricate what amounts to a vibration sensor and a proxy for motion detection.  Hmmm.

stan2004 posted:
gunrunnerjohn posted:

I'd like to add flange squeal when rounding curves, this would be perfect to feed into my audio board and let me know when I was turning. 

That would be quite an accomplishment.  An accelerometer has no output at constant velocity.  However when going around a curve the X and Y outputs will show changing orthogonal components of acceleration even if the train is going at a constant speed.  I guess you can do the math but I'd think that at typical scale speeds in O-gauge, even at 300 mV/g (which seems pretty hefty), the outputs will be in the noise so to speak. 

I'd think a mechanical or optical sensor detecting the pivoting/turning of the wheel truck relative to the chassis might be an easier way to trigger the flange squeal.  Of course you'd still need to know that you're in motion so as not to squeal when coming to a halt on a curve.  I wonder if you could use the z-axis (vertical) output to fabricate what amounts to a vibration sensor and a proxy for motion detection.  Hmmm.

I ordered a couple of them to tinker with.  I can read a fairly low value with the A/D converters on the PIC, but I really don't know what G readings I'd get turning, that will be interesting to see.  I realize they don't have an output at a constant velocity, or at least I wouldn't think they would. Lionel uses some sort of similar sensor to trigger the squeal, so it must be possible.

Perhaps just something like the hanging pinball tilt sensor in a viscous fluid might tell me when I'm turning.

Add Reply

Post
×
×
×
×
Link copied to your clipboard.
×
×