4
\$\begingroup\$

Circuit diagram

I made this schematic for a board that will be the brain of a lamp I want to build. The lamp will be able to move in 2D (up-down, front-back) with two motors which are connected via J3. The lamp has LED strips with 5 channels (RGBCCT) which are dimmable via PWM from the ESP and the mosfets. The ESP should be accessible/programmable via the Pinouts for TX/RX via an external UART module. The board has two buttons, similar to dev boards, for reset and boot mode.

I would love to get some input and thoughts on that design before I go to the next step of designing the PCB. I'm worried that I missed something as this is my first self-made circuit.

Thanks!


EDIT 04.08.

Thanks for all the incredible feedback!

Some additional info that seems useful:

  • The motors I am planning to use are JGA25-370. I tested them on a breadboard by connecting them through the L293D with the ESP. Does that change anything about the comments on that part of the circuit?

  • The LED strips are RGBCCT (RGB + WW + CW chips). I tested the LED circuit on a breadboard and measured 0.6A for a 60cm strip segment with all channels on (which realistically would never actually be done), with planned 8 segments, I get 4.8A. I plan to use a 60W PSU.

  • The current sensing I added in order to get some feedback if the motor reached the end of the movement space, so I can automatically turn off the motors.

  • I already (physically) have a bunch of parts which I bought because I had the feeling they might get useful. I would like to use them if nothing speaks against them. I will address them below.

Addressing feedback:

  • missing PWR connectors - duh! that would have been a disaster :'D

  • bulk decoupling capacitors: Right. I read to especially put some right in front of the LED strips. I have here: 470uF/35V and 1000uF/16V (multiple each). would any of these fit? And where would I put them best? directly at the 12V input? And: Do I also add some to 5V? If yes, which?

  • C1 sizing: The circuit left of the ESP I took from the circuit of the dev-board. I assumed that they are proper and I honestly couldn't say what their function is. Could you explain the function of C1 - C3? Are C1 and C3 maybe to make sure the ESP does not turn of when there is a fluctuation on 3V3 - isn't that what a decoupling capacitors is for?

  • ACS712 module: that's one of the things I have "in stock". It's very much like this one. I thought of taking off the connectors and connecting it to the main board with pins, yes. Seems makeshift, but I have it here, so I thought it might be fine.

  • L293D: Wow, good to know! Would you say I should even discard the ones I have here because they are so bad? Maybe some detail: The bridge and motors will be used very rarely and if, only for less than a minute at a time to bring the lamp into the new position. Under these circumstances, would you still say goodby to them? Are they only wasteful during usage or also when they are idle? I will look into your suggestions, though, especially if there is something that combines all these requirements like DRV8411A.

  • LED circuit pull-down: 45 kΩ I just took because it's what the internal pull-down of the ESP is and I didn't know which number is good, as the internet says 1k to 100k. But 47Ω it is then!

  • MOSFET sizing: IRL3705 is what I have here, so I guess I will go with them :)

Next Steps:

  • I will update the schematic and publish a follow-up post integrating the existing and possibly following feedback.
New contributor
Alexander is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
3
  • 3
    \$\begingroup\$ Problems with L293, L298 and SN754410 H-bridge drivers on a low voltage supply <-- I can see you are using a 12 volt supply but, the L293 (or its variants) are really rather poor devices for anything more than 0.5 amps of motor current. \$\endgroup\$
    – Andy aka
    Commented Sep 4 at 9:28
  • 2
    \$\begingroup\$ Welcome, did you build a prototype on a breadboard that proves that this will work? \$\endgroup\$ Commented Sep 4 at 9:29
  • 1
    \$\begingroup\$ The ESP32-WROOM-32E input pins max voltage is specified as VDD+0.3V. You have to ensure that the ACS712 output voltage never exceeds this. \$\endgroup\$
    – Velvet
    Commented Sep 4 at 9:58

2 Answers 2

6
\$\begingroup\$

In addition to what Kuba has said:

  • your LED connector seems to be used for getting 12 V supply into the system – but where do you connect your power supply's ground? That's equally important, and carries the same current!

  • your C1 seems a bit large for the purpose it's solving; you're dumping all of its energy through your reset switch when you close that! And that poor switch is probably not designed for currents that high. So, smaller capacitor, add a 1kΩ series resistor to SW1, and maybe increase R6 in value (check datasheet at which voltage threshold you definitely reset)

  • your schematic says "ACS712 module" – does that really mean you want to put a module containing not much but the AC712 SOIC chip onto your board? that doesn't seem to make sense to me, you can get that chip (or other, equivalent chips) itself and just directly put it on your board, without incurring extra solder joints and hence potential for errors

  • The comments correctly point out that the L293D is a suboptimal part. I'll go with: it's a non-starter. Sorry. That thing wastes so much power that you need to add supply headroom just for it, and if you draw significant current through your motors, my guess is that you'll quickly find yourself in need of adding a heat sink, just because you decided to pick the least efficient motor H-bridge available on the market.

    • So, go for something else. There's many H-bridge / motor controller chips you can buy, Toshiba TC78H651 would be a classic replacement for the L293D with just all-around better specs, a lot of people like the TI DRV8830, but there's much more beautiful chips.
      For example, DRV8411A¹ integrates the current sensing you are adding through your ACS712 modules in the chip. Makes much more sense. Also, it has a "Fault!" pin with which your microcontroller can get informed when something like "supply voltage dropped too much", "overcurrent", "too hot" happened.
  • your LED MOSFET circuits as circuits seem sensible; the 45 kΩ resistors are a bit unusual (will totally work!), because the E6 series of preferred numbers contains 4.7, not 4.5 :)

  • the IRL3705 seems very overdimensioned for your problem, unless you're planning to attach 50 A of LEDs per FET? Maybe save some money by buying something smaller. Other than that, you're right to rather over- than undersize here.

¹ The first page of the DRV8411A datasheet links to compatible devices that might be available in different packages, at different cost. It might pay to check these; their current sensing might be a bit more awkward to use if you really want to know the current, not only whether it's in OK range, but it should work.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ C1 makes sure that random noise and the ringing of the key when you press it and release it are absorbed by the capacitor, so you only get one reset event, and not many in rapid succession. C2 and C3 are just decoupling capacitors. They need to be close to the consumer of the current (here: your microcontroller module), because they are a buffers for current you draw; you'll want to look up "decoupling capacitor". \$\endgroup\$ Commented Sep 4 at 13:06
  • 2
    \$\begingroup\$ wasteful: probably also during idle, but I haven't checked that. The problem is not the wasting of energy, it's that this wasted energy is 100% converted to heat! I would really drop the L293D, it's literally the worst component for the job that you can buy. Plus, it's way more effort and cost to add two separate, and severely overdimensioned (they do a lot of things you don't need at all), current sensing boards to it rather than using a replacement for the L293D which integrates that functionality, as explained. \$\endgroup\$ Commented Sep 4 at 13:08
  • 1
    \$\begingroup\$ checked, yes, with > 20 mA for the logic alone, the L293D is super wasteful even in idle. \$\endgroup\$ Commented Sep 4 at 13:10
  • 1
    \$\begingroup\$ just to make this clear: the typical L293D has about 1.2V output voltage drop between supply and output, and 1.2 V between output and ground. So, you're dropping 2.4 V in the L293, at full motor current. I don't know your motor, but the L293D only supports small motors with currents < 0.6 A, so let's assume 0.5 A. That makes then 2.4 V · 0.5 A = 1.2 W per motor; so 2.4 W when both motors move. The TI datasheet tells us the device gets 36 °C warmer per Watt, so 2.4 W · 36 °C/W = 86 °C temperature rise. Say, you want your device to not fry even when it's 35 °C (and it's probably easily that, \$\endgroup\$ Commented Sep 4 at 13:17
  • 1
    \$\begingroup\$ it's in a lamp enclosure, close to power MOSFETs!), then you have a problem: 35 °C + 86 °C = ouchy-touchy and smell of burnt electronics. So, L293D is not an option, really! (unless you spend additional design effort and money on adding a large heat sink, but that would be stupid, as it's more expensive and complicated than just not using that ancient terrible L293D!) \$\endgroup\$ Commented Sep 4 at 13:18
4
\$\begingroup\$

There may be other problems, but let’s start with the basics:

  1. Power supply input connector is missing - where 12V is fed into the circuit.

  2. Missing is the bulk decoupling capacitor for the 12V supply.

  3. Missing are the input and output capacitors for the 5V and 3.3V regulators.

  4. There are no visible PCB footprint annotations for all the parts.

    In KiCad, the footprint is an attribute of each component, and it can be made visible so that you can see it on the schematic without needing to click on the component. You can of course move those text elements to place them so that they visually go together nicely with the part they describe.

    That way we can see that you selected reasonable footprints before starting PCB layout. Footprint selection should be mostly done before layout.

Once you fix these issues, you probably should post a new question, or add new schematic to the existing question by editing the question. Do not remove the old schematic since then the answers you already got will become meaningless. We want to keep those answers meaningful so that others can learn from it too.

\$\endgroup\$
4
  • \$\begingroup\$ missing PWR connectors - duh! that would have been a disaster :'D --- bulk decoupling capacitors: Right. I read to especially put some right in front of the LED strips. I have here: 470uF/35V and 1000uF/16V (multiple each). would any of these fit? And where would I put them best? directly at the 12V input? And: Do I also add some to 5V? If yes, which? --- PCB footprint: okay, I will work on that next. \$\endgroup\$
    – Alexander
    Commented Sep 4 at 12:58
  • \$\begingroup\$ There should be a 12V bulk decoupling capacitor right by the LED strip connector. There should also be a local regulator decoupling capacitor: on the input to the 5V regulator, on the output of the 5V regulator - shared with the nearby input of the 3.3V regulator - and on the output of the 3.3V regulator. \$\endgroup\$ Commented Sep 4 at 15:28
  • \$\begingroup\$ And how to decide on sizing? \$\endgroup\$
    – Alexander
    Commented Sep 5 at 14:07
  • \$\begingroup\$ When I add a capacitor at the strip connector, it's after the MOSFET. Wouldn't it flatten the signal and counter what I am trying to achieve with the PWM and mosfet? \$\endgroup\$
    – Alexander
    Commented Sep 6 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.