Flashing X-mass LED's

Basrad

Member
I want to introduce some children to the PIC chip, by making some flashing LED light boards..

We have a load of the 18M2 chips, I know we should write our program in code, but i am restricted to using the flow chart system only. This is because of the level of the children + the fact some cannot read or understand numbers.

My question related to multitasking... If i want a chain of LED's to flash in a constant speed pattern, how do i set up another pair of LED's to flash independently of the first chain of LED's

for example the first chain D1 > 1sec > D2 > 1sec > D3 > 1sec > D1(Loop forever)

2nd chain D4 > 2sec > D5 > 1sec > D4 > 2sec > D5 (loop forever)

Can these run simultaneously out of sync?
 

Technical

Technical Support
Staff member
Using Logicator just pull out a second 'start' cell - you can have up to 4 'starts' on the 18M2s for the 4 separate parallel tasks.

Then use a series of high/wait/low commands on each flowchart - they will run independently at different speeds, no problem them being out of sync, that is exactly what parallel tasking is for!
 

manuka

Senior Member
Aha- so this is where all the 18M2 have gone! Aside from the kids limited skills it'd help to know - Where are you ? Budget ? Wiring skills? Actual kids ages? Adult helpers? How are the strings to be powered (MAINS SAFETY !) ? Cost effectiveness of such DIY strings ?

Perhaps better consider some Xmas "messages" & patterns etc rather than strings- last year here in NZ I bought a strings of 100 LEDs for just US$10 each, & these even came with a controller capable of ~8 different patterns. In fact I ended up using them just as a resource to snip out their MEGA bright red LEDs. Stan.
 
Last edited:

Dippy

Moderator
Blimey Stan, have one of my pills , give the bloke a chance ;)
You'll want to know his inside-leg measurement next.
I'm sure he'll ask things if he needs too.
 

Basrad

Member
:)

.... 30"..... (inside leg ;)

I have 65 of the 18M2's

Rapid had no problem supplying, Even though its not what we ordered. So decided to use them up with these x-mass LEDs..

When I said chains, I didnt mean a string of LED's, Our plan is to Print some pictures, stick them on a board and drill out wholes to stick LED's in...

The Pic board would be pre-made (by me x 65!) and they can custom a flow program on my laptop so that they can have the LED's flash as they wish.

4 STARTS!! Wow, Can you not use the older flow editor to add more than 1 start?? I'll be updating the editor on my laptop asap.

Might even see if the PIc and LEDs will power from 3volts to save on 9volt batts. Will test this later..

Thanks for the help today!
 

hippy

Ex-Staff (retired)
4 STARTS!! Wow, Can you not use the older flow editor to add more than 1 start?? I'll be updating the editor on my laptop asap.
Unfortunately not as that was written before the 18M2 was available. Also the four starts is only available for use with the 18M2 ( and forthcoming 14M2 and 20M2 ), other PICAXE are restricted to just a single start.

Might even see if the PIc and LEDs will power from 3volts to save on 9volt batts. Will test this later.
That should work. You may need to drop the LED current limiting resistor values but you seem to know what you're doing so have fun and we're all here to help if you do run into problems. You can also consider 3 x AA batteries for 4.5V which will normally last longer than 2 x AA and more than PP3 9V and save on needing a regulator.
 

Basrad

Member
9 volt batteries?

Could you provide more details
about your power supply please?

e
Well, I'v run the Pics straight from 9Volts with no problems (SO FAR) using a 300 sumthing ohm resistor for LED's OK.. And if 5Volts is required for ADC I'v used a 5volt Reg..

Would try 3 AA's, but happen to have 100 2xAA clips collecting dust... Eco building is the way
 

Technical

Technical Support
Staff member
No PICAXE chip will ever run correctly at 9V from a PP3.
It will just get hot and smell a bit.
 

Basrad

Member
Oh

I will bear this in mind in future - Thanks,

Though we have a couple of simple curcuits that seem to do fine on the 9V

(maybe the cheapo 9V's we buy are closer to 7V under load... )
 

1968neil

Senior Member
Just to clarify the points made by others.

Supply volts for the chip MUST be 5v or less, running directly from a 9v battery will destroy the chip !
Use a voltage regulator like the LM7805 series or similar.

The leds can be supplied from the 9v battery with a series resistor and or a switching transistor to handle the current.
rule of thumb is One Led to One output pin anything more will require the transistor etc.
Would hate you to end up with a pile of chips that are no good to man nor beast !

Regards
Neil
 

Dippy

Moderator
"I want to introduce some children to the PIC chip"
- good idea.

And I'll introduce you to reading the Manuals...

Manual 1 page 7.
 

manuka

Senior Member
ARGH- I'd STRONGLY URGE YOU TO AVOID USING 9V batteries in kids projects! Although if you want to introduce the kids & their parents to "hidden running costs" then 9V are certainly the way to go...

In general 9V batteries are a dead loss for more demanding current drains, and they also have low energy storage, are very costly & not always available. The only normal household items to use them are smoke detectors, and tragic results occur when this battery is "borrowed" for a project & not returned to the detector...

All the way with AAs instead. Using just 2 or 3 in a switched battery box will drive the PICAXE directly & also run swags of LEDs. Fellow Kiwi Andrew Hornblow has done a lot with pre teens & bare bones PICAXE setups here in NZ- refer => http://picasaweb.google.com/picaxe He swears by just 2 x AA for learners, since even crazy wiring setups (which kids WILL do) wont destroy the PICAXE or LEDs

Thought: If you want some greeny points (which ALWAYS go over well with parents) even maybe grab some cheap solar garden lamps & hack their parts for your project. Naturally you'll need some sunbeams for charging, which relates (again!) to just where you are. Stan.(in VERY sunny NZ)
 
Last edited:

Dippy

Moderator
We haven't had a "fellow kiwi Andrew Hornblow" for ages. I'm pleased it's coming back.:)

Oh dear Stan's on about PP3s again...
If it fits in the box and you can make it low power then use what you like ;)
I've made PIC/PICAXE + PP3 stuff that suffers battery rot before it goes flat.
Depends on the App and how good you are at designing.
 

manuka

Senior Member
Dippy- YOUR superior skills & insights may make such 9V circuits viable, but virtually any simple kids PP3 powered project almost certainly will become a battery black hole. Although I speak from decades of experience,for heavens sake do the maths yourself- a dozen LEDs at even 4-5mA each will mean ~a 50mA total drain ! Even alkaline PP3s costing £2 each have barely 500 mAh capacity, meaning such a Xmas LED circuit will be dead by morning...

Let's remember the ethics in designing circuitry that is cost effective to run, as it may otherwise just become e-waste. I recall a ~1988 era Sony portable digital radio that became scorned as " a new way to flatten batteries", and virtually any yard sale has discarded kids superregen. 27 MHz walkie talkies,as replacing their 9V batteries costs more than the sets themselves sell for new.
 
Last edited:

premelec

Senior Member
Stan I think Dippy uses 90% efficient step down switching converters so they'll go all through the day till evening... I'd stay away from 9v batteries if I could but have some multi-meters that use 'em. Some day I'll make a step up converter that looks like a 9v and runs on AAs. Or even a single AA from a walk light up converter [they go well over 9v unloaded].
 

manuka

Senior Member
This is because of the level of the children + the fact some cannot read or understand numbers.
These kids are apparently very young! In contrast Dippy has enhanced skills that I'm sure include wrangling individual electrons, taming global warming and even rustling up PP3 powered kitchen sink anti-matter generators. (This harks to a standard physics joke,most often heard when faced with post party kitchen chaos).
 

premelec

Senior Member
numbers / numerals

This statement reminded me of of a teaching device I built 50+ years ago which had a probe and 10 holes labeled 0 to 9 and 9 neon lights. There was a 22 position stepping relay which made a satisfying clunk when it stepped and selected a new light display. When the kid put the probe into the hole showing the numeral representing the number of lamps lit it moved to a new number of lights displayed [22 step 'program'].

What I found really interesting was that adults confronted with this thing kept trying to predict the next number of lights rather than simply probing the numeral showing... the adult mind complicates stuff that kids didn't - and many kids learned the relation of number and numeral playing with the box...

Thanks to all you guys who have the patience and interest in educating kids and provoking their innate intelligence! A noble endeavor indeed.
 

Dippy

Moderator
I think I am being misdoobified. And I love the gentle sardonicism :)
And I was merely having a gentle tease towards the anti-PP3 Brigade :)


I am fully behind Stan wrt younger students/ novices using 3 x AAs.
And what Stan suggests in this app makes perfect sense.
But it is the strange general dismissive attitude (by anyone) towards PP3 that I find a little odd.
Of course, PP3s are pretty hopeless for a standard PICAXE circuit.
So are AAs when the going get's tougher. So are Cs ...Ad nauseum...

As usual it is down to the HFC - my favourite phrase.
And, be honest, low power / micropower designs have been discussed here dozens and dozens of times by "kids" and big kids.
Even a 'typical' PICAXE circuit that was only used for 5 minutes per day would be fine with a PP3.
So, generally, HFC.


Maybe the ch-ch PP3s you get over there are particularly poor? I had some ch-ch AAs last year which were half the weight (mass?) and a third of the real-world capacity compared to Energizer/Duracell.
You pay jack-crap and that's what you get.


What is the age range of "kids" by the way? If I were 14 and called a kid I'd feel insulted.

Anyway, I threw out the fly and it got taken... ;)
 

hippy

Ex-Staff (retired)
In further support of 9V PP3 - Hand-held boxes often have battery compartments which are designed for those and 9V will have plenty of headroom to use a transistor sized 5V 100mA LDO regulator.

More esoteric, fit a 9-way D with a bit of diode mixing and the unit can run from PP3 or from a PC serial port without a battery if it only requires low current.

Against that is the relatively low current capacity of PP3 which can give relatively short lifetime. That can partly be offset by using rechargeables.

To borrow a phrase, "horses for courses", but Manuka does have a point on 'needlessly filling landfill' and in most cases I would choose 3 x AA, though particularly because I usually have a lot of AA's around, alkaline, NiCd and NiMh. When needing a PP3 it is tempting to use one from a smoke alarm, but that temptation must be resisted!
 

manuka

Senior Member
When needing a PP3 it is tempting to use one from a smoke alarm, but that temptation must be resisted!
A well heeled & wise adult may resist,but few kids/teens will stop to consider the consequences. Worse still they may totally flatten the battery & THEN pop it back in. Reports on house fire tragedies often contain such chilling statements as "- smoke alarms were fitted, but missing/dead batteries meant they were not working-". Consider the ethics (never mind landfills!) -how would YOU feel if your PP3 powered kids project had lead to this tragic situation?

Modern electronic devices run happily on much lower voltages anyway. Powerful AA cells (both 1° and 2°) are globally widely available,and every home usually has swags of them. Borrowing a few from your digital camera to power (say) a toy may merely lead to inconvenience -rather than death.

EXTRA: I've just read news of the UK's sudden cold snap and early snowfalls. Such demanding conditions may lead (yet again) to preventable house fire tragedies as folks rig up impromptu heating etc to keep warm. Reading of such nightmares can be heartbreaking. Best check your smoke alarms - and your neighbour's...
 
Last edited:

Dippy

Moderator
Nurse! Nurse! He's got out again!

OMG, Kidde CO detectors take AAs !!!!
Hundreds of thousands are sold per year.
That means hundreds of children may be flattening the AAs and putting them back in the CO detector.

This getting desperate :):)
 

premelec

Senior Member
It's ok to borrow the battery AFTER the firemen arrive isn't it? I'm impressed with what we'll pay for energy in PP3 form [or AA...] say $4us for 8v x .6a ca 5 watt hours or ONLY $800us per kilowatt hour of energy.... such a bargain... [yes I use a solar panel and recharge my NiMH cells - it's fun, if not economic].

Now put the nice battery back in the smokey...
 

Basrad

Member
The great debate

Only just caught up on the debate regarding the PP3 choice I made..

I don’t know who pays £2 or $4US for them, but I get them for about 30 pence bulk 100+

But as mentioned the power is not great from them, and I certainly take on-board what’s been said about the ‘’borrowing’’ of smoke detector battery’s.. (I’ve done this) don’t wish to promote it with learners.

So the prototype was built using 2 x aa’s and its been running a couple of days now from a pair of brand batts..

Will certainly be using AA’s in future where possible.. Many thanks for everyone’s input here
 

premelec

Senior Member
Are those brand name alkaline batteries for 30 pence [with dates > 2012]? I don't use them by the 100 but a recent search didn't pull up anything that cheap - the $4 is at the local market when you need it fast and can't find anything to stand on to reach the smoke detector... :)
 
Top