Jump to content

Richfilth

Eurobricks Vassals
  • Posts

    81
  • Joined

  • Last visited

Everything posted by Richfilth

  1. As Arjen says, you need a PWM pin and two digital pins on your Arduino for every motor you want to control. The Arduino Mega has 15 PWM pins and 48 digital pins (some of these are shared), so you can run 12 motors if you don't really want to do anything else (like sensor reading). Fred, what you want to do is extremely simple and I can give you code if/when you buy an Arduino, as this was one of my "learning" projects. You only need one sensor (light, IR, reed switch - doesn't matter) and a motor controller. I also have a 16x2 LCD screen set up, but you can also use the old Nokia phone screens.
  2. My light sensors need to be adjusted to the ambient light conditions via the screw on the resistor, but you can do this via code to take an "average" reading you want to. It doesn't need any other light source, but obviously they won't work in a dark room. As for interference, they can be very sensitive (walking around is enough to trigger them with your shadow), so I'm switching IR sensors similar to Arjen's design. I'm trying to make them fit inside a 1x3 stud area, but this involves soldering which isn't plug-and-play like I stated in my first post
  3. This is the L298N I use. It really is just 4 wires between it and the arduino (or 7, if you control two motors): The two light sensors are the glowing lights by the crosstrack (housed in red and green bricks respectively): One 5V wire, one ground wire, one sensor wire. Really simple. And the Ultrasound sensors are at the end of each siding. They detect the reversing train, and when it is 25cm away the Arduino cuts power to the track, switches the points, then powers up in the opposite direction to bring the new train onto the loop: Again, a live, a ground, and two sensor wires this time. I'm not an Arduino expert so I can't offer detailed advice on how to code these things (maybe the Almighty Arjen can help here ), but I am currently putting together some guides on how to get started with Arduino and 9V lego. So far I've been able to convert my setup to remote control, so I can control train direction and speed, plus track switches.... with my hifi remote
  4. This configuration was relatively easy. I used: 1 x Arduino Mega 2 x L298N motor controllers (each module can control 2 motors) 2 x light sensors 2 x ultrasound sensors 3 x homemade 9V cables (described in the post above) 1 x 12V 1.5A power brick The only difficult part is the wiring. I spent a few evenings with some pliers and crimp connectors to make enough cables, but connecting everything to the Arduino is very simple. I don't use any shields - I just used a breadboard to "share" the 5V and ground wires for all the sensors. I didn't have to play around with any resistors, capacitors or other electronic stuff - it's really just plug-and-play.
  5. At Christmas 2014 I had zero programming experience. This video was filmed in early February, six weeks later. So no, not hard at all :D The Arduino forums are very supportive. The only modification to the lego that I had to make (oh no, sacrelige!) was the power cable. I had some old Technic cables with perished wires, so I removed the plugs and connected them to fresh cables - so one Technic cable makes two Arduino-to-Lego cables.
  6. I recently got my first Arduino, and I'm in the process of automating some tracks. This vid is just a proof-of-concept, showing that two tracks can be controlled, with a motorised switch, and some light- and ultrasound sensors. https://drive.google.com/file/d/0B8Bxk35bJ4FPZHJNZ2pLY1JiTVU/view?usp=sharing At the double junction, whichever train arrives first has automatic priority, and the second train will wait (about 2 seconds) for the junction to clear before moving on.It would have been a lot easier to give one track priority (i.e the train never stops), but I like a challenge Is anyone interested in some How To videos?
  7. What's the advantage of using a pivoting-arm design compared to Mark Bellis' rack system? Is it simply size, or is there a mechanical advantage too? My own design uses a rack-based gearbox with the older high-torque 9V motors, and although it's ugly I haven't had any problems with switches.
  8. I'd say that if you're not building a set for show purposes, then the extra expense of metal rails is unnecessary. Batteries can power the locomotives for more than one extended play session, and the availability of plastic tracks and PF motors far outweighs the power benefit of 9V rails and motors. Of course, if you see a job lot of metal rails selling cheaply then buy them; they're compatible with plastic rails and your HE's will have no problems running on them. But if you just want to get your trains up and running, you can get a lot more plastic rails for your money.
  9. What kind of sensors Arjen? I'm going to try some TCRT5000's to see if I can detect extreeeeeemely close proximity while hiding the sensors inside bricks.
  10. As someone born and raised in East Kent (Thanet), this MOC is particularly appealing to me. My Grandfather was a miner at Tilmanstone.
  11. I like this little set, but I don't really understand the transfer crane: its current position cannot load or unload anything from a train. Either rotate it 90 degrees so that it's in perpendicular to the tracks inside the shed, or move it sideways so that it runs above at least one track.
  12. If PF controllers are infra-red, then this method may work: 1) Buy a simple Arduino, an LM298N motor controller, and a tsop-4828 infrared sensor 2) Wire your switch motor to the LM298N 3) Wire the LM298N to the Arduino 4) Wire the infrared sensor to the Arduino 5) Configure the infrared sensor, and use the Arduino's "serial output" mode to find out what the infrared codes are for each button on the PF controller 6) With the new codes, write a simple Arduino program to power the LM298N based on the PF controller's codes. I have done this using a standard remote controller to control 9V motors, but not with a PF controller. I will be making tutorial videos very soon. EDIT: Just re-read - you mean with PF Motor, not Controller! Sorry - I only use old 9V motors on my switches
  13. If you click "Specs" it shows that the steel part of the tape is 1.5mil, and the backing (glue?) is 2mil, so 3.5mil (0.1mm) in total. It would be easier to buy wide tape and cut it to width, instead of trying to find 10mm tape.
  14. The most expensive pieces are the 16 side panels: the original yellow used the old-style panels without an edge lip, and these are significantly more expensive than the newer style ones. If you want to keep the costs down, use the new type ones in an easy-to-find colour.
  15. I can't speak for the ME track, but the height of the plastic rail on the PF track is the same as the combined plastic+metal height on old 9V track. This means that if you add anything more substantial than tape to PF track, you get a noticeable knock as a train transitions from 9V to PF track. I tried adding a 9V metal rail to a PF curve, and it resulted in regular derailings as trains encountered it.
  16. I'm quite fond of the 4560 (I had three of them until recently), but they do have weaknesses. Using 1x1 technic bricks to hold up the 16-wide "gullwing" doors is a really weak design, and I was always losing the 1x2 tile-with-handles that hold in the cargo crates. But I think this set is still more playable than 4559, where the engine unit has to carry the next trailer/wagon at all times. I don't have any post-9V era trains to compare them with though.
  17. Nothing that technical! I'm just using L298N boards, and I'm playing around with an IR sensor at the moment.
  18. I repaired a motor that was operating similarly to yours. The problem was the thermal fuse that's fitted to these engines to protect them (a little round disc sandwiched between the motor and the pickup connectors). I used this guide to open up the case (scroll down): http://horst-lehner....ben/9v_12v.html Then I found the fuse, pulled it out, and gently bent the brass tabs on the motor to make a stronger connection to the pickup conductors. With the fuse removed, it's not recommended to run these motors for too long, and avoid stalling them, but at least they'll pull again. Unfortunately I haven't found a source for replacement themal fuses.
  19. I would be EXTREMELY interested in playing with that app Corey! I have an Arduino mega driving ten PWM controllers, and I'm looking for a more convenient way to control them all.
  20. ummester has created a great locomotive for this wagon
  21. 6-stud spacing is what 9V TLG kits used (kits 4563 and 4564 in particular).
  22. I recently went to a Lego exhibition at the National Stadium in Warsaw, Poland. Here's all the train-related pictures in a convenient imgur album for you all.
  23. The locomotive is amazing, and the carriages are the perfect compliment. I'd love to own this set myself.
  24. It's a great design: it looks like it would fit perfectly with 12V-era sets
  25. I've been following your videos avidly Arjen, and this latest one is truly epic. And thanks again for answering my questions on Arduinos and power. I've got 4 L298Ms running from my Arduino Mega now, so I hope to post some similar videos myself soon :D
×
×
  • Create New...