Berndiboy - Homemade Arduboy

Changed, thanks :slight_smile:

Well i have a thin lipo that is About the size of the final device and only 3 mm thick. That is why i want to use this. More Power - hurhurhur :smiley: :smiley:

1 Like

Hmm i have looked now the Video and also looked into the link but it did not really help to know what values of capacitors and how many i Need. The only Thing i know: Maybe it is ok to use 3 in this case as they cover a higher range of frequency :smiley: But i would not be able to tell you when i Need what and where… But i would assume not “Mission critical” and i can go for the pcb design.

I just noticed that you haven’t wired UVcc (pin 2) and VBus (pin 7) of the ATmega32U4. They should both go to the side of fuse F1 that also connects to U2 VDD (pin 4).

For decoupling capacitors the placement is important. They should go as close as possible to the pins of the device they are intended to decouple. So for your design:

  • C1 should be close to U1 UCap (pin 6).
  • The capacitors for the display: C2, C4, C5, C6 should be placed close to the display pins they connect to.
  • C3 and C7 should be close to U1 UVcc (pin 2) and VBus (pin 7).
  • C8 should be close to U3 VSS (pin 6).
  • C9 should be close to U8 VIN (pin 1).
  • C10 should be close to U8 VOUT (pin 2).
  • C11 should be close to U2 VDD (pin 4).
  • C12 should be close to U2 VBAT (pin 3).
  • C13 should be close to the U1 pins it connects to. If you have the space you could add additional 0.1uF capacitors close to the respective pins on each side of U1.
  • You should add a 0.1uF capacitor close to U5 VCC (pin 8).
  • You should add a 0.1uF capacitor close to the display’s VDD (pin 9) and VBAT (pin 6).

In cases where the power pins of two devices end up very close to each other, a single capacitor can be used to decouple both devices, provided the GND side can be kept short for both as well.

As I implied above, the distance between the device ground pin(s) and the capacitor should also be kept short. This can be helped by using a “copper pour” (also known as a “flood fill”) for GND.

If you have the space, it’s always best to add decoupling capacitors wherever there’s a chance they may be needed. You can always leave any off anywhere it turns out they’re not required.

1 Like

I forgot to mention:
The ADC in the ATmega32U4 isn’t used by the Arduboy except to get “noise” to seed the random number generator (or for using the red RGB LED as an optical input :slight_smile:). For these cases, it doesn’t have to be very accurate.

If you think you may want to use the ADC for other purposes, you might improve its performance by adding a 0.1uF capacitor between the ATmega32U4 AREF (pin 42) and ground (again as close as possible to the pins).

1 Like

Again thank you so much for your help. I added the capacitors and also connected the VBus and UVcc.

Will consider your input during PCB design.
Will start with this today after work.

1 Like

You don’t need both C15 and C16. A single 0.1uF capacitor is sufficient for both pins. Place it closer to VDD instead of VBAT if you can (but these pins are close to each other anyway).

On the schematic, you should move C3 and C7 close to U1 UVcc (pin 2), so it is more obvious that they are to be placed close to that pin on the circuit board. You can put pads on the circuit board for both of them, if you wish, but I think using only one of them will be good enough.

1 Like

Changed quickly on the fly.

Thanks :slight_smile:

Thanks again for the help. I already made the PCB and just got it delivered.
Partytime !! My first PCB :smiley: Will have to wait for some parts to arrive so i can solder and test it. I tried to follow all the tips and i am not sure how much can go wrong because the schematic should not change but still maybe I missed something. So if it is working or not we will see the next days but i am still happy about my first try :wink:

5 Likes

Keep us posted!

I have now received all parts but somehow it seems to not work. I wanted to first check some
basics before i plug it in to my PC to burn bootloader and i get a short or so. So i attached a
small lipo to test. The Lipo has around 3.7V (checked with multimeter). But on the input of the
3.3V regulator i can only get around 0.9V and on the output around 0.2V.

In theory the lipo is directly connected to the input of the 3.3V regulator (the switch is in between but i turned it on of course). When i check on R13 (also directly on the lipo) i also get only around 1.25V.

My assumption is the missing ground from the battery. The minus of the lipo is not connected to the circuit at all. Only to the protection circuit. I know we discussed and it should be like this but why i then get that low voltage?

Only other possible issue could be that i wrongly soldered the DW01A as i was not able to find a marking at all and then just thought logical: When i can read the marking on it pin1 must the the lower left. (the upper left would make more sense but the marking on the board sais it is lower left. But still then why should i only get 1.25V on R13 because the FS8205A chip connects somehow to ground at least.

Here the latest circuit:

You are correct. Viewing the DW01 so you can read the markings, pin 1 is at the lower left. If you look closely you may see a small circle printed close to pin 1.

If you’ve installed all the components on the board and are trying to test it, that’s not what I would do. I would proceed in steps, as follows

  • Take a blank board and use your meter on resistance to make sure you have an open circuit when measuring between the following:
    • GND and BAT-
    • BAT- and BAT+
    • GND and BAT+
    • BAT- and DW01A VDD pin 5
    • GND and DW01A VDD pin 5
    • USB1 V- (GND) pin 5 and USB1 V+ pin 1
    • GND and LIPOCHRG VDD pin 4
    • GND and 3.3VREG IN pin 1
    • GND and VCC
  • Install only R12 R13 C8 then make sure:
    • BAT- to DW01A VDD pin 5 is still open. If you can measure capacitance, you should read the value of C8 (0.1uF) here
    • BAT+ to DW01A VDD pin5 measures 100 ohm
    • DW01A CSI pin 2 to GND measures 1K ohm
  • Install CN1 DW01A FS8205A
    • Connect your meter to measure volts between GND and BAT+
    • Connect the battery and see if the voltmeter shows the battery voltage
  • Install the POWER switch
    • With the battery connected, make sure you can switch battery voltage on and off between GND and 3.3VREG VIN pin 1
  • Install C9 and C10
    • With the switch off, check for open circuit between GND and 3.3VREG VIN pin, and GND and VCC
    • If you can measure capacitance, with the switch off check for the value of C9 (1uF) between GND and 3.3VREG VIN pin, and for the value of C10 (1uF) between GND and VCC
    • Again check for switching battery power between GND and 3.3VREG VIN pin 1
  • Install 3.3VREG
    • Make sure you get battery voltage on 3.3VREG VIN pin 1 when switched on.
    • Make sure you get 3.3V on 3.3VREG OUT pin 2
  • Install C12
    • Check that you get battery voltage between GND and LIPOCHRG VDD pin 4
    • Check that you still get 3.3V between GND and VCC with the switch on
  • Install C1
    • Make sure GND to LIPOCHRG VDD pin 4 is still open. It may start out with a low resistance and then increase to open as C1 charges. If you can measure capacitance, you should read the value of C1 (4.7uF) here.
  • Install USB1 and FUSE
    • Connect USB1 to a USB power supply or port. Check for 5V between GND and LIPOCHRG VDD pin 4
  • Install CHRG-LED R10 R11
    • Check for 2.2K ohm between GND and LIPOCHRG PROG pin 1
    • With USB power connected, short LIPOCHRG STAT pin 1 to GND. CHRG-LED should light
  • Install LIPOCHRG
    • Connect the battery and then connect USB power. The CHRG-LED should light
    • Measure the battery voltage between BAT- and BAT+. The voltage should slowly rise as the battery charges

If you get this far then all your power circuitry should be working. If you leave the battery charging, the CHRG-LED should go out once the battery is fully charged. The charged battery should read 4.2V

Next I would try to bring up the 32U4 in a similar step-by-step fashion and burn the bootloader. I can suggest the steps for this at that time, if you wish.

You could then install the buttons, LEDs and speaker, and write simple sketches to test them. Finally install and test the display and its associated components.

2 Likes

WOW thanks so much for your help and patience again. I will exactly go as you suggested and test every step. Luckily i have enough components here so i can start all fresh even multiple times if needed :slight_smile: I will report the outcome.

2 Likes

Something you could try with the board you have already built:
With the battery connected, temporarily short the left side of R12 (connected to DW01 pin 2) to BAT- or the left side of C8 (connected to DW01 pin 6). (These are the sides closest to the FS8205A.) This is from a note I found in the datasheet:

Note: When a battery is connected for the first time, it may not enter the normal condition (dischargeable may not be enabled). In this case, short the CS and VSS pins or connect to a charger to restore to the normal condition.

1 Like

Well i tried already by connecting a small powerbank to the USB but also the LED did not light up so either there is something wrong or i really have soldered something not correct even if i already checked as much as possible. So i will go with your step by step guide and see if and where things go wrong.

1 Like

I came to this point without any issue and now things start to get strange. I am NOT able to switch power on an off, even if switch “works” (When i check there is no conection within the switch). 3.3VREG VIN pin 1 always gives batterie voltage, no matter what the switch does… How is this possible? I checked the PCB layout and there is no connection at all that could cause this.

Here a picture. Not the niced soldering (was not concentrated enough now :slight_smile: ) but should work.

Aditional information:

I have now loaded the Lipo and it showed 4.12V

When the power switch is off and i test on GND and VIN of 3.3VREG i get 3.44V

When the power switch is on i get 3.55V

So something changes but i assume it is not as expected :frowning:

Disconnect the battery and measure the resistance between 3.3VREG IN pin 1 and VBAT+. With the switch off you should show an open circuit. With the switch on you should show almost 0 ohms.

If you always get 0 ohms, try measuring a blank board and make sure it is an open circuit.

You might have to remove the switch and then check that the board is open circuit. Then check the removed switch by switching it on and of with an ohmmeter between pins 1 and 2.

Yepp that is as expected:

switch off -> open circuit
switch on -> 0.3 Ohm

Try putting a resistor between GND and 3.3VREG IN to give a small load. You may be able to hold a 220 ohm resistor on the C9 pads. With the resistor in place and the battery connected, measure the voltage between GND and 3.3VREG IN with the switch on and off.

With all these tests, the voltage between GND and BAT- should be very close to 0V.

1 Like

Ok i have put a 220 Ohm resistor on C9 now.
When switch is off the multimeter still shortly reacts but shows 0.0V.
When switch is on i get 0.5V now but i assume this is because of the resistor?

Should i really check voltage between GND and BAT- ? Sounds strange for a noob like me. Isn’t both kind of GND? Sorry, maybe i get it completely wrong so forgive me if this is a stupid question :slight_smile: But as a noob i would say “minus is minus”

No, the resistor will only draw around 16mA so you should get close to the full battery voltage between GND and 3.3VREG IN (which is across the resistor).

The BAT- is connected to GND through the FS8205A MOSFET. That’s how the DW01 is able to protect the battery. It switches off the appropriate MOSFET if the battery is shorted or the voltage gets too low or the charge voltage is too high. This opens up the connection between BAT- and GND thus disconnecting the battery when necessary.

A MOSFET has very low resistance when on, so yes, under normal operation the voltage between GND and BAT- should be almost 0V. If you measure a high voltage (close to the battery voltage) between GND and BAT- then it indicates that the battery is disconnected for some reason.

As I mentioned before, you may have to temporarily short DW01 pins 2 and 6 after connecting the battery to put it in normal operation state.

1 Like