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]
Amazing hack! Though the video makes one wonder, isn’t there some way to make RPi boot faster?
Yes! Check out rpi-buildroot – https://github.com/gamaral/rpi-buildroot
You can boot to Linux running a game in about 3 seconds.
“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.
That’s some really clean wiring. I’ve seen production systems with messier wiring.
I had a tech tell me years ago. “My boss told me, ‘before you call it “done”, neatenize it!”
I had a tech tell me “Can’t see it with the lid closed…”
impressive and proper hack
Why did he have to write his own framebuffer-driver, when fbtft has been around for years and works fine?
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.
Well, I hate to say it, but if you had RTFA, then you’d know :)
now if that was an “approved” calculator for “X” exam …..
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?
appears to be pi zero w
This is fucking amazing
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.
The fact that humans are ACTUALLY in space still amazes me.
It is even more amazing that the Pi is able to run Quake 3… I spend all my money at the time to get a decent PC to run it…
Yeah, sometimes I think about how I couldn’t run Doom “back in the day” because my PC had only 2mb RAM and 4 was required. Good times.
My Sansa Clip ZIP with Rockbox runs Doom on a 1 inch display. Go figure… :)
https://www.rockbox.org/wiki/PluginDoom
But, can it run Doo….
Never mind…
But can it run crys…
Never mind
Install moonlight and bob’s your uncle
that is one expensive calculator
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.
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.
One day soon, the old trope: “I could have done it with a 555” will become: “I could have done it with a Raspi Zero”…
“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)
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?
1. Did not do any measurements, but several sources says 140 mA (here for example : http://raspi.tv/2017/how-much-power-does-pi-zero-w-use) so with the 1620 mAh stock battery, it should last some hours.
2. There is no power drain when the Pi is off, as its power supply is controlled by a mosfet
3. See here for the fork of the official firmware : https://github.com/zardam/epsilon/commits/rpi
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.
“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.
I’d call it “symbiosis”
Only downside is power… That RasPi will chomp through the battery in moments surely…?
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.
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?
Thanks.
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 : https://github.com/zardam/epsilon/tree/rpi 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”.
Out of topic question.
May I ask the hacker if he has the power to port Numworks to other STM32 dev boards like 32F429IDISCOVERY as stated in https://blog.st.com/numworks-stm32f4-open-source-graphing-calculator ?
Just asking…
It should not be too hard, as there is not too much code specific to the microcontroller.
Sorry to bother, I am a noob.
I use CubeMX then export to Atollic TrueStudio.
Is it doable?
It is doable. You don’t really need CubeMX or Atollic TrueStudio. The installation of the SDK is documented on NumWorks site. Then you will need to adapt this subtree of the sources for the board you want to use : https://github.com/numworks/epsilon/tree/master/ion/src/device
I think the main work will be in display.cpp for the LCD driver, and maybe in device.cpp for the low level initialization. Be prepared to read datasheets !
Will this still work for the newest hardware version? I can’t find the points on the n0110 for the raspberry pi GPIO output.