These days, it’s easy enough to play games on the go. If you have a smart phone, you are pretty much set. That doesn’t mean you can’t still have fun designing and building your own portable gaming system, though.
[randrews] did just that. He started out by purchasing a small memory LCD display from Adafruit. The screen he chose is low power as far as screens go, so it would be a good fit for this project. After testing the screen with a quick demo program, it was time to start designing the circuit board.
[randrews] used Eagle to design the circuit. He hand routed all of the traces to avoid any weird issues that the auto router can sometimes cause. He made an efficient use of the space on the board by mounting the screen over top of the ATMega chip and the other supporting components. The screen is designed to plug in and out of the socket, this way it can be removed to get to the chip. [randrews] needs to be able to reach the chip in order to reprogram it for different games.
Once the board design was finished, [randrews] used his Shapeoko CNC mill to cut it out of a copper clad board. He warns that you need to be careful doing this, since breathing fiberglass dust is detrimental to living a long and healthy life. Once the board was milled out, [randrews] used a small Dremel drill press to drill all of the holes.
The final piece of the puzzle was to figure out the power situation. [randrews] designed a second smaller PCB for this. The power board holds two 3V coin cell batteries. The Arduino expects 5V, so [randrews] had to use a voltage regulator. This power board also contains the power switch for the whole system.
The power board was milled and populated. Then it was time to do some measurements. [randrews] measured the current draw and calculates that he should be able to get around 15 hours of play time using the two 3V coin cell batteries. Not bad considering the size.
There are dozens, if not hundreds of examples around the Intertubes of an Arduino generating a VGA video output. The Arduino isn’t the fastest chip by far, and so far, all of these VGA generation techniques have peaked out at lower resolutions if you want to control individual pixels.[PK] has an interesting technique to generate 640×480 VGA at 60 frames per second without overclocking. It’s hacky, it’s ugly, but surprisingly, it actually works.
The VGA standard of 640×480 @ 60 fps requires pixels to be clocked out at 25.175 MHz, and the ATMega chips found in Arduinos top out at 20 MHz. [PK] wanted to generate VGA signals without overclocking, He did this by doubling the clock frequency with digital logic. The ATMega generates a clock, an inverter delays that clock so it is 90 degrees out of phase, and the two clocks are XORed, doubling clock output of the micro. It produces a very ugly square wave at 32 MHz – an error of 27% compared to the VGA spec. Somehow it still works.
With a hilariously out of spec clock, the rest of the project was pulled together from [Nick Gammon]’s VGA library, a 16×16 font set, and a project from [lft]. Video below.
Continue reading “640×480 VGA On An Arduino”
If you’ve written a great library to generate random numbers with a microcontroller, what’s the first thing you would do? Build an electronic pair of dice, of course.
[Walter] created the entropy library for AVRs for a reliable source of true random numbers. It works by using the watchdog timer’s natural jitter; not fast by any means but most sources of entropy aren’t that fast anyway. By sampling a whole lot of AVR chips and doing a few statistical tests, it turns out this library is actually a pretty good source of randomness, at least as good as a pair of dice.
The circuit itself uses two 8×8 LED matrices from Adafruit, an Arduino, and a pair of buttons. The supported modes are 2d6, 2d4, 2d8, 2d10, 1d12, 1d20, a deck of cards, a single hex number, a single 8-bit binary number, or an eight character alphanumeric password. It’s more than enough for D&D or when you really need an unguessable password. Video demo below.
Continue reading “The Most Random Electronic Dice Yet”
[Edward] and [Tom] managed to build an actual phased array speaker system capable of steering sound around a room. Powered by an Atmega 644, this impressive final project uses 12 independently controllable speakers that each have a variable delay. By adjusting the delay at precise intervals, the angle of maximum intensity of the output wave can be shifted, there by “steering” the sound.
Phased arrays are usually associated with EM applications, such as radar. But the same principles can be applied to sound waveforms. The math is a little scary, but we’ll walk you through only what you need to know in case you’re ever in need to steer sound with a
speaker and a servo phased array sound system.
Continue reading “Steering Sound with Phased Array”
We don’t know if this will come as a surprise to the regular Hackaday reader, but a whole bunch of Atmel microcontrollers have a very cool feature hidden away in their datasheets. Most of them – everything from the ATMega 168, 328, 32u4, to the ATtiny85 and 84 have a temperature sensor right on the chip. [Connor] did a little bit of research on this sensor and came up with a little bit of code that spits out the core temperature of these Atmel chips over the serial port.
The temperature sensor on these Atmel chips is accessed by writing a code – ‘100111’ for the Mega32u4 and ‘100010’ for the tiny84, for example – into the ADMUX register on the chip. According to the datasheet, the returned temperature is accurate to +- 10°C, but that can be easily calibrated by holding an ice cube (in a plastic bag, of course) up to the chip.
With a little more code, [Connor] is able to output the temperature of the microcontroller core over a serial port. In testing, his chip started out at 20°C and reached equilibrium at 24°C after about a minute. Pretty neat, and could be used as a temperature sensor for a project in a pinch.
Your desktop has two, four, or even eight cores, but when’s the last time you’ve seen a multicore homebrew computer? [Jack] did just that, constructing the DUO Mega, a 16 core computer out of a handful of ATMega microcontrollers.
From [Jack]’s description, there are 15 ‘worker’ cores, each with their own 16MHz crystal and connection to an 8-bit data bus. When the machine is turned on, the single ‘manager’ core – also an ATMega328 – polls all the workers and loads a program written in a custom bytecode onto each core. The cores themselves have access to a shared pool of RAM (32k), a bit of Flash, a VGA out port, and an Ethernet controller attached to the the master core.
Since [Jack]’s DUO Mega computer has multiple cores, it excels at multitasking. In the video below, you can see the computer moving between a calculator app, a weird Tetris-like game, and a notepad app. The 16 cores in the DUO Mega also makes difficult calculations a lot faster; he can generate Mandelbrot patterns faster than any 8-bit microcontroller can alone, and also generates prime numbers at a good click.
Continue reading “16 core computer made of ATMegas”
The advent of the Arduino brought the world of microcontrollers to hobbyists, students, and artist the world over. Right now we’re in the midst of a new expansion in hobbyist electronics with the Raspberry Pi, but we can’t expect everyone to stay in the comfortable, complex, and power-hungry world of Linux forever, can we? Eventually all those tinkerers will want to program a microcontroller, and if they already have a Raspberry Pi, why not use that?
[Kevin] wanted to turn his Raspi into an AVR development workstation, without using any external programmers. He decided to use the Raspi’s SPI port to talk to an AVR microcontroller and was able to make the electrical connections with just a few bits of wire an a handful of resistors.
For the software, [Kevin] added support for SPI to avrdude, available on his git. Theoretically, this should work with any AVR microcontroller with the most popular ATMegas and ATtinys we’ve come to love. It doesn’t support the very weird chips that use TPI programming, but it’s still extremely useful.