Posts with «atmega» label

Arduino Measures Remaining Battery Power With Zero Components, No I/O Pin

[Trent M. Wyatt]’s CPUVolt library provides a fast way to measure voltage using no external components, and no I/O pin. It only applies to certain microcontrollers, but he provides example Arduino code showing how handy this can be for battery-powered projects.

The usual way to measure VCC is simple, but has shortcomings.

The classical way to measure a system’s voltage is to connect one of your MCU’s ADC pins to a voltage divider made from a couple resistors. A simple calculation yields a reading of the system’s voltage, but this approach has two disadvantages: one is that it constantly consumes power, and the other is that it ties up a pin that you might want to use for something else.

There are ways to mitigate these issues, but it would be best to avoid them entirely. Microchip application note 2447 describes a method of doing exactly that, and that’s precisely what [Trent]’s Arduino library implements.

What happens in this method is one selects Vbg (a fixed internal voltage reference that is temperature-independent) as Vin, and selects Vcc as the ADC’s voltage reference. This is essentially backwards from how the ADC is normally used, but it requires no external hookup and is only a bit of calculation away from determining Vcc in millivolts. There is some non-linearity in the results, but for the purposes of measuring battery power in a system or deciding when to send a “low battery” signal, it’s an attractive solution.

Being an Arduino library, CPUVolt makes this idea very easy to use, but the concept and method is actually something we have seen before. If you’re interested in the low-level details, then check out our earlier coverage which goes into some detail on exactly what is going on, using an ATtiny84.

A Mega-Tiny Arduino

Integrated circuits, chipsets, memory modules, and all kinds of other transistor-based technology continues to get smaller, cheaper, and more energy efficient as time moves on. Not only are the components themselves smaller, but their supporting infrastructure is as well. Computers like the Raspberry Pi are about the size of a credit card and have computing power on the order of full-sized PCs from a few decades ago. The Arduino is no exception to this trend, either, and this new dev board called the Epi 32U4 might be the smallest ATmega platform we’ve seen so far.

As the name suggests, the board is based around the ATmega32U4 which is somewhat unique among Atmel chips in that it includes support for USB within the chip itself rather than relying on external translating circuitry. This makes it an excellent choice for any project which involves sending keyboard, mouse, or other peripheral information to a computer. This goes a few steps further with eliminating “bloat” compared to other boards, too. There’s no on-board voltage regulator, no LEDs except for a single one on pin 13, and even the pins and screw terminals are hemispherical rather than through-hole to save space.

One of the other features this board boasts over other small form factor boards is on-board USB-C, which is definitely a perk as more and more devices switch away from the various forms of older USB-type plugs. The project’s specifications are also available on this GitHub page for anyone that wants to produce their own. And, if you don’t have a 32U4 on hand and still want to build a keyboard project, it’s possible to get some other Arduinos to support these features but it’ll take a little more work.

Thanks to [Rasmus L] for the tip!

Hack a Day 03 Mar 00:00

Simultaneous Soldering Station

Soldering irons are a personal tool. Some folks need them on the cool side, and some like it hot. Getting it right takes some practice and experience, but when you find a tip and temp that works, you stick with it. [Riccardo Pittini] landed somewhere in the middle with his open-source soldering station, Soldering RT1. When you start it up, it asks what temperature you want, and it heats up. Easy-peasy. When you are ready to get fancy, you can plug in a second iron, run off a car battery, record preset temperatures, limit your duty-cycle, and open a serial connection.

The controller has an Arduino bootloader on a 32u4 processor, so it looks like a ProMicro to your computer. The system works with the RT series of Weller tips, which have a comprehensive lineup. [Riccardo] also recreated SMD tweezers, and you can find everything at his Tindie store.

Soldering has a way of bringing out opinions from novices to masters. If we could interview our younger selves, we’d have a few nuggets of wisdom for those know-it-alls. If ergonomics are your priority, check out TS100 3D-printed cases, which is an excellent iron, in our opinion.

The HackadayPrize2020 is Sponsored by:

A Macro Keyboard In A Micro Package

Remember back in the early-to-mid 2000s when pretty much every cheap USB keyboard you could find started including an abundance of media keys in its layout? Nowadays, especially if you have a customized or reduced-sized mechanical keyboard, those are nowhere to be seen. Whenever our modern selves need those extra keys, we have to turn to external peripherals, and [Gary’s] Knobo is one that looks like it could’ve come straight out of a fancy retail package.

The Knobo is a small macro keypad with 8 mechanical Cherry-style keys and a clickable rotary encoder knob as its main feature. Each key and knob gesture can be customized to any macro, and with five gestures possible with the knob, that gives you a total of thirteen inputs. On top of that, the build and presentation look so sleek and clean we’d swear this was a product straight off of Teenage Engineering’s money-printing machine.

The actions you can do with those inputs range from simple media controls with a volume knob all the way to shortcuts to make a Photoshop artist’s life easier. Right now you can only reprogram the Knobo’s Arduino-based firmware with an In-Circuit Serial Programmer to change what the inputs do, but [Gary] is currently working on configuration software so that users without any programming knowledge will be able to customize it too.

Knobs are just one of those things that everyone wants to use to control their computers, much like giant red buttons. Alternative input devices can range from accessibility-designed to just downright playful. Whatever the inspiration is for them, it’s always nice to see the creativity of these projects.

The HackadayPrize2019 is Sponsored by:

Play Tetris on a Transistor Tester, Because Why Not?

[Robson] had been using the same multimeter since he was 15. It wasn’t a typical multimeter, either. He had programmed it to also play the Google Chrome jumping dinosaur game, and also used it as a badge at various conferences. But with all that abuse, the ribbon cable broke and he set about on other projects. Like this transistor tester that was just asking to have Tetris programmed onto its tiny screen.

The transistor tester is a GM328A made for various transistor testing applications, but is also an LCR meter. [Robson]’s old meter didn’t even test for capacitance but he was able to get many years of use out of that one, so this device should serve him even better. Once it was delivered he set about adding more features, namely Tetris. It’s based on an ATmega chip, which quite easy to work with (it’s the same chip as you’ll find in the Arduino Uno but [Robson’s] gone the Makefile route instead of spinning up that IDE). Not only did he add more features, but he also found a mistake in the frequency counter circuitry that he fixed on his own through the course of the project.

If you’ve always thought that the lack of games on your multimeter was a total deal breaker, this project is worth a read. Even if you just have a random device lying around that happens to be based on an ATmega chip of some sort, this is a good primer of getting that device to do other things as well. This situation is a fairly common one to be in, too.

Building Badges The Hard Way

What’s a hacker to do to profess his love for his dearest beloved? [Nitesh Kadyan] built his lady-love this awesome LED pendant – the LED BLE Hearty Necklace Badge.

The hardware is pretty vanilla by today’s hacker standards. An ATMega328p  does most of the heavy lifting. An HM-11 BLE module provides connection to an Android mobile app. Two 74HC595 shift registers drive 16 columns of red LEDs and a ULN2803 sinks current from the 8 rows. The power section consists of a charger for the 320mAh LiPo and an LDO for the BLE module. All the parts are SMD with the passives mostly being 0603, including the 128 LEDs.

128 LEDs soldered wrong way around

[Nitesh] didn’t get a stencil made for his first batch of boards, so all the parts were painstakingly soldered manually and not in a reflow oven. And on his first board, he ended up soldering all of the LED’s the wrong way around. Kudos to him for his doggedness and patience.

The Arduino code on the ATmega is also quite straightforward. All characters are stored as eight bytes each in program memory and occupy 8×8 pixels on the matrix. The bytes to be displayed are stored in a buffer and the columns are left shifted fast enough for the marquee text effect. The Android app is built by modifying a demo BLE app provided by Google. The firmware, Android app, and the KiCAD design files are all hosted on his Github repository.

[Nitesh] is now building a larger batch of these badges to bring them to hillhacks – the annual hacker-con for making and hacking in the Himalayas. Scheduled for later this month, you’ll have to sign up on the mailing list for details and if you’d like to snag one of these badges. To make it more interesting, [Nitesh] has added two games to the code – Tetris and Snakes. Hopefully, this will spur others to create more games for the badge, such as Pong.

Business On The Outside, Electronics Workstation On The Inside

As an electrical engineering student, [Brandon Rice] had the full suite of electronics tools you’d expect. Cramming them all into a dorm room was doable — but cramped — a labour to square everything away from his desk’s top when he had to work on something else. To make it easier on himself, he built himself a portable electronics workstation inside the dimensions of a briefcase.

Built from scratch, the workstation includes a list of features that should have you salivating by the end. Instead of messing with a bunch of cables, on-board power is supplied by a dismantled 24V, 6A power brick, using a buck converter and ATmega to regulate and display the voltage, with power running directly to  12V and 5V lines of a breadboard in the middle of the workstation. A wealth of components are stored in two dozen 3d printed 1″ capsules setting them in loops pinned to the lid.

If all this was not already enough, there’s more!

Since he’ll be soldering a lot, there’s obviously an included soldering station, but were you expecting a helping hand and a carbon-filtered fume extractor? How about a folding overhead light to boot? Spools of wire are off to the rear to be tugged on when needed, and a drawer tucked into the side keeps circuit boards and jumper wires organized. There’s also a power strip along the other side — [Rice] notes that it was handier than he realized — for any other devices you might need. There’s even a built-in Arduino.

Hungry for more? How about a second serving, or even desert?

Micro-ATX Arduino is the Ultimate Breakout Board

If you’ve been hanging around microcontrollers and electronics for a while, you’re surely familiar with the concept of the breakout board. Instead of straining to connect wires and components to ever-shrinking ICs and MCUs, a breakout board makes it easier to interface with the device by essentially making it bigger. The Arduino itself, arguably, is a breakout board of sorts. It takes the ATmega chip, adds the hardware necessary to get it talking to a computer over USB, and brings all the GPIO pins out with easy to manage header pins.

But what if you wanted an even bigger breakout board for the ATmega? Something that really had some leg room. Well, say no more, as [Nick Poole] has you covered with his insane RedBoard Pro Micro-ATX. Combining an ATmega32u4 microcontroller with standard desktop PC hardware is just as ridiculous as you’d hope, but surprisingly does offer a couple tangible benefits.

RedBoard PCB layout

The RedBoard is a fully compliant micro-ATX board, and will fit in pretty much any PC case you may have laying around in the junk pile. Everything from the stand-off placement to the alignment of the expansion card slots have been designed so it can drop right into the case of your choice.

That’s right, expansion slots. It’s not using PCI, but it does have a variation of the standard Arduino “shield” concept using 28 pin edge connectors. There’s a rear I/O panel with a USB port and ISP header, and you can even add water cooling if you really want (the board supports standard LGA 1151 socket cooling accessories).

While blowing an Arduino up to ATX size isn’t exactly practical, the RedBoard is not without legitimate advantages. Specifically, the vast amount of free space on the PCB allowed [Nick] to add 2Mbits of storage. There was even some consideration to making removable banks of “RAM” with EEPROM chips, but you’ve got to draw the line somewhere. The RedBoard also supports standard ATX power supplies, which will give you plenty of juice for add-on hardware that may be populating the expansion slots.

With as cheap and plentiful as the miniITX and microATX cases are, it’s no surprise people seem intent on cramming hardware into them. We’ve covered a number of attempts to drag other pieces of hardware kicking and screaming into that ubiquitous beige-box form factor.


Filed under: Arduino Hacks, computer hacks, Microcontrollers

Balancing Robot Needs Innovative Controller and Motor

A self-balancing robot is a great way to get introduced to control theory and robotics in general. The ability for a robot to sense its position and its current set of circumstances and then to make a proportional response to accomplish its goal is key to all robotics. While hobby robots might use cheap servos or brushed motors, for any more advanced balancing robot you might want to reach for a brushless DC motor and a new fully open-source controller.

The main problem with brushless DC motors is that they don’t perform very well at low velocities. To combat this downside, there are a large number of specialized controllers on the market that can help mitigate their behavior. Until now, all of these controllers have been locked down and proprietary. SmoothControl is looking to create a fully open source design for these motors, and they look like they have a pretty good start. The controller is designed to run on the ubiquitous ATmega32U4 with an open source 3-phase driver board. They are currently using these boards with two specific motors but plan to also support more motors as the project grows.

We’ve seen projects before that detail why brushless motors are difficult to deal with, so an open source driver for brushless DC motors that does the work for us seems appealing. There are lots of applications for brushless DC motors outside of robots where a controller like this could be useful as well, such as driving an airplane’s propeller.


Filed under: robots hacks

Tiny Radio Tracks Your Balloons

The name of the game in rocketry or ballooning is weight. The amount of mass that can be removed from one of these high-altitude devices directly impacts how high and how far it can go. Even NASA, which estimates about $10,000 per pound for low-earth orbit, has huge incentives to make lightweight components. And, while the Santa Barbara Hackerspace won’t be getting quite that much altitude, their APRS-enabled balloon/rocket tracker certainly helps cut down on weight.

Tracksoar is a 2″ x .75″ x .5″ board which weighs in at 45 grams with a pair of AA batteries and boasts an ATmega 328P microcontroller with plenty of processing power for its array of on-board sensors. Not to mention everything else you would need like digital I/O, a GPS module, and, of course, the APRS radio which allows it to send data over amateur radio frequencies. The key to all of this is that the APRS module is integrated with the board itself, which saves weight over the conventional method of having a separate APRS module in addition to the microcontroller and sensors.

As far as we can see, this is one of the smallest APRS modules we’ve ever seen. It could certainly be useful for anyone trying to save weight in any high-altitude project. There are a few other APRS projects out there as well but remember: an amateur radio license will almost certainly be required to use any of these.


Filed under: radio hacks