I would like to be able to identify up to 36 different model railway wagons as they pass over a detector. I've thought about various methods and the most likely one is to use an IR signal from each wagon. Due to space limitations, the mini85 looks a likely candidate, but I don't know if it's possible to use one to produce an IR 34KHz signal. Only one code is needed for each wagon, which will be preprogrammed. The power source will be a CA2032 3V button cell and, to save battery, I want only to switch it on when it's above the detector, so I'm thinking of using a hall effect device to control the power to the mini85.
Is this feasible? And if so...
Would a hall effect device be able to supply enough current from its signal line or will I need a transistor?
I couldn't find the current requirement of the mini85 in the data sheet.
This is an interesting project. Do you mean an Attiny85?
I squeezed an Attiny45, an IR detector, an 85mAh Lipo cell and a home made electromagnet into an N Gauge wagon to operate as an uncoupler. I didn't use any PCB, just soldered things to the pins. The Attiny runs at 1 MHz to minimize power consumption.
This is sort-of the opposite of what you want.
A couple of thoughts come to mind ...
If you have a device to switch on the transmitter when the wagon passes a certain point then the receiver for the IR signal doesn't also need to be position-sensitive.
If you use a larger battery sufficient to give a few hours continuous operation of the Attiny you may have other options. With my system the IR decoder is the big energy hog so I have things programmed so it is only on for about 20% of the time. It didn't seem necessary to bother with the complexity of putting the Attiny to sleep.
1 on the bar code approach, but slightly modified.
Just put some silver foil on the underneath of each carriage. Then set up a 'reflectance' sensor pointing up from the track.
You would have to do some 'encoding' of the silver foil, to identify each carriage. Maybe 3 lines/strips of foil of differnent lengths and spacing (in the direction of travel).
Then you just measure the relative lengths of relefected light, which also overcomes any variable speed issues.
Most likely, the cheapest approach & no extra power/ATTiny required on the carriage! (other than for motion)
(I have seen several projects that use this approach in measuring electricity meters with reflective spinning disks).
You can also make your own sensors, with LEDs, LDRs or phototransistors or just buy off the shelf. Will require some design & effort to calibrate.
Robin2:
This is an interesting project. Do you mean an Attiny85?
Yes. That's what I meant.
I squeezed an Attiny45, an IR detector, an 85mAh Lipo cell and a home made electromagnet into an N Gauge wagon to operate as an uncoupler. I didn't use any PCB, just soldered things to the pins. The Attiny runs at 1 MHz to minimize power consumption.
This is sort-of the opposite of what you want.
A couple of thoughts come to mind ...
If you have a device to switch on the transmitter when the wagon passes a certain point then the receiver for the IR signal doesn't also need to be position-sensitive.
The IR receiver will be mostly buried between the rails, the transmitter will be pointing downwards. The idea is for an automatic hump shunt, so the receiver will be placed near the top of the hump, just before the 'release' point.
If you use a larger battery sufficient to give a few hours continuous operation of the Attiny you may have other options. With my system the IR decoder is the big energy hog so I have things programmed so it is only on for about 20% of the time. It didn't seem necessary to bother with the complexity of putting the Attiny to sleep.
...R
[/quote]I couldn't find how much current the ATtiny uses. I guess it depends on what it's doing. I only need it to provide an IR signal to an IR LED. On time will only be when the wagon is near the top of the hump, 30 seconds at most. My idea is to use the hall effect device, via a transistor, to power up the tiny85.
CrossRoads:
Too bad you don't have a little more room - maybe an RFID tag in each car, no power required - and a reader whereever you needed it.
Will RFID work at the range of about 3/4", through the plastic body of the wagon? All the tags I've looked at won't fit into an OO/HO gauge 4 wheel wagon.
1 on the bar code approach, but slightly modified.
Just put some silver foil on the underneath of each carriage. Then set up a 'reflectance' sensor pointing up from the track.
Tried that with some 'shiny' card and a laser printer (black bars for the 'spaces'). Not enough reflectivity, difficult to accurately 'aim' an IR beam and a separate IR detector and there's not much flat space under the 4 wheel wagons I want to use. I was thinking of trying mirror tape but it's difficult to find in the UK.
Henry_Best:
I couldn't find how much current the ATtiny uses.
That info is in the relevant Atmel datasheet. At 5v and 1MHz it only uses 1 mA (assuming I read the graph correctly).
What about a reed switch triggered by a magnet under the track so it switches the whole Attiny on (and then lets it go off) so there is zero consumption when there is no magnet?
I know you started with the notion of the IR detector under the track - but that's not necessary if you are using a transmitted LED signal (as opposed to a reflective system) because the IR detector is not the thing that identifies the location.
Henry_Best:
I couldn't find how much current the ATtiny uses.
That info is in the relevant Atmel datasheet. At 5v and 1MHz it only uses 1 mA (assuming I read the graph correctly).
Thanks. I did look there but didn't see it.
What about a reed switch triggered by a magnet under the track so it switches the whole Attiny on (and then lets it go off) so there is zero consumption when there is no magnet?
That's the idea of the hall effect device, but I agree that a reed switch (zero current consumption when off) would be better. I didn't think of that. Thanks.
I know you started with the notion of the IR detector under the track - but that's not necessary if you are using a transmitted LED signal (as opposed to a reflective system) because the IR detector is not the thing that identifies the location.
Agreed, but the detector can be inset into the ballast and its wiring can be easily hidden under the baseboard. The IR transmitter LED will also be hidden, shining through a hole in the wagon floor. A 3mm hole to 'push fit' the LED would be easy to drill without damaging the appearance of the wagon. The electronics in an open wagon can be hidden by a dummy load.
Grumpy_Mike:
You can get some very small RFID tags, the sort they inject in pets are very small.
Very nice, but £50 for the reader is too much to destroy, hacking it to an Arduino.
You can read those tags with a normal cheap reader. You can make your own for less than a fiver.
I'll look into that, thanks. Is it possible to read them from about 25mm (1") away or do they have to be closer? Pets don't normally have that thick skin and there's little need to tag an elephant in this country, as they're rather hard to lose.