Java Grinder Spits Out DsPIC And MSP430 Assembly Code

java-code-grinder

[Michael Kohn] sent in a link to the set of projects he’s been working on lately. The Java Grinder is a project that converts Java code for use on microcontrollers. This actually started back in 2009, when he mentioned that the project was worthless because there were already a ton of Java virtual machines out there. But if he had really thought that he’d never learn anything. We’re glad [Michael] picked this back up and made something out of it.

The image above shows the proof of concept. It’s a box bouncing around the Nokia 6100 screen. He wrote the animation in Java, and used his grinder to turn the code into dsPIC assembly, which was then compiled and flashed onto the microcontroller. That’s not all, he’s also coded a Mandelbrot set generator or the same hardware. As it stands he can also produce assembly code for use on MSP430 chips.

This kind of exploration is great for the brain. We see it as a natural extension of the learning you acquire from Nand2Tetris which walks through the essential text The Elements of Computing Systems. If you’re not familiar, that’s a trip from building your first logic gate, which you plunk together with others to build an ALU, then start coding all the way up to a virtual machine to run on your simulated hardware.

Video of the bouncing box and Mandelbrot set is below.

Continue reading “Java Grinder Spits Out DsPIC And MSP430 Assembly Code”

Controlling Motors Without A Microcontroller

serial

Think you need a microcontroller or a proper motor driver to control a motor? Not really. Because RS-232 serial ports are a hack in and of themselves, you can control two motors with only a serial port and a bridge driver.

Instead of using the data pins on the serial port, this circuit works on with the DTR and RTS control signals of an RS-232 interface. Unlike the data lines of a serial port, these control signals are high when they’re enabled and can also provide a small amount of current – enough to control a pair of pins on a TA7291P bridge driver.

The rest of the circuit consists of a few resistors and a pair of motors, and the software simply turns the DTR and RTS lines on and off. It’s enough for a small robot to waddle across a table, and given the correct driver is simple enough to mash together out of parts from a junk drawer.

The Two Component Random Number Generator

attiny10

[Karl] was in need of a hardware random number generator, but is needs had a few caveats: it needed to be cheap, and sufficiently random. Random number generation can get quite crazy with Geiger tubes, lava lamps, and radioactive decay, but a much smaller solution was found in an 8 pin AVR microcontroller.

The solution uses AVRentropy, a library that uses the watchdog timer’s jitter in AVR microcontrollers to provide cryptographically secure random numbers. Setting up the circuit was easy – an ATtiny45 microcontroller was connected to a cheap chinese USB to serial converter. Three wires, and the circuit is complete. The code was simple as well; it’s just a call to initialize the entropy and write the bits to the serial port.

There are a few drawbacks to this build. Because the entropy library must wait until enough entropy is gathered, it can only produce about two 32-bit numbers per second. That’s all [Karl] needed for his application, though, and with an enclosure made from a wine cork and marble, he has the prettiest and smallest random number generator around.

Wow. Such Mining Rig. So Amaze.

After hearing about cryptocurrencies like Bitcoin, Litecoin, and Dogecoin, [Eric] decided he would have a go at designing his own mining rig. The goals of the project were to have a self-contained and stackable mining rig that had all the parts easily accessible. The result is this awesome computer enclosure, where GPU mining and traditional woodworking collide.

For mining all those coins, [Eric] is using five R9 280x GPUs. That’s an impressive amount of processing power that ended up being too much for the 1500W power supply he initially planned to use. With a few tweaks, though, he’s managing about 2.8 Mh/s out of his rig, earning him enough dogecoins to take him to the moon.

In the video below, you can see [Eric] building his rig out of 4×8 framing lumber. This isn’t a slipshod enclosure; [Eric] built this thing correctly by running the boards through a jointer, doing proper box joints with this screw and gear-based jig, and other proper woodworking techniques we don’t usually see.

Continue reading “Wow. Such Mining Rig. So Amaze.”

7-Foot DIY Wind Turbine Proves Size Matters

7ft-wind-turbine

When [brokengun] decided to build a 7 ft diameter wind turbine, he had no idea how to even start, so he did as most of us would do and read some books on the topic. His design criteria was that it would be simple to construct and use as many recycled parts as possible. This wind turbine charges a 12 volt battery which can then be used to power a variety of gadgets.

Although made from recycled components, this isn’t a thrown together wind turbine. A lot of thought went into the design and build. [brokengun] discusses matching the blade size to that of the generator in order to maximize power and efficiency.  The design also incorporates a feature that will turn the turbine perpendicular to the wind if the wind-speed gets to high. Doing this prevents the turbine from being damaged by strong gusts.

For the main support/hub assembly, a Volvo 340 strut was used because they are widely available, cheap and known for being long-lasting. The tail boom is made from electrical conduit and it’s length is determined by the size of the main fan rotor. The tail vane is made from steel sheet metal and its surface area is also dependent on the fan rotor size to ensure that the turbine functions properly. The blades are made from wood but instead of making them himself, [brokengun] felt these were worth ponying up some cash. [brokengun] also scored a 30 ft high lattice tower an airport was getting rid of. This worked out great as it’s just the right height for a turbine of this size.

Continue reading “7-Foot DIY Wind Turbine Proves Size Matters”

Hack A Mag-Lite To Be Rechargeable

rechargeMaglite

Most tools sport rechargeable batteries these days, but there’s no need to toss that old flashlight: just replace the cells with rechargable ones!

[monjnoux] had a 3-cell D-sized MagLite lying around—though you could reproduce this hack with a 2 to 5 cell model—which he emptied of its regular batteries and replaced with some 11000mAh NiMHs from eBay. The original bulb was also tossed in favor of a 140-lumens LED.

After disassembling the flashlight, [monjnoux] set about installing the new parts. He replaced the original bulb with the LED, soldering it into place and securing it with hot glue. He then drilled a hole in the body of the flashlight for a DC socket. The charger he purchased is adaptive, detecting the number of cells and adjusting its voltage accordingly. It had the wrong connector, though, so [monjnoux] simply chopped off the end and soldered on a new one. For a hack that comes in at 40€, it’s definitely a cheaper alternative to the official rechargeable model: which costs 80€. And with a duration of 7 hours (though it’s unclear whether this number reflects continuous use), it likely outlasts the official model, as well.

Single Digit Numitron Clock

numitronClock

The above may look like a Nixie tube, but it’s a Numitron: the Nixie’s lower-voltage friend, and part of [pinomelean’s] single-digit Numitron clock. If you’re unfamiliar with Numitrons, we suggest you take a look at our post from a few years ago, which includes a helpful tutorial to catch you up to speed.

[pinomelean] built this little device to capture a steampunk-ish look on the cheap for a clock small enough to fit on a wrist. The build uses a PIC16F84A uC and a 4MHz crystal on a custom PCB. A small button on the side lets the wearer set the time. Similar to the Vibrating Timepiece from last month, the Numitron clock isn’t perfect, though it is more accurate: gaining only one minute every 3 days.

Check out the video after the break to see it being set and keeping track of the time. It may take a moment to understand how to read the clock, though. Each of the four LEDs indicates where the number in the Numitron tube belongs. The LEDs light in sequence from left to right, displaying the clock one digit at a time.

Continue reading “Single Digit Numitron Clock”