Jump to content
 

Robin2

Members
  • Posts

    1,362
  • Joined

  • Last visited

Everything posted by Robin2

  1. The Infineon TLE5206 h-bridge can handle 5 amps in a small package. ...R
  2. What big aerial? With 2.4GHz wireless the antenna is probably on a PCB. ...R
  3. I'm not sure whose idea you are referring to. The first system I built uses 4 hand controllers in place of 4 wired controllers - people were always getting the long wires tangled as they walked around in the centre of a large oval layout. The second system will have two hand controllers. In both cases the track is wired for traditional cab control. The microchips (h-bridges) used to modulate power to the tracks were chosen because they include short-circuit protection. The chips (Infineon TLE5206) for the second system provide fault notification and this will be fed back to the hand unit. ...R
  4. I am in the process of building an Arduino based wireless control system for a second DC club layout. The hand units look like this and the base unit just controls power to the track in the same way that a wired controller would. The Arduinos use nRF24L01+ wireless transceivers. The hand units are powered by a pair of AA alkaline cells and they seem to last a very long time. And it only takes a few seconds to replace them if needed. ...R
  5. A lot depends on whether you like developing the electronics and programming (as I do) or whether your real interest is in getting trains running asap. For me, once I have proved that the trains work I have very little further interest. ...R
  6. Based on those dimensions I would not expect any difficulty with a simple Arduino Serial communication system. If you ran into problems it would not require much extra work to add RS485. ...R
  7. If you have a large system it may be more economic, and simpler to use Mega clones rather than nanos. if you want to control servos with Arduinos you are going to have to make up some sort of circuit boards to facilitate the connections. I am not familiar with the Merg products, but if the only obstacle is the need to construct circuit boards you need to balance that against the construction you will need for an alternative system. The Megapoints people do all that construction. Megapoints and MERG (AFAIK) also provide the system to facilitate setting up servos. If you go for an Arduino system you will have to write the software (and maybe create the hardware) for that set up system. Writing the software to make the set up easy will probably require far more lines of code compared to the core code needed to operate the servos. In the system I am building the servos settings will be "hard wired" into the Arduino program to avoid the need for special set up software. What is the greatest distance that the serial (or RS485) signal will have to travel? ...R
  8. Will your loco be battery powered or track powered? ...R
  9. IMHO, Serial is so much simpler. ...R
  10. I'm building a turnout control system for a club layout but it does not have nearly so many turnouts. I have built several standard interchangeable circuit boards using stripboard with Atmega328 MCUs (like in an Uno) and they will be distributed under the different baseboards to control servos for turnouts and uncouplers and LEDs for signal. The control panel has been built in conventional style (not my own choice) and the switches will feed into a Mega which will send messages by Serial to the other circuit boards. In fact there will be two Megas in the control panel and the other one will receive wireless signals from hand controllers and control the DC power to the tracks (not DCC). It will also be responsible for operating LED lights on the control panel. This system will mean that there are only 3 serial wires (Tx Rx and GND) connecting between the boards to control all the turnouts, uncouplers and LEDs I2C is a short-range technology - maybe 30 cm. I don't think it will be suitable for connections from one board to the next. One thing to keep in mind is that the polarity of the frogs must change when the turnout blades are in the middle of their move, other wise there will be a short circuit. I suspect people will recommend JMRI for the control system, but I have no experience of it myself. I like programming so I have created my own mimic panel in a web page using SVG graphics. ...R
  11. In his Post on 15 July the OP said " I've already got a sketch that will set the routes with 1 individual button per route." That suggests to me that all that is now required is a simple system to select those routes by pressing 2 buttons rather than 1 button. ...R PS ... IIRC there used to be a number attached to every Reply which made it much easier to refer to a specific earlier Post - is my memory faulty?
  12. My suspicion is a bad connection somewhere. Or maybe the motor shield uses A0 for something. Have you tried connecting your pot to a different analogue pin? ...R
  13. If I recall correctly it took me a long time to find the TLE 5206 by searching through RS Components' online catalogue. One of the problems is that things are "filed" according the the words used by the manufacturer to describe the part which means that a search term may not find all the items that would actually be suitable. And often finds dozens of things that are unsuitable. All I can suggest is that you begin searching. I did not search the other big suppliers such as Farnell, Digikey or Mouser simply because I can collect stuff from RS. ...R
  14. This is the RS Components link for the part I have used https://uk.rs-online.com/web/cp/1658151,9062978,9062978P/?pst=TLE52062SAKSA1&sra=p As far as I can see they are still readily available and I don't think the newer Infineon products are available in the same convenient package. Unfortunately the trend is to design everything for surface mounting. ...R PS ... I thought I had included a code snippet in my earlier Reply - i must have omitted to press "save". I have added it now.
  15. It's a very simple thing to use. There are two inputs one for FWD and one for REV. To go FWD (for example) set the REV pin LOW and analogWrite() to the other pin. Vice versa to go in reverse. This does mean using two PWM pins on the Arduino. And, of course, which is FWD and which is REV depends on how your motor is wired. Be sure to study the datasheet for the part. The code I use is like this if (direction == 'F') { analogWrite(revPin, 0); analogWrite(fwdPin, pwmVal); } else { analogWrite(fwdPin, 0); analogWrite(revPin, pwmVal); } ...R EDIT ... 19 July to add code snippet which I thought I had added earlier
  16. There is an awful lot of code in that library - sorry, but I am too lazy to study it all. I don't think there is as much code in the program I wrote for wireless control of trains on a club layout I don't think there is anything technically unusual in the program. However it writes directly to the Arduino registers rather than using analogWrite() for motor control and it would take a long time to understand the register code well enough to know if there is anything unusual. The L298 is an old-technology and inefficient motor driver chip. It has a large ON resistance that wastes a lot of energy - maybe as much as 2 volts get lost in the motor driver. Also I don't think they take kindly to short circuits. On two separate occasions I brought L298s to club meetings and wet home with one side of the L298 broken . I have been using Infineon TLE 5206 h-bridge chips - they are good for up to 5 amps and have short circuit protection. ...R
  17. Sounds primitive - just like an Arduino If you can already select routes then adding the extra ability to select them with two buttons should not be too difficult. I suggest you write a short separate program just to learn how to take inputs from two buttons and produce a single result number - shown on the Arduino Serial monitor. The program should be something like this pseudo code button1State = digitalRead(button1Pin) button2State = // etc if (buttonCount < 2) if (button1State == LOW) // assumes low when pressed buttonTotal += 1 buttonCount ++ else if button2State == LOW) buttonTotal += 2 buttonCount ++ else if button3State == LOW) buttonTotal += 4 buttonCount ++ } } if (buttonCount == 2) { if (buttonTotal == X) // route 1 else if buttonTotal == Y // route 2 etc buttonCount = 0 buttonTotal = 0 } ...R
  18. That could be a very big question - have any Arduino programming experience? ...R
  19. You need some means to identify the start of a route selection process - maybe have a special button that starts the process. Then, once you know you are at the start of the process you need to record the "numbers" of the next two buttons that are pressed. When the two buttons have been pressed then you need to select the route that is associated with that pair. I suggested "numbers" because if you assign a number with a power of two (1,2,4,8,16 etc) to each button then the sum of those numbers for any two buttons will be unique which makes it easy to identify the route. ...R
  20. It seems to me that you need at least three separate concepts to implement that. You need some means to keep a record of the things that need to be done to set a route - for example lists of the turnouts and their directions and maybe signals and their settings. You need the means to associate a pair of successive button presses with a particular route. You need the means to know the present state of all the things - for example each turnout and signal Could you be persuaded to do this part on a PC using Python (or any other PC programming language that you prefer) and then the PC just sends to the Arduino the list of turnout settings that needs to be made - that's how I do it. Of course it can be programmed entirely on an Arduino but the way you need to handle data in the small memory of an Arduino will probably make things more complicated. Especially if you want to check whether the resources for a route are available before you set a route - for example a turnout may already be is use for a route for a different train. Whether partly on a PC or entirely on an Arduino the key thing is to define data elements that make the management of the system understandable in 6 months time. For example a turnout might need to record its ID, its current setting, whether it is in use by a train or available to be allocated and whether changing it depends on the state of some signal. If it is in use then there needs to be a means to mark it as available when the current "user" is finished with it, and some means for the new "user" to mark it as in-use ...R
  21. Please post a link to where you got the TrainMotor code. What Arduino board are you using? Did you try the code prior to TrainMotor on your layout and if so did it exhibit the same problem as the TrainMotor version? What sort of motor driver h-bridge are you using? - post a link to their datasheet. You can get motor driver h-bridges that can withstand short circuits. What power supply (volts and amps) are you using for the track power? Is it separate from the Arduino power? ...R
  22. I know a little bit about Arduino programming but I have no idea what an NX panel is or how it works. If you can explain then I may be able to make some suggestions about the code. ...R
  23. If you declare a variable within a function it is a local variable which only exists within the function. The simplest solution is to make it a global variable by declaring it before setup(). You can then access it anywhere in the program. ...R
  24. Just to add to what @wasdavetheroad has said, the wireless part of the kit is fully built when you get it. All that is required is to connect the other components. It might be worth talking to Micron who are one of the Deltang retailers. ...R
×
×
  • Create New...