Testing Vpp control

Setting up:

It’s been a while since I have worked with the board powered up.  I hooked up the lithium cell and USB cable to my Computer, then the charger started doing it’s job. I then started the serial terminal on my computer.  I hooked up my Oscilloscope to watch Vpp live during testing.

The code still in the board tries to regulate Vpp according to the reading it gets from the ADC.  This isn’t working well.  Since It’s been a while, I built and re-uploaded the project without any changes. This reminded me how I had the tools set up. Of course, the behavior of the board didn’t change with this upload. Next, I disabled the feedback loop to do my testing.

Voltage verses duty cycle:

Continue reading

Design Decision

Side Project:

I am moving forward with the Compass toy prototyping.  I am designing a simple breakout PCB for testing the display. I may put the display breakout for sale on Tindie.

Project Intent:

The primary goal of this project/blog is to show electronics design start to finish.

The design goal is an inexpensive in circuit chip programmer that will work for most devices available.

Options:

The Raspberry Pi Zero was released November of 2015 at a price of $5 US each.  I even got one with a copy of MagPi.  To Make it run any code at all, it needs a power supply and microSD card.

Of course I could continue with the current design.

Common components:

Both the Raspberry Pi and the current design need the following components.

Printed Circuit Board
Battery for power supply and charging circuit
Vpp Supply
Level Shifter Circuit
External ADC(Still undecided for current design)
USB to serial Bridge (not sure it’s necessary for R Pi)

Additional components for Raspberry Pi:

Continue reading

New Build

Update:

The level shifter came in this week.

Populating the board:

I installed parts out of my kit in the order that I grabbed them, until I had enough to do the basic test.  The board powered up and the blue LED on the ESP-12F blinked once.  Unfortunately the board wouldn’t program.

I started probing with my Oscilloscope.  The serial data lines looked normal when I tried to program the board. Then I looked at Reset and GPIO0 lines and found that GPIO0 was oscillating at 24 MHz. The Reset line was working as I expected it to.  I used a 1 MOhm resister as a pull down on GPIO15. I chose 1 MOhm to reduce the amount of current when A_Sel is High.  I knew this could cause me trouble, GPIO15 is used to put the chip into SD card mode. That may be too much resistance.  I changed that resistor to 10 KOhms to see if it made a difference. It did!

I uploaded the defaults, then my code. My simple serial menu came up in the terminal. With it working, I went on to populate the rest of the board.  I came up short 2 components, the pin header I use for the lithium cell and Q2.  I grabbed both of those from the last build and completed populating the board. I reconnected it to my computer, re-connected the serial terminal and the serial menu is still working.

SPI RAM Testing:

Continue reading

Post 100

Statistics

I have been writing this blog for almost two years now.  With only about two hundred views per month. Of the two hundred per month, only about twenty five are returning visitors. I have received six real comments in this time.(and tons of spam comments)

I was hoping to get more comments to help me know what is interesting to the people that do make it to my site.  Also, I am not a writer, I am unsure if I am giving too much information or not enough.  These statistics are a little disappointing, but I will continue to write and hopefully improve my skills.

Status Update

The boards are fabricated and have been shipped from PCBWay.  I am looking forward to testing the changes  I have made to the layout.  While doing some testing, I hooked up the lithium cell backwards and fried the charger chip. I replaced it and the board is back up and running.  I have ordered the new level translator chip so I will be able to test it when the new boards come in.

Looking Forward

As I build it this next time, I will be looking for ways to make it less expensive and more reliable.  One thing I would like to improve is how easy the board is to solder, the lithium cell charger is very difficult to solder.

In the coming weeks, I plan on re-testing the hardware, Improving the software, and doing some functional testing.  In essence, I am hoping to move from prototype stage to alpha stage.  The software should start to look like the final product and the electronics shouldn’t need to change much if at all.

Goals:

Continue reading

Update layout Hardware V00I

Finally time to update the layout.  The charging circuit works well and I changed the level shifter on the schematic last week. So this week, I updated the layout.

I started by generating a new netlist. Next, I ran CvPCB to verify all the parts had footprints associated with them. They all do. Next I ran PCBnew and imported the netlist; making sure the exchange footprint settins was set to change.  I got an error:

Error: Component 'U3' pad '~' not found in footprint 'Housings_SSOP:TSSOP-20_4.4x6.5mm_Pitch0.65mm'

I had to figure out what that means before moving on.  It suggest one of the pins was named wrong either in the schematic symbol or the footprint library. I checked the schematic symbol first. I noticed the GND pin didn’t have a pin number assigned to it. Easy fix, added it and updated the library. I set the GND pin number to 11, saved it to the library, made sure it was in the schematic correctly, and re-generated the netlist.  I had to delete it and re-place it into the schematic to correct the schematic.  This meant that CvPCB no longer knew the footprint to use, so I updated it and re-generated the netlist again. No more errors in PCBnew import of the netlist.

I started by ripping up the unconnected traces. Then I started placing footprints.  I hid the bottom layer to make it easier to see what I was working around on the top layer.  Once I had the parts placed, I started routing traces.  I had to adjust component placement a few times to get everything to fit.  As I got to a point that I couldn’t do all the traces on the top side of the board, I un-hid the bottom layer.  While I was working with both sides, I had to re-fill the zones several times to correct for the areas I added new traces on the bottom side.

I finally got to 0 unconnected nets. I did a quick look to make sure all the references were readable and not under other parts.

layoutv00i

I plotted out the Gerber files and did a quick check to see if it looked OK and got ready to order.  When I look at Gerbers, I am looking for broken traces and unintentionally connected traces.  I used Gerbview to do this check. As I went into Gerbview and tried to load the files, the were double of all the files.  It looks like the developers of KiCad decided to change the naming conventions  for output to gerber.  I went in and deleted all the files in that folder and re-ran the plots.  While looking at the gerber files, C10 and U3 references were covered up.  I went in and fixed them and re-plotted.  While I was at it, I discovered U10 wasn’t anywhere near it’s footprint.

I created a zip file with the plot files ready to upload to a fabrication house. I have uploaded the files to the github repository, click the hardware link in the right column to go get it.

Are you using Kicad?  What tools are you using to design in?  Do you have trouble finding datasheets for Chinese parts?

Lithium Charger Testing (Hardware V00I)

I installed the Lithium cell charger chip and it’s associated components.  While I was soldering the components, I noticed that R5 wasn’t soldered correctly.  This is the current limiting resistor for the voltage boost circuit.  So I need to retest the boost circuit.

I then attached the cell and the radio led blinked once.(with no connection, this was expected)  I connected the USB from my computer into the circuit and D2 (Red) lit up. This is STAT1 signal from the charger IC. From Table 5 in the AAT3672 datasheet STAT1 on by itself indicates the system is fast charging the lithium cell.  I disconnected the Cell with the USB still connected, both D3 and D2 blinked until I reconnected the lithium cell and the system then went back to fast charge.

I grabbed my DMM and checked some voltages:

From USB: 4.65V (A Little low, but I have connected the Uprogrammer to a long USB cable for convenience)
Output to Board: 4.65 V (Matches input voltage)
Lithium Cell: 3.96 V (Good range for Fast Charge)

These voltages make sense, I am very happy with these results.  I waited a while to check the results again.  While I was waiting, I started doing some testing of the Voltage Boost Circuit.  With Just the boost circuit turned on, I measured 4.64 Volts on Vpp.  I checked the Duty and prescaler and they were set to 0 and 4 respectively.

I then set the duty cycle  and measured the voltage at Vpp

20% : 19.6 Volts
30% : 20.8 Volts
40%: 21.8 Volts
50%: 22.6 Volts

I played with the prescaler and the highest voltage I got was 24 Volts at 50% duty cycle and prescaler set to 9.  This is beyond design specification and has the potential to cause damage to the circuit, I don’t expect to do this in the future. I am happy to know that I have some margin in the design to if I need 20 Volts. I took the following image from my oscilloscope with a Prescaler of 4 and a duty cycle of 10% (25).

pre4duty25

I am not happy with the large steps setting the output voltage of the boost circuit.  I decided to load the circuit with a 10 K Resistor to see how it affected the output voltage.  I soldered a 1206 10K Resistor on top of C20. This lowered the output voltage for 10% with a prescaler of 4 down to 12.8 Volts  But the best voltage I could get out of the system was 18 Volts.  This also made Vpp a lot noisier(See scope image below), I want to add some more filtering.

pre4duty25w10k

I added a resistor to the schematic parallel to C20 and also a place for another capacitor.  The resistor I set the value to 20K as a starting point and the capacitor I set to 1 uF.  The 20 K resistor will draw less current and that should reduce the noise.  The capacitor will also reduce the noise and provide a larger reservoir for current changes when programming a target device.

After doing all this testing the lithium cell voltage was at 4.12 V. This is near a complete charge, I expected the system to go to complete charge very soon. This is indicated by the Green LED being on alone.

After it switched to charge complete, I grabbed my DMM and checked some voltages:

From USB: 5.05V (Minimal current draw so no Voltage drop through the USB cable)
Output to Board: 5.05 V (Still matches input voltage)
Lithium Cell: 4.19 V (4.2 Volts is maximum charge voltage for individual LiPo Cells)

The charging circuit is working as expected.  I disconnected the USB and the LEDs turned off. I re-connected the USB and the Red LED came on for a few minutes and then it went back to only the green LED on.

I have uploaded the updated schematic to GitHub, click the hardware link in the right hand column to go get it.

Do you have a circuit you want to test before layout? Do you have a design you are tinkering with?

Design testing for layout

I tested the battery charging circuit this week. It failed.  The lithium cell would charge, but when I disconnected the power adaptor everything shut down.  I didn’t understand how the enable lines worked.  In my hurry, I missed an example circuit in the datasheet that closely matched my needs. Most importantly it showed where to connect the enable lines for “normal” operation.

So for my client, I connected a diode from the out line of the chip to the in line of the chip(where the enables were connected to). The diode makes sure the out line is controlled by the chip and it can manage the current correctly.  Note D5 in the schematic below.

D5addition

This works but it is kind of a hack.  Hacks are great for testing prototypes, doing one off designs, and temporary changes.  Hacks lead to problems in production, if at all possible hacks should be avoided on production runs.  The right way to connect this circuit for both the programmer and my client is to connect EN and ENO to the +5V rail and ENBAT to the battery positive terminal.  This configuration means that anytime power is connected to the power, it will supply system voltage from the +5V supply and charge the lithium cell with whatever current is left from the 450 ma I limited it to.  When the +5V rail is not powered, or under powered,the lithium cell supplies current to system.

LithiumChargerFixed

I modified the code to connect the sigma delta to GPIO13 to drive the level shifter signal, then connected 5 Volts to the Vt and measured the waveform on the pad that corresponds with GPIO 13 through the level shifter. It didn’t work, Or the DSO138 oscilloscope can’t read the sigma delta signals.  I found a recommended power up sequence of the the level translator chip that I hadn’t considered before, the /OE pin should be brought low after power up.  This is to prevent excessive currents, I shouldn’t get the results I am seeing, I decided to try just toggling the GPIO12, 13, 14 pins controlled by the serial communications.  The system has gotten very unstable, I decided to re-flash the user config and wifi calibration data.  Turned out that Vt was/is shorted to ground, My best guess is the Pad directly under the chip solder bridged to the Vt(Vccb) pin of the level shifter chip.  Time to lay out again.

Do you have any Ideas or suggestions that might be useful for this design? Would you do anything differently?