It has been a while since my last post, but I've been busy... not so much on electronics projects, but projects of other kind... Nevertheless I've been working a bit on SolarLight.
The prototype was working to light the LED but some other bits of the code were not working. Although the "light-on" function was working, the function checking the battery and checking the charging were not.
After wake-up from reset (power-up or watchdog), the micro checks if the current Solar Panel voltage is >200mV than the battery (a safe assumption it is charging) and if so increments a "charging timer", if this timer is less than 3hours, don't turn the light on. This is to be sure that there is some charging before a discharge. These and other checks were not working.
De-evolution from C to Assembler is always a mess if you have to re-learn the mechanics of each architecture. It is not only the instructions, its how the micro "thinks", only then you really control the machine.
On the hardware side I also had some problems, due to the limited number of pins I had to share some pins with the in circuit programmer, one of them is the MOSFET gate. I forgot to add a gate resistor to the source, in common MOSFETs with 10V gate threshold that is still asking for trouble, I guess that with LL (logic level) gate thresholds of 2V it is just "waiting to happen"... although it did take a couple of weeks...
I guess what hapened was, after programming the AVR-ISP left the pin floating and probably before that the level was high... the MOSFET kept on and finally burned.. I saw smoke coming out...
Here the new schematic with revisions on the lower corner.I also started the PCB design (with PCB part of gEDA suite) and I've now finished the board. It is not as packed as it could be because it has the size of a 3xAA pack. It is marked version 1.1 because I had finished the version 1.0 when the MOSFET blew up. I've mostly followed the tutorials available at the gEDA Documentation site:
- this one for the drawing of schematic and creating the netlist;
- this one for drawing footprints and getting to know PCB;
- and this one for the simulation;
- I also used this one for creating large "box symbols" (cpu, uart, etc)
I used gschem directly to create the new MOSFET symbol (IRLD024), since the original MOSFET symbol was graphic I though it would be better to use it instead of having a 4 pin box. I also wanted to keep both Drain connections separated if needed to use them in separate nets (although they are connected).
Using gEDA is still far from trivial as components, footprints, schematics symbols are all your responsibility, but still, I'm starting to like it. PCB also has a nice feature, you can print "photo mode" version of your PCB (yes, I know other software produces 3D views), here's mine top side.
1 month ago