Omnimaga

General Discussion => Technology and Development => Other => Topic started by: Keoni29 on December 11, 2012, 10:02:22 am

Title: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on December 11, 2012, 10:02:22 am
Edit: Video:


I made a promise in the casio calculator watch thread: to hack myself a calculator watch to prove I'm a true and dedicated hacker.
Guess what? It actually happened. 3 days after I made the promise I got my nokia lcd in the mail, so I thought I could as well just make it into a watch.

(http://img.removedfromgame.com/imgs/2012-12-11%2013.41.43.jpg)
I haven't got all of the parts yet, but I'm making good progress on the firmware.

Specs so far:
Hardware
CPU: Atmega328 @16Mhz
POWER: 3x3v batteries
INPUT: 3 microswitches
OUTPUT: 84x48px blue backlit LCD. Holds up to 12x6 ascii characters.

Software
- Clock with date and year.
- String and code editor (syntax brainf**k)
- Brainf**k interpreter. (Stand alone or in "tray" when in clock mode)
- Timed backlight

(http://updo.nl/file/d10ef515.jpg)

Other stuffs
- Artificial leather strap. There is copper cable at the end.
- A little plastic tray from a toy. The LCD fits perfectly! (I will paint it!)

Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: TIfanx1999 on December 11, 2012, 10:12:03 am
I saw this in the other thread, really awesome stuff! ^^
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on December 11, 2012, 10:17:23 am
I added some clever code to the break option in the interpreter. Now, when you break out of an infinite loop it disables the execution of the program in the tray on the home screen. This is to make sure the thing does not freeze.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: DJ Omnimaga on December 18, 2012, 03:09:21 pm
I love it so far :)

Is it any comfortable to wear, though? :P
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on December 18, 2012, 03:12:43 pm
The brain**** interpreter is cool, but not actually useful ;) Maybe make some kind of limited BASIC that is tokenized, so you can just select it from a list?
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on December 18, 2012, 03:40:15 pm
I love it so far :)

Is it any comfortable to wear, though? :P
It actually is quite comfortable to wear right now. This thing doesn't weigh a lot without the board and the batteries in it. The artificial leather strap is not too tight and feels soft to the skin.

The brain**** interpreter is cool, but not actually useful ;) Maybe make some kind of limited BASIC that is tokenized, so you can just select it from a list?
I got a limited amount of program space. I am using 12 out of 30k of max program size at the moment. This includes the clock, interpreter, menu, LCD routines and some other stuff.
A basic will require a lot of strings which increases the program size. I might add it eventually.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on December 18, 2012, 03:43:15 pm
I got a limited amount of program space. I am using 12 out of 30k of max program size at the moment. This includes the clock, interpreter, menu, LCD routines and some other stuff.
A basic will require a lot of strings which increases the program size.
What processor are you using? My PIC18F46K20 has 64 KB of program memory, and I wrote some complex programs that never even took up half of it. Maybe you should try a PIC18F?
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on December 18, 2012, 03:45:23 pm
I will not use a PIC18F. Porting the source I already got is going to be a pain. I might make more watches in the future with different programming languages. Perhaps ones with a numeric keypad.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 07, 2013, 10:44:14 am
Started building! I got all of the parts and now it's all coming together.

Edit: Ok... the batteries drain completely in one minute...
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 07, 2013, 04:32:08 pm
(http://updo.nl/file/d272c8d6.jpg)
It does not have buttons yet and the batteries cannot supply enough current for the backlight, so that's a problem. I need another power source!
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: fb39ca4 on January 07, 2013, 04:39:22 pm
Kickstarter!
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 07, 2013, 04:53:24 pm
I should try to make one of these, with a PIC18F26K20. Maybe we could see whose is better once I start making mine ;)
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: DJ Omnimaga on January 07, 2013, 05:07:49 pm
You should use a car battery for the watch since it will require a lot of power to do all the stuff it will do (even more than running Crysis)

Just kidding, glad it's still progressing :)
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Hot_Dog on January 07, 2013, 05:11:41 pm
Wow, this is awesome!

After reading about brainf**k, I think it's a great choice.  How much memory will be reserved for a brainf**k program on the watch?
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Sorunome on January 07, 2013, 05:40:25 pm
Arduino! :D
And nice that you have some progress :D
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 07, 2013, 06:05:36 pm
There a limit of 60 instructions at the moment since the screen can only hold 72 characters. I will eventually implement a scroll function to be able to expand programs.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 08, 2013, 01:01:59 pm
Sad news: This early prototype is not self-contained. Which means: There is simply not enough space for batteries. The cr2032 cannot supply enough current and they drain rapidly, so this is what I came up with: A small cable to a battery :3

This is obviously a very early prototype. When I want to shrink things down I'm gonna have to etch a printed circuit board and I'll be using SMD components. By shrinking down the components I need less power, so a single 3V cr2032 might do the job. I will also use a smaller LCD probably using only one LED for the backlight.

Oh by the way: a youtube video is coming soon.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Nick on January 08, 2013, 01:19:16 pm
Sad news: This early prototype is not self-contained. Which means: There is simply not enough space for batteries. The cr2032 cannot supply enough current and they drain rapidly, so this is what I came up with: A small cable to a battery :3
That's a nice solution, the battery will still be attached to the wathc I guess/hope?

It's kinda inevitable that it consumes a 'lot' of power, but have you thought about some kind of sleep function? As you can see here (http://www.gammon.com.au/forum/?id=11497) you can save a lot of working time by simply putting it into sleep, together with dimming the backlight. Or have you already done so?
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 08, 2013, 01:28:44 pm
But will it still keep track of time when it's sleeping? I'm not too sure about it.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Nick on January 08, 2013, 01:29:20 pm
Don't you use an RTC?
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 08, 2013, 01:35:36 pm
Nope. I use software to keep track of time.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 08, 2013, 02:07:58 pm
I've been making  mockups of how my watch-thingy is going to look and behave. I'm thinking it could have a small rechargeable battery in it, and have a dock for it where it could charge. As I think of more ideas and concepts, it's turning into less of a watch, and more of a little handheld thingy. Also, Keoni, mine will have 5 buttons instead of the 3 that you have :P
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 08, 2013, 03:00:13 pm
Why do you need so many buttons? My guess: Because it is a friggin pain to enter code with 3 buttons as you can see in.... THIS VIDEO!
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Juju on January 08, 2013, 03:34:03 pm
That's pretty cool! Will you release the schematics when it's done?
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 08, 2013, 03:39:20 pm
Sure
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Nick on January 08, 2013, 03:42:50 pm
It looks great :) although I would consider an RTC, that might come in handy.. do you use millis() now?
I like the simplicity of it, how you can do anything with only 3 (!) buttons
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 08, 2013, 03:44:42 pm
I use a time library which uses the internal timer to keep track of time and date! There are two buttons for increasing and decreasing and one for the mode of those buttons. Sometimes they just act like 3 option buttons.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 08, 2013, 05:49:05 pm
Did you solve your battery problem yet? If not, this may sound really trivial, but do you have a resistor in line with your backlight connected to the battery?
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Sorunome on January 08, 2013, 08:24:50 pm
Will you make more than one and sell it? lol
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 09, 2013, 08:30:12 am
Did you solve your battery problem yet? If not, this may sound really trivial, but do you have a resistor in line with your backlight connected to the battery?
Yes I do have a resistor in line with the backlight. It cannot run off cr2032 batteries because they are just not suited. I prefer a rechargable battery. Not many people have a lithium cell charger (I don't have one either), so when you have to change these cr2032 out all the time it will become quite costly.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 09, 2013, 08:57:27 am
Since the device comes out of the wrist strap, maybe you should make a charging dock for it, if you're using a rechargeable battery.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 09, 2013, 09:54:10 am
We'll see. As for now there is no space for an internal battery since I used DIP components.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 09, 2013, 02:05:38 pm
Where did you get your LCD? I'm looking for a small 4 line by 10 character LCD (for my project, which is similar to yours, and my 2 line by 16 character display is just a bit too wide).
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 09, 2013, 02:07:49 pm
My lcd is called nokia 5110 lcd module. I got mine from ebay. There are a lot of people who sell it. Just pick the cheapest one :) Don't forget to check the rating of the seller.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 09, 2013, 02:16:58 pm
Thank you! My device will be somewhat like yours, but have a simple BASIC-like language on it. Actually, this device will probably be some kind of handheld, so my wider LCD would work. I could have it work with 6 buttons. 5 in the front: 2 soft keys, 2 directional keys (left and right arrow keys) and an OK button. On the side there will be a button that brings up a menu of functions (clock, stopwatch, programming, and system info).
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 09, 2013, 02:18:02 pm
System info XD Come on, man...
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 09, 2013, 02:20:34 pm
Memory usage.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on January 09, 2013, 02:28:37 pm
Oh that. I thougt system firmware version, manufacturer and production date etc.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Spyro543 on January 09, 2013, 02:35:22 pm
That too will be included in system info. When I get home, i will start programming this. Once I figure out how to orient the LCD correctly on the bread-board :P
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on June 19, 2013, 10:22:37 am
It has been a while since I worked on this. I found some nice and flat 3,7V lithium batteries which are perfect for a project like this! However: My wireing job was a mess. I am much more skilled now than I was a couple of months ago, so I'm going to re-wire the whole thing and add the fancy new battery pack. We'll see how it goes.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Sorunome on June 19, 2013, 01:43:05 pm
Good luck with it!
I hope you'll still remember where which wire goes :P
And I hope the battery'll be worth it :)
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on June 19, 2013, 01:44:14 pm
The battery was inside a gifted 3rd party ps3 controller, so of course it's worth it!
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: DJ Omnimaga on June 20, 2013, 03:20:05 am
Cool to hear. You should post more pics of it or maybe a video of it in action when ready for showcase :)
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Dapianokid on June 20, 2013, 04:42:23 pm
i am thoroughly impressed.
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Streetwalrus on June 20, 2013, 05:40:59 pm
That really sounds awesome. I'm impatient to see it in a finished state. :D
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on December 12, 2013, 06:17:43 pm
Remember I first introduced this almost a year ago? Well, now I am rebuilding it! This project got scrapped for parts, but it will be rebuilt with better parts now! It will be smaller, fancier and perhaps have more features!
(http://8times8.host56.com/wp-content/uploads/2013/12/20131213_003721-300x225.jpg)
It now runs off a single cr2032 battery!
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Juju on December 13, 2013, 11:41:30 am
Nice!
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Keoni29 on December 14, 2013, 05:28:48 pm
I wired it all up including the buttons. Everything is stuck to the lcd pcb using glue. This way I don't need a pcb (which would increase the size of the watch.)

The size of the components is about 50*50*20mm or 2*2*0.7inch. Now I need to make a nice case!
Title: Re: Custom calculator watch (with Brainf*ck interpreter)
Post by: Sorunome on December 14, 2013, 05:29:18 pm
yay, looking awesome :D