Jump to content

Paddy Mac Namara

  • Content Count

  • Joined

  • Last visited

Community Reputation

62 Excellent

About Paddy Mac Namara

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I've been doing some experiments with phototransistors as a means of detecting locos.
  2. i like this little layout, my advice keep it simple for your first layout, also i'm shocked you left the mechanical engineering brotherhood to go to the dark arts of software.
  3. i'm not a great fan of the "emoji" likes, so here's some real words. "i like". track plans etc...?????
  4. got a new loco for the layout, the scale maybe a bit of but it's dcc
  5. Thanks Dhu, could you share some detail on this detection circuit, photos, circuit diagram, list of parts? cheers paddy mac
  6. hi sven, thanks for your comments and interest. I don't think that will be a problem, my previous experiments, see vid from 10th march 2019, show that the magnet does engage reed switch when attached to loco, in fact the magnet is very close to the switch as it passes over. What i was more concerned with is the double contact of reed switch as the magnet passes over it as shown in the video below. When using the Arduino and coding this was a problem and that is why there is a time delay in the code, so that the code ignores the second contact. With this circuit as long as the magnet passes over the reed switch reasonably quickly, the charging and discharging of the capacitor takes time so the second contact does not cause a problem. According to this site it takes 0.25 sec to full charge.https://www.allaboutcircuits.com/tools/capacitor-Charge-and-time-constant-calculator/
  7. As shown above the circuit using the Arduino allows for control of the junction with a loco going both ways. In my post of 10th march 2019 i could only get control in one direction using relays only and i have been trying to solve this for a year...Despite my best efforts i could not devise my own solution, however i came across the solution below recently and it is very satisfactory. more detail on how the circuit works: The initial state for this circuit is relay in Reset State. Thus the relay armatures are connected to cm-nc. The led is lit up, the led represents power to track you wish to isolate. Capacitor C2 charges up to +9V via 2.2k resistor R2 while capacitor C1 remains discharged as it is not connected to the 9V supply. If reed switch R1 or R2 is activated,C2 discharges via the relay’s “set” coil 2 and diode D2.This switches the relay into its set position, thus relay armature are connected to cm-no, the LED will switch off. C1 then begins to charge via R1. While R1 or R2 are activated the relay does not return to the reset position because the current supplied via R1 is insufficient for the coil to latch the armature. Once the relay has switched and C1 has finished charging, activating R1 or R2 again causes the relay to switch back to the reset state via coil 1 and the LED comes on again. The relay is a two coil 5v latching relay: Hongfa HFD2 005 M L2 D Bi-stable Latching Relay DPDT 5v, 2 coil, 2A. Purchased on ebay around €2.50/3.00 Capacitors are : Rubycon Electrolytic Capacitor, Miniature, 22 µF, 25 V, ZLG Series, ± 20%, Radial Leaded, 5 mm. These were purchased from Farnell and cost 10cent each Diodes I had in my electronics box, these only cost a few cent. Resistors I got an assortment pack on ebay of 300 with a range of different resistance values, cost was €5. The website I found this circuit on is: https://www.eeweb.com/extreme-circuits/momentary-switch-teamed-with-latching-relay
  8. This is how i would do two track control. But then I have three tracks.....so it's getting a bit messy.
  9. an improvement to the operation with reed switches my electronics workshop
  10. I've posted a couple of vids over on electronics forum showing use of reed switch with arduino, yep i know you can get IR sensors that you can literally just plug and play with, i am going to do some experiments with these too....
  11. As you can see not the most reliable, i think if i change the orientation of the reed switch, lenghtwise it should work better, see photo below of smaller magnet attached to loco here's the ciruit diagram, very scruffy sorry i normally do them on graph paper... Reed switch with arduino.pdf and finally here is code for the arduino, i take no credit for it, i found it after a lot and i mean a lot iof searching, its simple and i like it for that bool junctionclear; void setup() { pinMode(2, OUTPUT); pinMode(9, INPUT); pinMode(10, INPUT); pinMode(11, INPUT); junctionclear = true; digitalWrite(2, LOW); } void loop() { if (digitalRead(9) == HIGH || digitalRead(11) == HIGH) {junctionclear = !junctionclear;} delay(1000); if (junctionclear) {digitalWrite(2, LOW);} else {digitalWrite(2, HIGH);} }
  12. As promised i eventually got around to doing the above with an Arduino, you still need a single coil non latching relay, but it will work both ways, but it is not without its problems. sorry about the sound quality on that one, and me mumbling at the end, here's another one.
  • Create New...

Important Information

Terms of Use