A Quickly-Hacked-Together Avalanche Pulse Generator

There are times when you make the effort to do a superlative job in the construction of an electronic project. You select the components carefully, design the perfect printed circuit board, and wait for all the pieces to come together as they come in the mail one by one. You then build it with tender care and attention, printing solder paste and placing components by hand with a fastidious attention to detail. There follows an anxious wait by the reflow oven as mysterious clouds of smoke waft towards the smoke detector, before you remove your batch of perfect boards and wait for them to cool.

Alternatively, there are other times when you want the device but you’re too impatient to wait, and anyway you’ve only got half of the components and a pile of junk. So you hack something a bit nasty together on the copper groundplane of a surplus prototype PCB in an evening with ‘scope and soldering iron. It’s not in any way pretty but it works, so you use it and get on with your life.

Our avalanche pulse generator schematic. The pulse generator itself is the single 2N3904 on the right.
Our avalanche pulse generator schematic. The pulse generator itself is the single 2N3904 on the right.

When you are a Hackaday writer with some oscilloscope bandwidths to measure, you need a picosecond avalanche pulse generator, and you need one fast. Fortunately they’re a very simple circuit with only one 2N3904 transistor, but the snag is they need a high voltage power supply well over 100 V. So the challenge isn’t making the pulse generator, but making its power supply.

For our pulse generator we lacked the handy Linear Technologies switcher used by the avalanche pulse generator project we were copying. It was time for a bit of back-to-basics flyback supply creation, robbing a surplus ATX PSU for its base drive transformer, high voltage diode and capacitor, and driving it through a CRT line output transistor fed by a two-transistor astable multivibrator. Astoundingly it worked, and with the output voltage adjusted to just over 150V the pulse generator started oscillating as it should.

We’ve looked at avalanche pulse generators once before here at Hackaday, and very recently we featured one used to measure the speed of light. We’ll be using this one tomorrow for a ‘scope comparison.

Glitching USB Firmware For Fun

[Micah Elizabeth Scott], aka [scanlime], has been playing around with USB drawing tablets, and got to the point that she wanted with the firmware — to reverse engineer, see what’s going on, and who knows what else. Wacom didn’t design the devices to be user-updateable, so there aren’t copies of the ROMs floating around the web, and the tablet’s microcontroller seems to be locked down to boot.

With the easy avenues turning up dead ends, that means building some custom hardware to get it done and making a very detailed video documenting the project (embedded below). If you’re interested in chip power glitching attacks, and if you don’t suffer from short attention span, watch it, it’s a phenomenal introduction.

Continue reading “Glitching USB Firmware For Fun”

Raspberry Pi, Send Me A Letter

The abundance of small networked boards running Linux — like the Raspberry Pi — is a boon for developers. It is easy enough to put a small cheap computer on the network. The fact that Linux has a lot of software is a double-edged sword. On the one hand, it is a good bet that anything you want to do has been done. On the other hand, some of the solutions are a bit large for a tiny embedded system.

Take, for example, e-mail. Historically, Linux hosts operate as mail transfer agents that can send and receive mail for all their users and possibly even relay mail to others. In today’s world, that’s usually overkill, but the capability is there. It is possible to install big mail transfer agents into a Raspberry Pi. The question is: should you?

What Do You Want?

The answer, of course, depends on what you want to do. If you have a dedicated board sending out text and maybe even files using an external mail server (like, say, Gmail), then the answer is no. You don’t need a piece of software listening for incoming connections, sorting through multiple users, and so on.

Luckily, there are some simple solutions if you know how to set up and configure them. The key is to avoid the big mail programs that do everything you don’t need.

Mail Front Ends

Let’s tackle sending mail first. If you try to grab the mailutils package, you’ll see it drags along a lot of stuff including mysql. Keep in mind, none of this will actually send mail. It just gives you some tools to get mail ready to send.

Luckily, the bsd-mailx package has a lot less overhead and will do the job. Look at the man page to see what options you have with mailx; you can do things like attach files, set a subject, and specify addresses.

It is a little difficult to set up for Gmail, though, thanks to Google’s security. You’ll need the certutil tool from the libnss3-tools package. You’ll need to create a certificate store, import Google’s certificate, and then set up a lot of options to mailx. I don’t suggest it. If you insist, though, you can find directions on the Web.

SSMTP

By default, programs like mailx and other Linux mail commands rely on a backend (often sendmail). Not only does that drag around too much overhead, it is also a full mail system, sending and receiving and relaying–overkill for our little Pi computers.

Luckily, SSMTP is available which only sends mail and is relatively lightweight. You need a configuration file to point it to your mail server. For Gmail, it would look like this:

#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?
rewriteDomain=yourdomain.com

# The full hostname
hostname=yourhostname
AuthUser=YourGmailUserID
AuthPass=YourGmailPassword
UseTLS=Yes
UseSTARTTLS=YES
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

You can use a mail agent like mailx or you can just use ssmtp directly:

ssmtp someone@somewhere.com

Enter a message on the standard input and end it with a Control+D (standard end of file for Linux).

Google Authentication

There’s only one catch. If you are using Gmail, you’ll find that Google wants you to use stronger authentication. If you are using two-factor (that is, Google Authenticator), this isn’t going to work at all. You’ll need to generate an app password. Even if you aren’t, you will probably need to relax Google’s fear of spammers on your account. You need to turn on the “Access for less secure apps” setting. If you don’t want to do this on your primary e-mail account, considering making an account that you only use for sending data from the Pi.

Sending Files

Depending on the mail software you use, there are a few ways you can attach a file. However, the mpack program makes it very easy:

mpack -a -s 'Data File' datafile.csv me@hackaday.com

The above command will send datafile.csv as an attachment with the subject “Data File.” Pretty simple.

Receiving Mail

What if you want to reverse the process and receive mail on the Pi? There is a program called fetchmail that can grab e-mails from an IMAP or POP3 server. It is possible to make it only read the first unread message and send it to a script or program of your choosing.

You have to build a configuration file (or use the fetchmailconf program to build it). For example, here’s a simple .fetchmailrc file:

poll imap.gmail.com
protocol IMAP
user "user@gmail.com" with password "yourpassword" mda "/home/pi/mailscript.sh"
folder 'INBOX'
fetchlimit 1
keep
ssl

You can leave the “keep” line out if you don’t mind fetchmail deleting the mail after processing. The file should be in your home directory (unless you specify with the -f option) and it needs to not be readable and writable by other users (e.g., chmod 600 .fetchmailrc). According to the fetchmail FAQ, there are some issues with Gmail, so you might want to consider some of the suggestions provided. However, for simple tasks like this, you should be able to work it all out.

In particular, the mailscript.sh file is where you can process the e-mail. You might, for example, look for certain keyword commands and take some action (perhaps replying using ssmtp).

Special Delivery

You might not think of the Raspberry Pi as an e-mail machine. However, the fact that it is a pretty vanilla Linux setup means you can use all sorts of interesting tools meant for bigger computers. You just have to know they exist.

$12 Quadcopter Frame From PVC Pipe

Flying ready-made quadcopters is fun. Eventually, though, most hackers get the urge to build their own. One of the most challenging parts is building a robust airframe. [Thomas Jarrett] has an interesting approach: he uses schedule 21 PVC pipe to build a sturdy airframe that is inexpensive and can house the craft’s electronics to boot. You can see a video of the sizeable aircraft, below.

The 1″ pipe is lightweight but sturdy and big enough to hold some circuitry. The rest is secured with Lexan. [Thomas] used off the shelf avionics, but it is obvious you could use the frame with your own choice of flight systems easily.

Perhaps the trickiest part is flattening the PVC for the motor mounts over a stove. The landing gear are also PVC, and formed in boiling water. Just be careful since hot PVC can give off nasty fumes (we aren’t experts on that, but it makes sense that it would be; you can watch a video about safety when heating PVC pipe). The total cost, including some prototyping parts, was under $300.

We’ve talked about building up drones in the past. If you don’t like PVC, you could always try old motherboards.

Continue reading “$12 Quadcopter Frame From PVC Pipe”

Hackaday In Portland This Week For Open Hardware Summit

We’ve been trying fit in a tour of the Pacific Northwest for a couple of years now. This week is a perfect excuse. Hackaday is proud to sponsor the Open Hardware Summit which will be held in Portland this Friday!

Hackaday believes in the free and open sharing of information and ideas. Open Hardware has far-reaching benefits that help to educate and inspire current and future generations of hardware developers. Open Hardware also works toward making difficult and important advancements in the state of the art available to people who have the skills and interest to incorporate them in their own work.

This is why we built Hackaday.io, the world’s largest repository of Open Hardware. It’s also why we support the Open Hardware Summit, which brings together the Open Hardware community to discuss what it means to be Open Source Hardware and how to encourage the incorporation of those ideals into new products and projects.

Tindie and Supplyframe are also sponsoring the OHS. Tindie is, of course, the best place to find bleeding edge hardware sold by the designers themselves. Tindie supports Open Hardware licenses and seeks to provide the best marketplace for products and their creators. Supplyframe creates cutting edge tools for engineers to build better. This year they launched the Supplyframe Design Lab which is packed with high-end rapid prototyping tools and staffed by a resident engineer; the lab unlocks the ability to turn great ideas into prototypes that can be followed all the way through to production and product. The goal is to unite all the things necessary to make great open hardware happen.

Bring a Hack at OSH Park

There will be a ton of Hackaday, Tindie, and Supplyframe staff at Open Hardware Summit, make sure you stop by our tables, say hello, and grab some swag. But of course we want to see the hardware hacks that you’ve been working on. There are a couple of different opportunities to track down [Brian Benchoff] and [Mike Szczys] who will be on the lookout for hacks to cover in our articles.

On Thursday night we’ll be at OSH Park Headquarters for their Bring A Hack party. There will also be a hardware hangout on Friday to close the day long Summit. We want to see what you’ve been building so don’t be shy!

How To Get Started With The ESP32

ESP32 is the hottest new wireless chip out there, offering both WiFi and Bluetooth Low Energy radios rolled up with a dual-core 32-bit processor and packed with peripherals of every kind. We got some review sample dev boards, Adafruit and Seeed Studio had them in stock for a while, and AI-Thinker — the company that makes the most popular ESP8266 modules — is starting up full-scale production on October 1st. This means that some of you have the new hotness in your hands right now, and the rest of you aren’t going to have to wait more than a few more weeks.

As we said in our first-look review of the new chip, many things are in a state of flux on the software side, but the basic process of writing, compiling, and flashing code to the chip is going to remain stable. It’s time to start up some tutorials!

Continue reading “How To Get Started With The ESP32”

An Atari 600XL Talks Composite Video

When we write about the 8-bit era of home computers there is a list of manufacturers whose names are frequently mentioned. Apple, Commodore, Texas Instruments, maybe Acorn and Sinclair if you are British, and of course Atari. But when we mention the last of those names it is invariably in reference to their iconic 2600 games console, it almost passes unnoticed that they also produced a line of 8-bit home computers based upon that success.

[ModPurist] was lucky enough to secure one of the Atari 8-bit computers through bartering with a local game store, an Atari 600XL from around 1983 or 1984, complete with its original box, manuals, cartridges, and a data cassette recorder. But on powering the system up and connecting to a TV a problem emerged. There was something there, but through a lot of noise and very blurry indeed. The solution after a bit of investigation turned out to be quite simple, to bypass the Astec video modulator and apply a composite video modification. Further investigation revealed that the original problem had in part been caused by the unit’s 5V power supply falling short of its voltage, so a further modification was to make a USB lead to allow it to be powered from a modern 5V charger.

This is a relatively simple piece of work, so you might be asking “Where’s the hack?”. The answer lies not in the mod itself, but in the detailed look [ModPurist] gives us at the inner workings of the 600XL, since it’s not a machine we see very often. Having the benefit of 30 years of hindsight and knowing the Atari’s competition quite well, we’d say that compared to some other machines of the era it’s a surprisingly well-designed computer both aesthetically and mechanically.

If your appetite for old Ataris has been whetted by this mod, can we draw your attention to this Atari 800 laptop? Or how about this 800 whose 6502 has been replaced with a 6809?