3
\$\begingroup\$

I'm currently working on a RGB enabled controller stand that will include a circuit that does do two things:

  • charge the controllers
  • control RGB strips on the mount

I'm pretty new to electronics, and I never designed a circuit before, so I was hoping you would be able to tell me if i did anything wrong in this circuit:

fixed circuit

The circuit includes an ATtiny chip that will be programmable via the USB-C input, which will also provide power (5 V, 3A. 5.1 kΩ pull-downs for USB-C power are omitted here as the breakout board comes with them pre-installed). It also has components for the RGB strip, including a switch that will toggle the lightning effect.

I'm hoping this circuit will allow me both to power everything over USB-C as well as reprogram the ATtiny if I want to. Would it actually work?

Edit: I fixed some basic mistakes in the circuit.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ There is no power to ATtiny so it does not work. Also, why do you think it is programmable via USB? \$\endgroup\$
    – Justme
    Commented Mar 11, 2020 at 18:40
  • 1
    \$\begingroup\$ So … how do you flash the V-USB firmware into the ATtiny85 in first place? \$\endgroup\$
    – Janka
    Commented Mar 11, 2020 at 18:45
  • \$\begingroup\$ I'm 99% sure that the attiny doesn't have a USB interface. In any case, if this is your first project, i highly recommend you don't use USB-C. There's a lot of funky stuff with it. Using regular micro/mini makes things a lot easier. \$\endgroup\$
    – yhyrcanus
    Commented Mar 11, 2020 at 18:52
  • \$\begingroup\$ @Yhyrcanus: there's V-USB, a low-speed USB bitbanging firmware for ATtiny and ATmega. \$\endgroup\$
    – Janka
    Commented Mar 11, 2020 at 18:55
  • \$\begingroup\$ Why are you using a button to short USB D+ and D- together? Where does the ATTiny get it's power from? The "GND" pin of U2 isn't actually connected to ground (the dot is way off to the left). Why are you pulling D- up to VBUS? \$\endgroup\$
    – Ron Beyer
    Commented Mar 11, 2020 at 19:28

1 Answer 1

1
\$\begingroup\$

The ATTiny and the LED strip does not have supply voltage, so it won't work. For some reason there is a capacitor between Tiny VCC and LED VCC pins. Pulling D- to VBUS which is 5V is too much. It should be pulled to 3.3V. And it is not clear if the AVR is ready to enumerate soon enough, or should it be the AVR that controls the D- 1k5 pull-up so it can pull it up when ready.

The ATTiny is not programmable via USB, as it does not have USB peripheral to begin with. A firmware or bootloader must be programmed into it via other means with a separate programming device, so either the ATTiny must be socketed so it can be moved to a programmer, or in-system programming (ISP) pins should be added to the design.

The bootloader/firmware can then use the GPIO pins to implement software USB stack.

\$\endgroup\$
4
  • \$\begingroup\$ Just as a comment, the USB via software and GPIO seems to be quite popular so it must work. However, the way the hardware is done, I would never personally connect such a device to my PC - one mistake such as bad zener connection or incorrect series resistor and the AVR will drive the USB pins with 5V voltage levels, perhaps damaging something. USB should use 3.3V voltage levels, and it would be safer to use an AVR that can work with 3.3V while doing software USB. Also, the 3.3V USB signals from PC are barely just above the logic high threshold of the input of 5V AVR. \$\endgroup\$
    – Justme
    Commented Mar 11, 2020 at 19:50
  • \$\begingroup\$ Thank you for the reply! I connected the LED strip to the USB power pins, which are supposed to power it. the capacitor that's connected to the strip is there because apparently APA102 (the LED strip) blinks if I don't add a capacitor... The circuit that includes the resistor between D- and VBUS is a circuit that I got from this link and it says there to use 5v so I dunno... I don't really understand what this circuit is doing, so unfortunately I also can't reply to your part about the AVR. \$\endgroup\$
    – Ariel
    Commented Mar 12, 2020 at 17:01
  • \$\begingroup\$ And also I had to mention it on my main post, but I also plan to flash a bootloader like Micronucleus on the attiny85 using my arduino uno. \$\endgroup\$
    – Ariel
    Commented Mar 12, 2020 at 17:02
  • \$\begingroup\$ And also, one of the main things that I'm trying to do with this circuit is make everything work with a single USB-C input, so that's the reason I did it this way... \$\endgroup\$
    – Ariel
    Commented Mar 12, 2020 at 17:07

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.