magic-locket.png

This microcontroller-enhanced locket makes a great present and in this instructable you will find how to build your own. While implementing this project you will also learn all basic things required to program PICAXE-08 microcontroller and find out how to get 3 PWM channels from a microcontroller that has just one.
 
 
Remove these adsRemove these ads by Signing Up

Step 1: Video Overview



Check out this video for a quick demo and build process overview.
DirtyMex says: Feb 23, 2013. 9:15 PM
awesome instructable, just one concern. I have a 08m2 microcontroller, because i couldnt find a 08m. i programmed it the same way it was written here, and it went though, but it only stays on 1 color with the program installed (its a mix between r&g) and when i take off the program, it turns blue. if you could please help me figure out a solution for this it would be much appreciated.
mikhalchuk (author) says: Feb 24, 2013. 9:11 AM
Hi DirtyMax,

Unfortunately I don't know exactly what's happening in this case, but here are my guesses:
- wiring. Is there a possibility that the LED is hooked up to the controller incorrectly or of a wrong type? There are ones with common anode and common cathode. Also LEDs have different characteristics, many require different voltage on different pins.
- the clock speed. This is a sensitive parameter, please try to change it
- can you check that all colors are working in the LED? For instance use a battery to turn the colors independently. Please refer to the LED spec for correct voltage for each color.
- Try using a multimeter or, much better, oscilloscope to verify that the microcontroller outputs correct voltage or signal on each pin connected to the LED.

These are my best guesses, unfortunately I don't remember all the details about this project, I made it a really long time ago.

Regards,
Andrey
GeorgeHSmith says: Jun 26, 2012. 1:54 PM
Great project!
GeorgeHSmith says: Jun 26, 2012. 1:48 PM
Hi mikhalchuk,

Great project! :)

Just got a question about using the servo and servopos commands in the code.

So the servo command produces 20ms pulses / 50Hz.

So servopos 2, 75 would produce a 50Hz signal with 3.75% duty cycle

and servopos 2, 225 would produce a 50Hz signal with 11.25% duty cycle

So none of LED pins ever get to 100% DC / fully on?

Thanks
Bot1398 says: Mar 3, 2012. 7:29 AM
Cant we just use the disconnect commant and then remove the 10k resistor as a pull up.
maxsuit says: Aug 3, 2011. 7:24 AM
How to connect DB-9 connector... On bread-board...??
dis is my 1st time so i need ur help plz...
tell me...

Thank you
mikhalchuk (author) says: Jan 31, 2012. 10:00 PM
probably the easiest way is to solder some solid (not stranded) wire to the 3 pins you need from DB9 and insert them into the breadboard. DB9s unfortunately not breadboard-friendly as is.
BTW, Sparkfun also sell breadboard-friendly breakout boards for DB9.
triumphman says: Aug 14, 2011. 7:49 PM
Don't think this will work, the locket is too small for what has to go into it. I 'm pretty sure the guts are to big. How can you prove it will work? This is also not workable to those who do not have the wherewithal to complete this project as shown. Too technical for your everyday instructable folks. Nice locket though!
mikhalchuk (author) says: Jan 31, 2012. 9:53 PM
Sure, check out the video. Some sanding paper and a file help to fit large chips into small lockets :)
In fact if you manage to solder SMD version of PICAXE you can fit it inside easily.

I agree with "too technical" for most people, but I found a lot of very smart and skilled people here on instructables doing much more complex things. So hopefully someone will use this to make a cool present to the loved ones.
flyingpuppy says: Aug 16, 2011. 4:37 PM
Stunning! I can't believe this is a DIY!!!! Congrats, btw.
mikhalchuk (author) says: Jan 31, 2012. 9:49 PM
Thanks flyingpuppy!
Davercles says: Dec 13, 2011. 6:40 AM
This is a very cool instructable! Thank you for sharing.
My question is: Do you know how long the battery will last in this configuration and with the programming used to make the instrucable?
Thx! Davercles
mikhalchuk (author) says: Jan 31, 2012. 9:49 PM
Thanks Davercles,

I didn't do full-blown testing, but it sure can run for a few hours based on tests I made.

Andrey
sengrath says: Jan 12, 2012. 12:46 AM
Hi Mikhalchuk , I cannot find in Romania the Picaxe microchip. and it's kind of costly to get it from UK , as I only want to build one . I have at my disposal one 12f675 microchip can I use this one instead ? how will the programmer need to be changed? Thank you
mikhalchuk (author) says: Jan 31, 2012. 9:48 PM
sengrath,

Sorry, I don't know that as I'm not a PICAXE guy (I like atmels more). My guess would be that exactly the same programmer will work for 12f675, you just need to check the pinout for that chip and map it to PICAXE. I could be wrong though.

Andrey
AndyGadget says: Jan 23, 2012. 10:27 AM
 
Very nice little project!
The 08M isn't quite fast enough to do full control of brightness using mark / space ratios without flicker but using the servo command as you've done is a neat way around it, even though it doesn't give you control up to full brightness. 
You're actually running with a very low mark-space ratio - 0 to 2.55 ms in a 20ms frame, but you've no current limiting so it all averages out and the main thing is - It works, it fits and it's bright enough.  ( Who needs design rules anyway #;¬)

With Valentine's day coming up I may do something similar using a flat square 'Pirhana' type LED.
mikhalchuk (author) says: Jan 31, 2012. 9:44 PM
AndyGadget,

Thank you for the comment and useful info.

Magic locket-2 is coming, it will be even better. I hope to have it published here soon.

Regards,
Andrey
AndyGadget says: Jan 23, 2012. 12:55 PM
Something you don't mention anywhere is connecting pin2 of the PicAxe to 0V once it's removed from the breadboard. This is important as letting it float makes the micro prone to random resets.
Watching the video more closely I see you do mention shimmering. If that's a problem then upping the frequency (setfreq M8) would reduce it. (But you probably know that already #;¬)
mikhalchuk (author) says: Jan 31, 2012. 9:46 PM
Well, the frequency is actually set somewhere in the top of the code and it's easy to change, but I decided to stick to 8MHz hoping this will let it run longer from the tiny batteries I use.
Thanks for the floating pin note!
IHawkins says: Jul 18, 2011. 9:56 PM
Awesome idea. I live in Perth WA and wouldn't have a clue where to get all of these parts. Do you make and sell these? If so can I get 2 of you
mikhalchuk (author) says: Jul 19, 2011. 9:24 AM
IHawkins, you can get all these from ebay.com except for the locket which I've got from amazon.com. But you can use any hollow jewelry with and fill it with electronics.
benjamin.singleton says: Aug 4, 2011. 8:57 AM
Could you tell us the name of the locket you got Amazon, I'd love to do this as a present for a friend, and it'd be easier if I didn't have to spend most of the time locket-shopping ;) Thanks so much for the awesome instructable!
rcbailey says: Jul 14, 2011. 3:55 PM
The Picaxe 08M is also available in a Surface Mount version that is slightly smaller. Careful soldering directly to the leads would reduce the overall size further.
mikhalchuk (author) says: Jul 14, 2011. 4:21 PM
rcbailey, Thanks for the idea!

I also think some people will find using SOIC from the beginning, easier to than faking/baking one from PDIP :) The reason why I chose PDIP is because
- it can be easily used in breadboard prototypes
- it doesn't require any advanced soldering skills
I hope this sounds reasonable.
Hume says: Jul 14, 2011. 10:48 AM
This is a great project! I wonder if it would be possible to incorporate RFID into it, so that you could make two lockets that only glow in the presence of the other. Do you think that would be doable?
mikhalchuk (author) says: Jul 14, 2011. 4:16 PM
Hume, thanks for the great idea!

I don't think it is easy to fit RFID reader into this particular locket though. Even the tag that would fit it would have very limited range. Maybe it could be done with a larger piece of jewelry?
godofal says: Jul 9, 2011. 5:20 PM
nice instructable
you could get it even smaller by using rainbow LED (search it on ebay) those have a chip inside them to make them fade between colours automatically
you'd only need to supply it with 3V
mikhalchuk (author) says: Jul 9, 2011. 7:10 PM
Yeap, I mentioned those in the rtfms.com blog (it provides more information than the instructable). The "slow" rainbow LEDs produce similar effect, but they are not programmable, so you can't change the pattern.

I also wanted this instructable to be a tutorial for PICAXE.
rondadon says: Jul 8, 2011. 10:43 PM
Can you give the dimensions for the locket you used, in millimeters? Like you said, the one you used isn't available on Amazon now and it's hard to tell what size will fit the components. Thanks!
mikhalchuk (author) says: Jul 9, 2011. 7:12 AM
Found it!
http://www.amazon.com/Sterling-Silver-Filigree-Marcasite-Necklace/dp/B000J4DDH4

The outside dimensions are 17.6mm x 22.5mm x 10.3mm. It's difficult to measure inside dimensions, but it is at least 25% smaller inside because of the rims.

Unfortunately PDIP-8 and 5mm LED won't fit it without removing some extra plastic.
rondadon says: Jul 9, 2011. 9:46 AM
That's great, thank you so much. Can't wait to give this a try.
Korunks says: Jul 8, 2011. 5:34 AM
Where did you get the locket? I like the style and want to get one.
mikhalchuk (author) says: Jul 9, 2011. 7:36 AM
Korunks, here it is: http://www.amazon.com/Sterling-Silver-Filigree-Marcasite-Necklace/dp/B000J4DDH4
mikhalchuk (author) says: Jul 8, 2011. 11:57 AM
Here: http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=locket&x=0&y=0 :)

It looks like Amazon doesn't have exactly the same one anymore, but they have very similar ones.
ChrysN says: Jul 8, 2011. 4:30 PM
Wow, that is really pretty. Nicely done!
mikhalchuk (author) says: Jul 9, 2011. 7:35 AM
Thank you ChrysN!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!