Edit: This project has been completed. It has been documented as the ArTICam project and announced in a news article.

Prompted by an offhand joke on Cemetech's IRC channel on Wednesday, I set out to connect a camera to my graphing calculator. Several years ago, Cemetech administrator Shaun "Merthsoft" McFall and I purchased Gameboy cameras on eBay for a few dollars, hoping to use them for some sort of calculator project. Now, with the ArTICL TI Calculator-Arduino linking library rapidly maturing, I decided the time was ripe to turn my gaze once again to this project. Unfortunately, because the camera required about 8 digital GPIO pins and one analog pin to communicate with its host, I couldn't connect the camera directly to the calculator. I therefore turned to my Arduino and ArTICL to solve the problem.

Thus far, I have been able to use ArTICL together with an open-source AVR + Gameboy Camera library to control and fetch images from the Gameboy camera. Small connection issues unfortunately prevent me from yet having images to show you guys, but the camera and calculator are communicating, and because I can use something as simple as GetCalc(Pic1 to fetch a color pictures to my TI-84 Plus C Silver Edition, there is absolutely no calculator-side software required. The ArTICL library instructs the camera to begin taking a photograph when the REQ (request for variable) message the calculator sends as part of the GetCalc( command arrives, then fetches the pixels one-by-one from the camera while sending them out over the I/O port to the calculator. Implementing this required integrating a new mode into ArTICL, where a callback is used to fetch the bytes to send over the wire on-the-fly. Previously, all messages were buffered before sending, but a 265x165-pixel TI-84+CSE picture takes up nearly 22KB, even with two pixels packed into every byte, so the Arduino's 2KB of RAM was far, far too small to buffer the image.

I look forward to adding further updates to this topic as this (admittedly quick) project progress, and as I have on-calc 128x128-pixel, 6-level-grayscale photographs to show.

Very impressive. Now hook up a printer and we'll have an awesome calculator twin of this:

Is that a camera camera, or the gameboy camera dismantled?

Looks like this is turning into quite the fun filled project Smile
tifreak8x wrote:
Is that a camera camera, or the gameboy camera dismantled?
it is just the optical sensor from the Gameboy camera cartridge. The cartridge itself contains a circuit board and a battery, presumably to mediate between the gameboy and camera, store pictures, and provide the program that the Gameboy executes.

Quote:
Looks like this is turning into quite the fun filled project Smile
Definitely! I am hoping it will turn out to be easy so I can add it to the ArTICL examples folder.
Hmm why not one up this grab a cheap i2c expander, And do the magic that way? drops the arduino out and can be breadboarded nicer Razz
geekboy1011 wrote:
Hmm why not one up this grab a cheap i2c expander, And do the magic that way? drops the arduino out and can be breadboarded nicer Razz
It would certainly take the Arduino out of the equation, but on the other hand, I like that all you need is an Arduino and a calculator to be able to connect a camera to a calculator. I feel like that's a pretty neat conclusion, and if I were a teacher trying to come up with relatively easy but impressive labs for their students to try, it would be nice that they just need to add a Gameboy camera to an Arduino + calculator to make it happen.
*bump* After fixing one silly omission in the camera interfacing code, and adding the ability to send and receive the Gameboy camera registers (or more accurate, the M6428FP's registers), I have been able to take some pictures with my Arduino, Gameboy camera, and TI-84 Plus C Silver Edition. The output are 22KB, 15-color TI-84+CSE picture files, with a 128x128 camera image centered in the 266x165 picture. Because the Gameboy camera is grayscale, I use the 6 grayscale shades available to Pictures for the output. I still want to make a small TI-BASIC program that will let you set the brightness and contrast that the camera uses before taking a picture, but I'm quite happy with the results thus far. The only downside is that because pictures are 22KB (175,560 bits), the calculator takes about 12 seconds to receive each picture from the Arduino and write it to Flash, a slightly-surprisingly-fast 14.6 Kbps transfer rate.

Hahaha wow thats fantastic!

I wonder how interested TI would be in this Smile.
It sounds like you are sending data and discarding some of it. Why not do that on the arduino instead of the host? You are IO bound not CPU bound so this will speed up the transfer rate. Anyway this is a cool project. I myself have played with various camera modules and have though of doing something similar. In fact I have arduino sample code for the ov7670 that needs only a means to convert one pin from 5v to 3.3v. Two resistors may be all that is needed see https://github.com/ComputerNerd/ov7670-no-ram-arduino-uno
tr1p1ea wrote:
Hahaha wow thats fantastic!

I wonder how interested TI would be in this Smile.
I plan to share it with them as a possible fun activity for the classroom.
ProgrammerNerd wrote:
It sounds like you are sending data and discarding some of it. Why not do that on the arduino instead of the host? You are IO bound not CPU bound so this will speed up the transfer rate.
I'm not following you; which data am I discarding?
Are you cropping the picture to 128x128 pixels? Are you going from 15 shades to 6 shades? Also why 6 shades instead of 7?
ProgrammerNerd wrote:
Are you cropping the picture to 128x128 pixels?
The Gameboy camera produces 128x128-pixel images, of which 128x123 are valid image pixels. I embed this into a 265x165-pixel TI-formatted indexed-color picture in the midst of sending it to the calculator.
Quote:
Are you going from 15 shades to 6 shades? Also why 6 shades instead of 7?
The TI-84+CSE picture format offers 15 colors, which include a red, three shades of blue, yellow, orange, brown, green, and six shades of grayscale (including white and black).
Ok I must have read your post backwards. Now I understand what is going on. I think you should have the calculator do the centering. If I am correct you are sending 265*165*4/8/1024 which is as you said about 22kb. If you instead send 128*123*2/8/1024 and let the calculator instead of the arduino do the conversion you would only have to send about 4kb of data making the transfer speed around 5.5 times faster.
Yes, it would certainly increase the framerate. However, the advantage of my approach is that it requires absolutely no software on the calculator side, other than what is already included in the TI-OS. You use the GetCalc(Pic1) command to instruct the Arduino to take a picture and transfer it, and it arrives in pre-built Pic form at the calculator, again with no program installed on the calculator. Actually, sending the raw 256-level grayscale picture from the Arduino would take 128*123 bytes, or 15.7KB, more than half as large as the 22KB TI-formatted picture.
Idea: Use this to make a time-lapse program (I'd do it myself, but I don't have a CSE (although ArTIcl (probably wrong capitalization there) should work with the monochromes) or a Gameboy Camera). It could be interesting.
pimathbrainiac wrote:
Idea: Use this to make a time-lapse program (I'd do it myself, but I don't have a CSE (although ArTIcl (probably wrong capitalization there) should work with the monochromes) or a Gameboy Camera). It could be interesting.
(It's ArTICL, for Arduino TI Calculator Link). Yes, this would work equally well on a monochrome calculator, although I'd recommend using the 64x64 half-resolution mode that the Gameboy camera supports. In fact, I may implement that myself. Wink The idea for a time lapse system is a great one, and you could definitely try it yourself with an extremely trivial TI-BASIC program.
I don't have a gameboy camera, but I'll try to get this working with an old Serial Camera. I'll post a topic if/when I have something.
pimathbrainiac wrote:
I don't have a gameboy camera, but I'll try to get this working with an old Serial Camera. I'll post a topic if/when I have something.
That would be cool; please feel free to post a topic sooner if you're interested in using ArTICL for the project and would like to discuss it. It's worth noting that Gameboy cameras can be acquired for $5-$10 on eBay.
Very awesome, Kerm! I remember when we bought the cameras--glad one of us finally did something with it Smile

Next up, you should make it so the calculator needs to recognize your face to unlock it.
When TI sees this project, i'm sure they'll quickly release a new calculator so no one would mess with it. Plus add the features from the Cemetech projects.

How about TI release the TI 84 Plus Gold Edition with a camera, sound without headphones, bug-free ti-os 5.0 which I hope they implement icons, taking a page from Doors CSE.

I'll post a new topic, TI-84 Plus Gold Edition, with a mock-up soon.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement