Maker Pro
Maker Pro

Microcontroller controlled by pushbutton for LED flashlight

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
We need to find a smaller SMD Schottly diode of modest forward current and reverse voltage rating... surely Digi-Key has something that will fit... perhaps the attached datasheet describes what we need.
Yep that will do Hop.
Thanks Adam
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The max current will be limitted by the 330R so its quit low.

Doesn't that just provide a guaranteed current path since we don't know what the current regulator is?
 

TenderTendon

Dec 20, 2014
143
Joined
Dec 20, 2014
Messages
143
Out of interest why does it have to be so small?

Adam

The PCB fits inside of a titanium housing that is threaded on the inside and the outside. The housing has to be small enough to fit in AA size flashlights.

A question for @TenderTendon, The components need to be on one side, but can the other side have tracks on it or does it double as the battery connector? Also, how will your design support the board to minimize flexing (possibly important for the capacitor)?


The other side of the PCB will have a spring soldered to it that will be the (-) battery contact. Vias will connect this to the component side. There will be room inside and outside of the spring contact pad for other isolated pads with vias if needed. The finished board will resemble this:

http://i.imgur.com/6wwkTC0.jpg

The large inner pad is where the spring would be soldered. The very outer ring would be the “output” or MOSFET drain. Flex will not be an issue at all. The entire PCB periphery will be supported by a .5mm shelf on the component side. The spring side will receive a threaded retaining ring that will clamp the PCB in the housing and also be the electrical path to the body of the flashlight.

Doesn't that just provide a guaranteed current path since we don't know what the current regulator is?

Not sure if this answers your question, but the 330 ohm resistor is the only guaranteed usable current path we have to work with. The LED driver also contains a PIC for operation and when the PIC is shut down, the LED’s are out of the circuit. Basically, the LED driver cannot be counted on to supplement the 330r to charge the cap. This is all theory though. The LED driver may be able stay awake during the 1ms off period and the LED(s) would be another current path.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,889
Joined
Jun 21, 2012
Messages
4,889
Gee wizz, I am feeling so retarded lately... I FINALLY got a "program" to assemble without error. Not much of a program, just some PIC initialization, but now I can try playing with the I/O to try to find out who the current hog is. Next step is to put the PIC to sleep and see how much current it draws. With the PIC running (and doing nothing!) it draws 4 mA with Vcc = 4 V. That is way more than I expected after reading the datasheet, but the PICkit 3 is still connected and that may account for some of the excess current. What I was expecting was something on the order of 0.5 mA to 1.0 mA.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Gee wizz, I am feeling so retarded lately... I FINALLY got a "program" to assemble without error. Not much of a program, just some PIC initialization, but now I can try playing with the I/O to try to find out who the current hog is. Next step is to put the PIC to sleep and see how much current it draws. With the PIC running (and doing nothing!) it draws 4 mA with Vcc = 4 V. That is way more than I expected after reading the datasheet, but the PICkit 3 is still connected and that may account for some of the excess current. What I was expecting was something on the order of 0.5 mA to 1.0 mA.
I had not done any programing for 15 years until now. But I have been using PICs in my designs for 20 years but just not programing them, thats what the software guys do for me at work. It took me a time to get back into it and I have enjoyed every minute.
Adam
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,889
Joined
Jun 21, 2012
Messages
4,889
I had not done any programing for 15 years until now. But I have been using PICs in my designs for 20 years but just not programing them, thats what the software guys do for me at work. It took me a time to get back into it and I have enjoyed every minute.
Adam
I am really enjoying this diversion too, Adam. It has offered me an opportunity to learn something new (PIC processors) and practice something I wasn't sure I was capable of doing without a lot of expensive equipment (SMD component placement and soldering). And it helps to have a community of like-minded people at Electronics Point to provide enlightenment, encouragement, and feedback. Thank you all!

Back in the day (1980s decade) I enjoyed programming embedded microprocessors, mainly the Intel 8085 and PCs running MS-DOS, using assembly. I always felt close to the real hardware when doing that, being very much a hands-on electronics guy. And I still do. For just that reason, I still enjoy programming in assembly today. But it's been awhile, and the microprocessor architectures have all changed (for the better IMO), and a new learning curve must be climbed.

Hop
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Hi Jeff
Does this look like what you are after? The PCB is 14mm in diameter with a rear pad of 11 mm and a ring of 1 mm. The round 1.5 mm pads could be can be used for programming with some kind of bed of nails fixture. I wasn't sure how you plan to program the PICs.
Adam
FLASH_PCB4.PNG
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Nice job.

You could use pogo pins for programming. They are spring loaded, which is necessary because you will never get 5 pins to connect reliably without springs. I would put a hole in the middle of the programming pads to keep the pins in position. You could make a matching board with the pins soldered in position to mate with the pads.

Bob
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,889
Joined
Jun 21, 2012
Messages
4,889
Nice job.

You could use pogo pins for programming. They are spring loaded, which is necessary because you will never get 5 pins to connect reliably without springs. I would put a hole in the middle of the programming pads to keep the pins in position. You could make a matching board with the pins soldered in position to mate with the pads.

Bob
It is also important to machine a small fixture to hold both the target board and the pogo-pin board in alignment and in contact with each other. This is to allow rapid programing of several (100?) assembled boards in succession. The pogo-pin board should also have the connecting wires to the PIKkit 3 permanently soldered into place with a PIKkit 3 in-line connector on the end, as @TenderTendon did with the prototype board he sent to me.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Nice job.

You could use pogo pins for programming. They are spring loaded, which is necessary because you will never get 5 pins to connect reliably without springs. I would put a hole in the middle of the programming pads to keep the pins in position. You could make a matching board with the pins soldered in position to mate with the pads.

Bob

Yes just what I was thinking apart from I was going to put a couple of small notches in the PCB outline so it would align in the fixture. The pads are only 1.5mm and yes you could use spear head pins to align in the small hole but these are quite fragile. I would go for crown pins personally.
Thanks
Adam
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,889
Joined
Jun 21, 2012
Messages
4,889
Since the back side of the target board is flat, the fixture could be just a hollow cylinder a few millimeters in length with a shelf and a single dowel pin (crown pin?) to index the target board position. The programming board of the same diameter as the target board but with pogo-pins attached could be mounted to a somewhat larger round piece of plastic the same diameter as the cylindrical fixture. A small hole on its outer edge mates with another dowel pin inserted on the outer lip of the cylindrical fixture.

Just drop the target board into the fixture, aligning a hole in the board with the dowel pin on the shelf ledge of the fixture. Then drop the pogo-pin board on top of it, rotating to align with the second dowel pin on the outer edge of the fixture. Turn the whole assembly upside down so it rests on the pogo-pin board, compressing the pogo-pins and being held in place by the weight of the cylindrical fixture. No clamps necessary, really quick assembly and removal of programmed target board.

One could also make the pogo-pin board a somewhat larger diameter and use two dowel pins to index it with respect to the target board. In that case, the programming board does not have to fit inside the cylindrical fixture. It can stand proud of the fixture (because the pogo-pins will compress after it is fitted) and be of arbitrary diameter, or even rectangular. The two dowel pins ensure alignment with the target board.
 
Last edited:

TenderTendon

Dec 20, 2014
143
Joined
Dec 20, 2014
Messages
143
Please help clarify...

FLASH_PCB5.jpg

1) I assume this is a MOSFET that is in a different case than the one I chose. If so, can you link to a datasheet? It seems odd to me that they would dedicate only 1 pin to the source and 4 to the drain.
2) Not sure what this is. Maybe a pullup/down resistor?
3) Obviously the PIC.
4) Obviously the switch.
5) Looks to be a resistor. Curious what function it serves simply being placed in between the PIC output and the gate.
6) Pulldown resistor between VPP and VDD?
7) Obviously the keepalive cap.
8) Schottky diode.

Hopefully I got something right....
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Please help clarify...

View attachment 19826

1) I assume this is a MOSFET that is in a different case than the one I chose. If so, can you link to a datasheet? It seems odd to me that they would dedicate only 1 pin to the source and 4 to the drain.
2) Not sure what this is. Maybe a pullup/down resistor?
3) Obviously the PIC.
4) Obviously the switch.
5) Looks to be a resistor. Curious what function it serves simply being placed in between the PIC output and the gate.
6) Pulldown resistor between VPP and VDD?
7) Obviously the keepalive cap.
8) Schottky diode.

Hopefully I got something right....

1) The MOSFET is one of the ones Kris chose originally. It's doesn't matter really, I just noticed it was a nice small package. We can change it if you want, as long as the one you are using will fit. http://diodes.com/datasheets/DMN1019UVT.pdf

2) Pull up resistor for the switch. It can be done without but as I mentioned in an earlier post the variations in the internal pull up varies a great amount. This will have an impact of the current drawn by the switch so I have made it very large and turned off internal pull-ups. Steve had a good idea off using a capacitor in series but not sure if we have room as I am thinking we are going to need a larger keep alive capacitor. ahead.

3) Yep

4)Yep

5) Most PICs don't like driving capacitance on their outputs, they current limit and then don't switch on. The FET will have some gate capacitance which varies between devices so I have put a small resistor in series just in case. This can be removed it we find it works without it.

6) Pull up for the reset line. I am not a great fan of internal pull ups and so I like to know what my reset line is doing.

7) Yep

8)Yep

We can fiddle around will the values and remove components if we need to. It's no great problem.

Cheers
Adam

FLASH_SCH2.PNG FLASH_PCB6.PNG
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Regarding the MOSFET I see the error I chose the wrong version of the same part. I'll correct this.
Adam
 
Top