Help with small PCB for miniature projects

jensmith25

Senior Member
Hi,

I'm brand new to the PICAXE but I've bought the 14M2 starter kit and programmed some basic flashing LEDs and read through the manuals.

I use LEDs for scale models and dolls houses and I want to start using the PICAXE board for programming effects with LEDs.

The project board is fine but it has a lot more on it than I really need.

I would like some advice on how easy it is to make a smaller board with the bare minimum on it.

Initially I'm looking at requiring:
an on/off switch as an input.
Several LEDs as outputs (how many can be powered off one board?)

I would like to remove the download socket because I would programme the chip and then it wouldn't need to be changed again and I don't think I need the darlington driver? I'm not 100% sure I understand what it does.

I'd also like to investigate if it's possible to power the board with a smaller power supply or lower voltage? The 3xAA battery pack is quite big for my usual projects.

Is the output of the board 4.5V? The manual says to use a 330ohm resistor which is high for 4.5v for a white LED. I'd normally use this with 6v and given LEDs are different vf I want to calculate the resistors more accurately as I use all the main colours.

I ideally need a board that is easily reproducible and quick to make.

If advice could be tailored to someone who's not an electronics natural I'd appreciate it. I try hard but some stuff I take a while to grasp :)

Any help appreciated.

Thanks, Jennifer,
 

srnet

Senior Member
You need to define 'small' really.

With standard PIH (pin in hole) components like in the starter kit, there is a limit to how 'small' you can make a PCB.

However with SMT (surface mount technology) you can make PCBs with the same functions but a lot 'smaller'
 

jensmith25

Senior Member
I guess by small I just want it to be the minimum size to fit all the essential components on. I guess I'd start with pin in hole as they are easier to solder but if it's easier to go smaller with SMT then I'd consider that also.

The board at present is 60 x 40mm but there's 5 additional input resistors? the download socket, the darlington driver etc all which I am guessing aren't essential? The manual says I need the 10K and 22k resistors for the chip. I assume I also need the 100nF capacitor.
 

grim_reaper

Senior Member
At the risk of making more work for you, can I suggest that you supply a circuit diagram first so that others might suggest the best way to reduce it in size (safely)?
Personally, I've managed to get a 08M2, cap, 3 resistors, 3mm LED and size N cell inside a 3 inch tall wedding cake topper... my only regret being I neglected to take ANY photos! Must build another one some day...
 

manuka

Senior Member
I use LEDs for scale models and dolls houses
Welcome - not a PICAXE application I recall being mentioned before! Your dolls houses are assumed traditional doll sized so I'd say (& reflecting on my daughters enthusiasm) that significant internal space is available? The normal 3 xAA supply is most often used for it's great "bang for buck". However, as most circuitry ( including PICAXEs) these days runs OK on 3 V, even a Lithium coin cell could provide.

The download socket can be refined to just header pinsor run via flying leads to a more convenient mounting spot. I always include such for versatiliy as circuits surely WILL need program tweaks.

The easist compact quickie PICAXE board can even be Vero based & simply made as needed- see the 6x8 hole wafer I once rustled up for a "Snap" circutry extension. LEDs etc were mounted off board.
Stan
 

Attachments

jensmith25

Senior Member
Thanks Stan.
Scale wise I deal with anything from 1/12th scale (1" = 1ft) down to 1/48th scale which is why size does have a degree of relevance. Sometimes a bit smaller if it's different types of models such as trains though they tend to have more space due to baseboards.

There's certainly some scope in using the veroboard / stripboard. It's not a product I've used before.

I'd be keen to use a 3v lithium cell as it's a popular size and I use them a lot (CR2032) for dolls house lighting, though underpowered for larger quantities of LEDs. I also use 2xAAA batteries which works ok for larger scale projects.

What is the absolute bear minimum I need on a board for the chip to run? When you say the LEDs are mounted off board I assume these are on wires back to the board?

Can you run more than 1 LED off 1 pin of the chip? It says each can handle 20mA but I often power my LEDs at 10mA as they don't need to be blindingly bright and it means they and the battery last longer.
 

lbenson

Senior Member
This thread shows a couple of small 08M2 and 14M2 PCBs for use with breadboards. They could easily be modified to stand alone. Or you could solder wires on.

http://www.picaxeforum.co.uk/showthread.php?25538-08M2-and-14M2-SIP-boards-with-Eagle-PCB-files

Eagle PCB files are included--you could simply send those files to oshpark.com, or generate gerbers and send them to iTeadStudio. I ganged together 2 of the 08M2s, one of 14M2s, and a tiny keyboard connector into the iTeadStudio 5cm x 5cm form factor, and got 30 boards for $20 U.S. I had to cut them apart with a band saw.

I agree that the download circuit should be included--I use a 3-pin header.

Many LEDs now can run with suitable brightness (for some projects) using 1k or even 2k2 resistors. You can run more than one led from a pin, taking care not to exceed the pin's 20ma capacity.
 

AllyCat

Senior Member
Hi,

A PICaxe 08M2 can work down to about 2.4 volts, but a WHITE LED needs at least 3.0 volts! So a Lithium "Coin" cell might be "tight" on volts and won't last a long time. One lithium rechargeable coin cell could do (3.7 volts) but are not easy to obtain, or two CRxxxx would give 6.0, fine for the LED(s) but the PICaxe would need a series forward diode (which could itself be a LED) to keep its supply within limits. Another possibility is to use a voltage up-converter (potentially just a tiny choke in addition to the PICaxe) to drive the LED, as is done in many of the cheap "Solar Garden Lights" (which often run from just a tiny, single NiMH cell).

How long does the battery need to last and what does the PICaxe actually do (e.g. switch on/off the LEDs occasionally or dim them)?

In principle, you can connect the programming pin directly to earth, but as others have said, I strongly suggest that you fit the two resistors and at least pins (or pads) for the three programming connections. Mount the resistors vertically and it can be done in 6 holes or 0.06 square inch of PCB area. Yes, I'd also suggest starting with "Veroboard" (0.1 inch stripboard) and can't see why a through-hole 08M2 and all the necessary components/connectors shouldn't fit in half a square inch of PCB (about half an inch high).

Cheers, Alan.
 

jensmith25

Senior Member
Thanks IBenson - The cost for the US seems far lower than ones I've found in the UK on just a general enquiry.

It's starting to sound a bit more possible. Two coin cells for 6v is an option.

Alan - I'm not really familiar with the power usage of the PICAXE but ideally I'd like a battery to last at least a week. Generally these models won't be on for very long. Normally for display purposes and battery life requirements vary depending on the end user. I'm happy to add the pins for the download connector.

I'm thinking of LEDs switching on/off primarily. Flashing effects are most likely initially.

I'm sorry - what is the difference between using a forward diode and a bigger resistor to limit the current to the PICAXE?

I'm preferring the 14M2 chip for the extra output pins but it's still pretty small.
 

Goeytex

Senior Member
The total number of LEDs that can powered directly by the Picaxe can be determined by the total I/0 current. It must not exceed ~80 ma.

With a 3V supply 2 series LED's may be a stretch on a single I/O, ( depending upon the Vf of the LEDS). In the real world the I/O voltage will droop under a significant load thus limiting the number of series LED's. A better way to drive the LEDs may be to use a transistor on each I/O pin. This reduces the I/0 drive current requirement to < 1ma per pin and eliminates voltage droop.

The PIC datasheet indicates that the device can supply 25ma I/0 pin. This is misleading and is an absolute maximum and not an idea operating condition. Empirical testing shows that the maximum current that a pin can actually supply is about 17ma @ 2.2v. This is with a 5v supply, and yes the I/O output voltage will droop that much.

If I were designing the board, ( especially if used commercially) and wanted the smallest footprint, along with good reliability, I would use all SMD components and provide a transistor drive on each output used to drive LEDs.
 

Hemi345

Senior Member
Take a look at Sparkfun's Eagle PCB tutorial for great help on getting started making your own PCB. The link below is to their Eagle library with additional links on that page for installing Eagle, creating a schematic and then the PCB:
https://www.sparkfun.com/tutorials/108

I have an Eagle library (see my sig) for the PICAXE chips in both PTH and SMD.

Here's a little pic of a board I created to charge a super capacitor using the SMD version of the 08M2, a little switch (side mounted) for power, a few surface mount LEDs, voltage regulator, and the download circuit header. All less than an 1" square. It's fastened to an AA batter pack with an elastic tie.


The skillet method of soldering really makes using small SMD components possible without a lot of effort/time/money. It only works for single sided boards (the other side would have to be hand soldered) but still the size of the board with all the components packed on one side will still be much smaller than any PTH board with the same number of components.

I've measured around 2ma with a 14M2 running @ default 4mhz. Factor in your your LEDs draw and that should give you a good idea on how long the batteries you choose should last without any power optimizations. Depending on how active you light show will be, you might be able to use the sleep command in between to offer a little more savings.
 

Dippy

Moderator
As post#9.
I agree reading the PIC datasheet requires some care (and patience).
You have to look further than the 'headlines' to get some figures.
e.g. 18F25K22 (DS41412F-page 427)
Max source (output) any I/O pin = 25mA
then
Max (total) source current all ports = 185mA
then
Output High = Vsupply - 0.7 (e.g. 4.3V @ 5V supply)
... with a 3.5mA load.
So, be aware.


Geoytex has done some measurements of Vout (Voh) versus load (Iout).
I don't know the behaviour of Vol vs load if using I/O as a low side.

"what is the difference between using a forward diode and a bigger resistor to limit the current to the PICAXE"
Apart from the droop
The output current for simple LED + series Resistor is:-
I = (Vout - Vf) / Rseries

So, you can see how the LED's forward voltage drop and series R value can affect the current.

The load can be reduced by using Hi-Brightness LEDs plus larger resistor, but they don't magically have low Vf.


If you are new to this it would be best to post your latest schematic (circuit diagram) and let people advise.
 

hippy

Technical Support
Staff member
What is the absolute bear minimum I need on a board for the chip to run?
Nothing but the chip and wires off to the batteries, download serial in pin shorted to 0V or via a resistor.

If using the DIP 14M2 on veroboard, with just one set of holes for wires to come out each side, you could get board size down to 0.8" long x 0.6" wide, about 20.5mm x 15.5mm. It is recommended to fit a 100nF capacitor across 0V and +V and that can be fitted on the track side of veroboard or, to keep depth to a minimum, an extra row only adds 0.1" length.

You can even avoid current limiting resistors if putting short pulses through the LED's but that comes with increased risk of damage to the LED's or PICAXE if you get the code wrong or it goes out of control. Pulsing through the LED's one at a time (multiplexing) might be an idea anyway to provide a solution to maximising brightness of LED's while keeping overall current down.
 

AllyCat

Senior Member
Hi,

I'm sorry - what is the difference between using a forward diode and a bigger resistor to limit the current to the PICAXE? .
The reason for using a diode to drop excessive voltage (the absolute maximum PICaxe rail is 6 volts) is that the drop is reasonably constant with varying current (say 0.6v for a normal diode, 1.5v for a red LED, 3v for a white LED), whilst a resistor obeys Ohm's Law (i.e. not enough drop at low current, too much at high currents).

The "core" of a working PICaxe normally uses about 0.5mA, but can be less than 0.1mA if put to "sleep". For simply flashing LEDs, it could probably be run at a lower clock speed, so power drain from even a coin cell shouldn't be a significant issue. But then you need to consider the current required by the LEDs: in some cases just a few mA may be suffcient, if it isn't then you may need many tens or even hundreds of mA!

IMHO the battery is probably the key to this project. There is a lot of related information in this recent, but rather long, thread. Coin cells are limited to about 25mA maximum and only a few hours if actually illuminating any LEDs.

Personally, I'd probably be looking at/for Lithium rechargeables from ebay or some hobby/model sellers (but there are issues of recharging, and carriage through Royal Mail, etc.). Or, "cannibalising" Pound Store Solar Garden Lights: Two will give a pair of tiny NiMH cells (2.4v for the PICaxe), two LEDs and the chokes required to step-up and current-drive them. Probably with a couple of "bonus" slide swtiches, and PV panels, etc. :)

Cheers, Alan.
 

jensmith25

Senior Member
Thanks for all the replies.

I need to be careful of battery choice because this is for commercial use (I hope) and there are now real restrictions over what can be posted. If coin cells aren't ideal as per the other post by the teacher then I think AAA or AA batteries will have to be the way to go. I know the limitations of coin cells but people like the small size and they're ok for a couple of LEDs.

I am loosing many of you on the more complex explanations (for me anyway). What is a choke?

I'll have a read through the Sparkfun tutorials - thanks for the link.
 

Hemi345

Senior Member
Choke / Inductor for a boost regulator. For example, the MCP16251 uses a tiny 4.7uH inductor to boost the supply voltage. You could run your circuit off a single AA battery (1.5V) and use the boost regulator to bump it up to 3.3V to power whatever LEDs you decide to use.

Speaking of chokes... I would be really cautious designing an accessory for a child's dollhouse using coin cells unless it's in a tamper-proof battery box. They're really bad choking hazards for kids.
 

jensmith25

Senior Member
Choke / Inductor for a boost regulator. For example, the MCP16251 uses a tiny 4.7uH inductor to boost the supply voltage. You could run your circuit off a single AA battery (1.5V) and use the boost regulator to bump it up to 3.3V to power whatever LEDs you decide to use.

Speaking of chokes... I would be really cautious designing an accessory for a child's dollhouse using coin cells unless it's in a tamper-proof battery box. They're really bad choking hazards for kids.
Thanks Hemi.

What I make is for adult collectors not kids. It may be a surprise but there are an awful lot of adults who build amazing dolls houses that have incredible detail and are true to period. It is the same as model train collectors or anything else like that.
 

inglewoodpete

Senior Member
(Coin cells) are really bad choking hazards for kids.
It's much more than a choking hazard. Once a 'live' button cell reacts with gastric juices, serious burns can occur in the digestive system caused by the current.

Back on topic, if you want a minimal circuit you can use the "dead bug" method of wiring. Hot glue the back (top) of the chip to something, leaving the legs sticking out. Then solder the other components to the exposed chip legs. You do need a steady hand!
 

Dippy

Moderator
At a guess I would have thought that "easily reproducible" (post#1) and "commercial use"(Post#15) precludes kitchen-table assembly design, except for prototype.

Your battery choice depends on a number of things; power-consumption, expected life-time, accesibility and space available. I wouldn't go for a coin cell. Not because of safety (a protective enclosure can always minimise risk) but because of price, availability and capacity.

The phrase "my teacher" suggests that you may not have a Microsoft-sized budget and therefore you will be looking at off-the-shelf parts and minimal development cost.

Do these doll's houses sit on a base? Could a hollow base be made?

Stan (manuka) and others have suggested items that can be off-board to save space.

Personally, I would sit down with pencil and paper and design what actually needs to be on the board and what can go off-board.
Then I would get a CAD and lay out the schematic.
Then using appropriate surface mount styles play with the PCB artwork to see what is possible.

You really need to define your requirements precisely and plan it out before you do anything.

I think I'll do an 'environmental' doll's house with solar-panels on the roof :)
 

Hemi345

Senior Member
Thanks Hemi.

What I make is for adult collectors not kids. It may be a surprise but there are an awful lot of adults who build amazing dolls houses that have incredible detail and are true to period. It is the same as model train collectors or anything else like that.
No, not surpising at all :) I was just in the local hobby shop yesterday and marvelled at the large assortment of siding and window material for those types of houses. The father in me just wanted provide caution just in case.

As detailed as those little houses are, maybe a C or D sized cell could be disguised/hidden inside the hot water heater tank or washing machine :)
 

AllyCat

Senior Member
Hi,

Yes, as you appear to be aware, ALL Lithium cells are "officially" banned from our Royal Mail, even coin cells! That's observed by most reputable companies (such as 7dayshop if you want the gory details) but ignored by some less reputable sellers on ebay (particularly in China) for example.

For "primary" (non-rechargeable) cells, AAA seem the most suitable for your application, but smaller do exist for remote control "key fobs", etc.. But for rechargeable applications, smaller cells do exist. I needed a few tiny wire-ended NiMH cells (less than 1 cubic centimetre) to repair several "7-day mains timers" (it's the backup battery), which were going to cost just over £1 each, plus postage, via ebay. Then I discovered that virtually all "Pound Shop Solar Garden Lights" contain exactly such a cell, with lots of other "bonus" components included as well. ;)

So I think £1 (or 2) could be a good "investment", to tear apart. You'll get a tiny battery, switch, LED and a choke/inductor (although it looks exactly like an ordinary resistor). The "chip on board" (usually under a "black blob") may even be usable as a step-up voltage converter (when the PV panel is disconnected or dark), but that depends on the exact design. At present my favourite is the "Cylindrical" or "Stainless Steel" version. Then you can consider commercial suppliers if/when you need larger quantiies for a "production" (marketable) version.

Cheers, Alan.
 

jensmith25

Senior Member
I wrote this earlier but then the forum had a wobble with a database error and I couldn't post it so I'm trying again!

Dippy - thanks.

You are right that it needs to look professional and there are cost implications in terms of both component costs and time/labour. You misread "my teacher". I was referencing the thread by the teacher looking for advice on his board that was referenced in relation to the coin cell batteries in this thread.

I don't have a teacher. My budget though is certainly not big and I do need off the shelf components ideally.

Dolls houses vary. Some people put them on a base but this is often just a sheet of MDF so not suitable for hollowing. On larger houses 1/12th scale electrics are normally hidden on the back of the house as this is rarely seen. Some people do make a base for smaller scale houses and these can be very small - houses about 8-12 inches high and around 4-6 inches wide.

I wanted to find out the minimum components I needed to run the chip and the LEDs and the smallest battery. If I can use the voltage boost chip/choke that might make using a smaller battery say AAA sized easier and I will explore that option.

Next step is to decide on my first programme for the chip and that will determine number of LEDs required to be powered and then I can do as you say and look at designing the circuit. One possibility is more for the railway side, as I have a nice LED package with 3 lights for that and just need the programme to make them 'work'.


Alan - You're allowed to send a couple of coin cells "installed in the device" which to me seems a bit silly as they're more likely to be active than if they're in their original packaging but there you go.

Certainly Using Alkaline batteries is best for this I think.
 

manuka

Senior Member
I think I'll do an 'environmental' doll's house with solar-panels on the roof
Dippy:Well said sir! This certainly has greenie merit,especially since the doll's house lights may only be intended to work at night. It's never too soon to start tomorrows adults on solar of course. At the rate PV tech is surging ahead by 2034 all homes may be "driven by the sun"!

Mmm-this assumes that only white LEDs are used - perhaps however other colour LEDs come on to signify hot ovens,kettles,hair curlers & diverse dolly houseware?

Jensmith25: If your budget is tight then certainly consider hacking solar garden lamps, as they make great little voltage boost engines-check the innards of a typical one below. If you don't want solar then remove the small panel & the system will act as if it's in darkness. The rechargeable 1.2V NiMH cell can then be replaced with a single 1.5V alkaline(?) cell, with the LED on/off controlled by the switch. Yes- you thankfully usually even get a nifty switch with the solar garden lamp! Sigh- increasingly it's often the boring things in electronics that now cost money ...

The output is very spikey but it can be smothed with an add on electrolytic capacitor. The supply then averages ~5mA at 3V = enough for easy PICAXE duties too. Stan.
 

Attachments

Last edited:

jensmith25

Senior Member
Thanks Stan. I wouldn't say budget was tight, just that the end product needs to be cost effective.

I think hair curlers might be a bit extreme in terms of lighting. They are made in miniature but not lit. I have provided lighting for fridges, freezers, ovens and microwaves though which are a bit bigger and also generally fitted to a wall so powering them is easier for hiding wires etc.
 

Pongo

Senior Member
Do you do TV's? I'm thinking some randomly flickering/coloring RGB leds behind a diffuser could give a TV effect when seen indirectly, like through a window.
 

jensmith25

Senior Member
I don't make any actual products anymore as they didn't sell and there are others that do it better than me, including 'working' TV's. I just make lighting products as that does well for me.
 

AllyCat

Senior Member
Hi,

You're allowed to send a couple of coin cells "installed in the device" which to me seems a bit silly as they're more likely to be active than if they're in their original packaging but there you go.

Certainly Using Alkaline batteries is best for this I think.
Yes silly indeed, but I believe that the "device" needs to be officially certified (CE Marked, etc.), so still potentially an issue for homebuilt/hobby products.

But if you're moving away from Lithium cells (which generate a "stable" voltage over life), bear in mind that although fresh alkaline cells deliver around 1.5 volts, it decays continually over life down to around 0.9 volts. Thus you should assume a voltage of no more than 1.2 volts per cell (i.e. the same as from NiMH rechargeables), so you would really need three cells (to operate white LEDs). That makes a voltage-boost system very appealing; the MCP16251 doesn't look too easy to obtain, but the MCP1640B is available from RS or Farnell [edit], but sadly not from CPC with their free shipping. Also, a single "N" cell looks interesting, only 2/3 the length of an AAA, but similar capacity (slightly larger diameter). Not as easy to obtain (or cheap) as AAA or AAs, but that might justify going to a single NiMH rechargeable (with boosting).

You haven't said what the PICaxe is actually required to do, but it could certainly "manage" the recharging of cells and/or monitor the present battery state (of charge). The normal (3.5mm) PICaxe programming socket (very low cost) could also be used as a recharging connector and also includes two switches which might be used to switch "off", or for simple program configuration. There was an interesting thread some years ago where a PICaxe was able to monitor the light level using the "display" LED itself. I'm not sure if that would work with a white LED, but certainly an additional "water clear" packaged IR phototransistor or LED (perhaps even a glass diode such as 1N4148) could monitor the light level. Normally the LED would switch on in low light levels, but a "Fridge" version (configuration) could turn ON in the light (i.e. when the door is opened). A simple "IR" sensor (silicon transistor or diode) might also permit the "user" to configure the PICaxe program (on-off times, sensitivity, etc.) using a "standard" Remote Control.

So, lots of interesting possibilities. I've even done a "back of envelope" design using just two "button"-sized NiMH cells as used in cheap Garden Lights (the PICaxe needs 2.4 volts), with the PICaxe (PWM oscillator) boosting the volts for a white LED and managing the charge/discharge of the cells, plus all the normal switching/dimming functions.

Cheers, Alan.
 
Last edited:

RexLan

Senior Member
I build scale model wooden sailing ships from kits out of Italy and use fiber optic cable for all sorts of lighting. The Picaxe and one LED can run a lot of miniature "look-like-lights".

I use a cable but you can buy a very inexpensive lamp in a novelty store that will have plenty of lines and everything you need. Typically under $10 US.

Image1.jpg
 

jensmith25

Senior Member
Thanks Alan and RexLan.

I still need to decide what I want the initial output to be. I don't want to waste time doing something that isn't of interest to anyone, or only a few, so will look into options.

There are certainly a lot of possibilities. Regarding the batteries, a rechargeable would be worth considering if the PICAXE can charge it. I'm cautious of using a battery that is hard to obtain or costly as the end user will ultimately need to purchase a replacement. Even rechargeable ones don't last forever.

RexLan - I have investigated using fibre optic cable but in many situations I use LEDs for it just isn't bright enough. It certainly has it's uses though and I have something I'm currently working on to use it for.
 
Top