logo elektroda
logo elektroda
X
logo elektroda

Remote controlled excavator: control of 6 DC motors, ESP32, limit switches, switches, I2C

Izbelut 870 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20341976
    Izbelut
    Level 2  
    Hi,

    I have a model of a remote controlled excavator. The original control doesn't work, it's time to build my own.
    I would like to base this project on some dev board with ESP32. The problem is the number of motors vs the number of GPIOs available on the board.
    I need to control at least six DC motors, plus make some switches (like turn on lights/diodes etc). Three of the motors have hall sensor limiters. To control the motors, some simple H-bridges will probably suffice, just that I need at least 2 pins per motor (depending on the bridge used 2 PWM, or 1 PWM one direction or even 3 pins) plus for the motors from the limiters two more pins each.
    I will definitely exceed the number of GPIOs available. There was an idea to look for GPIO extenders, or better still bridges with communication over I2C. However, I have not been able to find either the first or the second solution very well. I'm interested in ready-made boards/modules, I don't want to play with designing a board. We are rather talking about cheap modules, a few zlotys for a bridge, 1-2(A) per motor.
    Another idea was to use two boards with ESP32 and communicate between them. Here, the problem will already be to pack everything in a housing.
    The control signal will come from the FlySky FS-iA6B receiver over the i-bus.

    I would be grateful for any ideas!
  • ADVERTISEMENT
  • #2 20342016
    khoam
    Level 42  
    Expander modules on chips MCP23017 (16 ports) are available in Poland and at ali (much cheaper). They can operate with power and in 3V3 logic. One such should be enough to operate switches, leds etc. There are also cheaper ones on chips PCF8574 (8 ports). Both models are controlled over I2C and not likely to cost a couple of gold ;) .
    Link
  • ADVERTISEMENT
  • #3 20343640
    Izbelut
    Level 2  
    At these prices, I'll just add a second esp board ;]
  • #4 20343721
    khoam
    Level 42  
    And how many specifically of these GPIOs are missing?
  • #5 20344333
    kulmar
    Level 32  
    Sliding registers can be used to control static signals (e.g. LEDs). One register will occupy two processor outputs (data and clock line) and make 8 outputs available. The registers can be connected in series.
  • ADVERTISEMENT
  • #6 20344346
    khoam
    Level 42  
    Izbelut wrote:
    At these prices, I'll just add a second board with esp
    .
    On a well-known Chinese portal, a module with PCF8574 costs less than £5. This is definitely cheaper than the second ESP :) .
  • #7 20345392
    Izbelut
    Level 2  
    Quote:
    And how many specifically of these GPIOs are missing?
    .
    If I use the L9110 controllers, I need 12 PWM outputs, an additional 6 pins for the limiters, an additional motor but without speed control then another two and the leds say 2. I don't know about PWM vs extenders, but 12 I should be able to pull from the esp (unless I use too many pins for the communication combo: for the extender and communication with the radio module).
    I just checked the MCP23017 prices, which turned out to be a mistake! Actually a PCF8574 die from alledrogo, or even two should do the job. That will probably be even better than a sliding register. Or go wild all the way and use the PCA9685 (which prompted me after searching for the chips you tossed ^_^ )

    I think this is starting to take shape!
  • #8 20345541
    tos18
    Level 42  
    There are also motor controllers controlled via I2C e.g. DRV8830
  • ADVERTISEMENT
  • #9 20345939
    khoam
    Level 42  
    Izbelut wrote:
    Or go wild all the way and use the PCA9685
    .
    This is a 16 channel LED controller, so you won't go too crazy (only output pins).
  • #10 20346900
    Izbelut
    Level 2  
    tos18 wrote:
    There are also motor controllers controlled via I2C e.g. DRV8830
    .

    Actually searching by model gave something, but these boards go for several tens of gold, for my applications too expensive :(

    khoam wrote:
    This is a 16 channel LED controller, so you won't go too crazy (only output pins).


    Interesting that in the board descriptions somehow nobody mentions this :| , they describe it as a servo/motor controller. In my case it probably won't make any difference to me, if I run out of PWMs and use this module, it will automatically free up pins on the main board.

    Now "only" to choose specific boards, add cables and small things, order, start pinning, and see what's missing ^_^.

Topic summary

The discussion revolves around building a custom control system for a remote-controlled excavator using an ESP32 development board. The user faces a challenge with the limited number of GPIOs available for controlling six DC motors, limit switches, and additional components like LEDs. Suggestions include using GPIO expander modules such as MCP23017 (16 ports) and PCF8574 (8 ports), both of which operate over I2C. The user also considers using sliding registers for static signals and motor controllers like DRV8830 for I2C control. The conversation highlights the need for additional PWM outputs and the potential to free up pins by using specific modules, ultimately leading to a more organized control system.
Summary generated by the language model.
ADVERTISEMENT