Graphing Calculator Dual Boots With Pi Zero

The nearly limitless array of consumer gadgets hackers have shoved the Raspberry Pi into should really come as no surprise. The Pi is cheap, well documented, and in the case of the Pi Zero, incredibly compact. It’s like the thing is begging to get grafted into toys, game systems, or anything else that could use a penguin-flavored infusion.

But this particular project takes it to the next level. Rather than just cramming the Pi and a cheap LCD into his Numworks graphing calculator, [Zardam] integrated it into the device so well that you’d swear it was a feature from the factory. By exploiting the fact that the calculator has some convenient solder pads connected to its SPI bus, he was able to create an application which switches the display between the Pi and the calculator at will. With just a press of a button, he’s able to switch between using the stock calculator software and having full access to the internal Pi Zero.

In a very detailed write-up on his site, [Zardam] explains the process of getting the Pi Zero to output video over SPI. The first part of the battle was re-configuring the GPIO pins and DMA controller. After that, there was the small issue of writing a Linux SPI framebuffer driver. Luckily he was able to find some work done previously by [Sprite_TM] which helped him get on the right track. His final driver is able to push 320×240 video at 50 FPS via GPIO, more than enough to kick back with some DOOM.

With video sorted out, he still needed a way to interface the calculator’s keyboard with the Pi. For this, he added a function in his calculator application that echoed the keys pressed to the calculator’s UART port. This is connected to the Pi, where a daemon is listening for key presses. The daemon then generates the appropriate keycodes for the kernel via uinput. [Zardam] acknowledges this part of the system could do with some refinement, but judging by the video after the break, it works well enough for a first version.

We’ve seen the Pi Zero get transplanted into everything from a 56K modem to the venerated Game Boy, and figured nothing would surprise us at this point. But we’ve got to say, this is one of the cleanest and most practical builds we’ve seen yet.

[Thanks to EdS for the tip]

36 thoughts on “Graphing Calculator Dual Boots With Pi Zero

  1. “The nearly limitless array of consumer gadgets hacker’s have shoved the Raspberry Pi into should really come as no surprise. The Pi is cheap, well documented, and in the case of the Pi Zero, incredibly compact. It’s like the thing is begging to get grafted into toys, game systems, or anything else that could use a penguin-flavored infusion.”

    Sounds like what Donald A. Norman’s book: The Invisible Computer was getting at back in 1999.

    1. fbtft is a bit too sophisticated for this application. It tries to update only what changed on the display, and needs to send command to the controller to do it. It was certainly possible to adapt it, but it was easier to write a custom driver, just to push the whole framebuffer over SPI at regular intervals.

    1. add goodwatch guts for good measure so even if they get technically aware, just scanning for local wifi/bluetooth won’t help
      Is there any more news on the goodwatch?

  2. Am I giving away my age when I say that I remember when DOOM first came out and most desktop PCs at that time couldn’t actually run it? (I also remember when the Altair 8800 was new, so I’m probably older than even I think) The fact that a $5 computer the size of a business card stuffed into a calculator can run DOOM still amazes me a bit.

    1. The Numworks is only $99, which is pretty cheap compared to some of the models from Texas Instruments.

      Considering that you’re getting a fully open source device that even includes a Python interpreter, I’d say it’s an excellent deal.

    2. Have you tried to buy a graphing calc in the last… decade?
      I thought I was getting a good deal on a TI Inspire CAS model for $120, but wish I’d gone with the Numworks and written my own software for it.

    1. “Do not reduce oscillation into that good night, RESET! RESET!”

      They will probably find a 555 buried in the money pit on Oak Island hehe
      I agree tho and it makes me feel old(er)

  3. This is amazing. Good job. I see the numworks as the pi portable accessory we were all looking for. Big plus that the host system seems to remains intact. If the zardam is monitoring the comments I had a few questions:

    1. What is the approximate run time with calculator with the Pi & Wifi on?

    2. Is there any power-drain from the attached pi when not using the pi?

    3. Maybe I missed it on your github post, but could you specify what you did on the numworks to add the raspberry pi as an application?

  4. Wow. TI graphing calculators sure suck these days. My TI 84+ silver only has a z80 under the hood. I have more powerful computers from 20+ years ago. It is also a shame the strict and arbitrary rules around high school tests that should be all calculator free.

    1. “It is also a shame that there are strict rules around what calculators you can use on SAT-ACT tests. Many of these rules are silly and arbitrary. Students shouldn’t be using a calculator anyway.”
      My kingdom for an edit button.

    1. Well, the math suggests it should get 5 and-a-half to 6 hours at minimum (4.75 hours at worst), possibly quite a bit more. NumWorks estimates its 1620 mAh battery lasts the calculator 21 hours under the following use condition: screen “on” half the time (113 mA) and “dimmed” the other half (36 mA). That yields 21 hours 45 minutes, theoretically. And with the screen on “all the time” it should get nearly 14 hours 20 minutes. I believe the pi zero w specs rate it at 180 mA (and Zardam above states 140 mA on average, and the link states: 120 mA (at idle) and 160 – 170 mA (during moderate use). So, power consumption with pi 0 w and screen on should be between 273 mA and 293 mA [5 hours 32 minutes to 5 hours 56 minutes], and if a screen saver and power management is set on the pi “half” the time at 156 mA [7 hours 13 minutes to 7 hours 33 minutes]. If the pi is idle with screen saver and other power management features on “all the time” it could last up to 10 hours 23 minutes, but at that point it would be better to turn the pi off and go back to calculator only mode where the pi consumes no power. So, the pi zero w would cut the battery time by about 60 to 65 % give or take. But some ultra portable and lower end laptops only last seven to nine hours, so this wouldn’t be too much worse, in comparison. Would love to try this mod if I had the soldering and coding and hardware skills to pull it off.

  5. If Zardam is monitoring the comments, please respond to these questions:
    what part is the programming of the calculator? and how did you open a cmmd line to the calculator? What type of resistor is it and where did you get it?


    1. I don’t understand what you mean by “what part is the programming of the calculator”. If you mean the firmware of the calculator, you can find the source code here : Sorry, no binaries as I think it is prohibited by the licence.

      There is no command line on the calculator itself, but you can access the RPi one by the usual ways (SSH, display, …)

      If you mean the resistor I used to pull up the gate of the mosfet (for power supply of the RPi), it is a 10 kΩ SMD that you can find “everywhere”.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.