A Pocket-Sized Terminal For Mobile Python Hacking

Inspired by the good old days when your computer would boot directly into BASIC, [Le Roux Bodenstein] has created a handheld device he calls “DumbDumb” that can drop you into a MicroPython environment at a moment’s notice. If that doesn’t interest you, think of it this way: it’s a (relatively) VT100 compatible serial terminal with a physical keyboard that can fit in your pocket.

Being essentially just a dumb terminal (hence the name), there’s actually not a lot of hardware on the board. Beyond the 320×240 NewHaven 2.4 inch LCD, there’s just an STM32G071R8 microcontroller and a handful of passives. Plus the 57 tactile buttons that make up the keyboard, of course.

The MicroPython part comes in thanks to the spot on the back of the board that accepts an Adafruit Feather Wing. In this case, it’s the HUZZAH32 with an ESP32 on board, but it could work with other variants as well. With the wide array of Feather boards available, this terminal could actually be used for an array of applications.

So even if fiddling around with MicroPython isn’t your idea of a good time, there’s almost certainly some interesting software you could come up with for a tiny network-attached terminal like this. For example, it might be just what you need to start working on that LoRa pager system.

FPGA 6800 Uses Python Toolbox

Usually, when you think of designing — or recreating — a CPU on an FPGA, you assume you’ll have to use Verilog or VHDL. There are other options, as well, but those are the biggest two players in FPGA configuration. [Robert Baruch] has a multipart series where he uses nMigen — a Python toolbox — to recreate a 6800 CPU like the one used in many vintage video games and pinball machines.

Unlike some tools that try to convert software written in some language to an FPGA configuration, nMigen uses Python as a scripting language to create code in FHDL. This is similar in concept to VHDL or Verilog, but gives up the event-driven paradigm, opting instead to allow designers to explicitly call out synchronous and combinatorial logic.

Continue reading “FPGA 6800 Uses Python Toolbox”

Arduino Polygraph Shows How It’s Done

Sometimes, a project comes along that makes a good reference design for anyone doing similar work. In this particular case, it’s a DIY USB polygraph-like machine by [Juangg] using an Arduino and sensors on the hardware side, and a Python front end for data visualization. It’s even complete with 3D printed enclosure and sensor elements.

[Juangg] designed it to use three sensors: a pulse sensor, a breath sensor, and one to measure Galvanic Skin Response (GSR). The pulse sensor uses a piezo element pressed against a fingertip to detect changes in pressure resulting from blood flow. It can be picky about placement, but finding sweet spot can yield remarkably good readings. The breath sensor works on a similar principle but uses a 3D printed fixture to hold the sensor between a strap and the subject’s chest, so that breathing in and out can be detected. The GSR sensor is a voltage divider used to measure small changes in skin conductivity. How well does it all work? That depends on what one is looking to get out of it, but the documentation and design files are available from the project page and the GitHub repository if anyone wants a reference for similar work.

The polygraph may have a mixed reputation, but it makes a good project that demonstrates just how messy biometrics can be from an engineering perspective. And in case you missed it, here’s a reminder that Wonder Woman and the polygraph have much more in common than you might realize.

Code The Classics Is Coming

We feel sorry for youth of today. If you spend a few hours playing a modern video game and decide you want to write your own, there’s a big job ahead of you. Games now are as much performances as programs, with cinematic 3D renderings, polyphonic sound and music tracks, and detailed storylines. That wasn’t true 40 years ago, when you could play Pong and then think about writing your own version. The Raspberry Pi people must agree as they are taking preorders for a book called “Code the Classics.” In it, they interview designers of several classic arcade games and then show Python versions of the games you can run — and hack — yourself. You can see their video about the title, below.

The code is from Raspberry Pi founder [Eben Upton] and as you might expect the games aren’t necessarily faithful reproductions but inspired by the old arcade standards.

Continue reading “Code The Classics Is Coming”

The Heat Of The Moments – Location Visualization In Python

Have you ever taken a look at all the information that Google has collected about you over all these years? That is, of course, assuming you have a Google account, but that’s quite a given if you own an Android device and have privacy concerns overruled by convenience. And considering that GPS is a pretty standard smartphone feature nowadays, you shouldn’t be surprised that your entire location history is very likely part of the collected data as well. So unless you opted out from an everchanging settings labyrinth in the past, it’s too late now, that data exists — period. Well, we might as well use it for our own benefit then and visualize what we’ve got there.

Location data naturally screams for maps as visualization method, and [luka1199] thought what would be better than an interactive Geo Heatmap written in Python, showing all the hotspots of your life. Built around the Folium library, the script reads the JSON dump of your location history that you can request from Google’s Takeout service, and overlays the resulting heatmap on the OpenStreetMap world map, ready for you to explore in your browser. Being Python, that’s pretty much all there is, which makes [Luka]’s script also a good starting point to play around with Folium and map visualization yourself.

While simply just looking at the map and remembering the places your life has taken you to can be fun on its own, you might also realize some time optimization potential in alternative route plannings, or use it to turn your last road trip route into an art piece. Just, whatever you do, be careful that you don’t accidentally leak the location of some secret military facilities.

[via r/dataisbeautiful]

Circuit Simulation In Python

Using SPICE to simulate an electrical circuit is a common enough practice in engineering that “SPICEing a circuit” is a perfectly valid phrase in the lexicon. SPICE as a software tool has been around since the 70s, and its open source nature means there are more SPICE tools around now to count. It also means it is straightforward enough to use with other software as well, like integrating LTspice with Python for some interesting signal processing circuit simulation.

[Michael]’s latest project involves simulating filters in LTspice (a SPICE derivative) and then using Python/NumPy to both provide the input signal for the filter and process the output data from it. Basically, it allows you to “plug in” a graphical analog circuit of any design into a Python script and manipulate it easily, in any way needed. SPICE programs aren’t without their clumsiness, and being able to write your own tools for manipulating circuits is a powerful tool.

This project is definitely worth a look if you have any interest in signal processing (digital or analog) or even if you have never heard of SPICE before and want an easier way of simulating a circuit before prototyping one on a breadboard.

A Python Serial Terminal To Get You Out Of A Jam

When fiddling around with old computers, you can occasionally find yourself in a sticky situation. What may be a simple task with today’s hardware and software can be nearly impossible given the limited resources available to machines with 20 or 30 years on the clock. That’s where [bison] recently found himself when he needed to configure a device over serial, but didn’t have any way of installing the appropriate terminal emulator on his Fujitsu Lifebook C34S.

His solution, since he had Python 2.6 installed on the Debian 6 machine, was to write his own minimal serial terminal emulator. He intended for the code to be as terse as possible so it could be quickly typed in, should anyone else ever find themselves in need of talking to a serial device on Linux but can’t get screen or minicom installed.

The code is very simple, and even if you never find yourself needing to fire up an impromptu terminal, it offers an interesting example of how straightforward serial communications really are. The code opens up the /dev/ttyS0 device for reading, and after appending the appropriate return character, pushes the user’s keyboard input into it. Keep looping around, and you’ve got yourself an interactive terminal.

With this program written, [bison] was able to connect the 266 MHz C34S to his Retro WiFi SI, a modem adapter that bridges the gap between a vintage computer and modern wireless network. Gadgets like these allow you to browse BBSes as the creator intended, and can be fashioned with nothing more exotic than an ESP8266 running some open source code.