Tag Archives: ATtiny13A

BLTouch is an auto leveling sensor for 3D printers

Your 3D printer doesn’t have an automated bed leveling system? Not to worry! 

As any Maker will tell you, having to manually level the bed of your 3D printer can be a rather tedious task. Between ensuring that it’s level and that the print nozzle is the right distance away, this is a headache that most of us would like to avoid. Unfortunately, despite all the technology being crammed inside these printers, many of today’s device still lack an automatic bed leveling system — a problem that Charles Lee is hoping to change.


BLTouch is an auto leveling sensor that can be easily installed on pretty much any open source FFF 3D printer, and will work with a range of materials from glass to metal. The unit consists of an ATtiny13A, a solenoid and a push pin, and uses the same servo signal as its previously attached servo motor.

“You can connect BLTouch with an existing servo motor connector (three-pin) and Zmin connector (two-pin). If your 3D printer does not have the auto leveling function, then you should have it updated, and add the two connectors which are enclosed [with our product]. In this process, soldering might be needed,” Lee explains.


The BLTouch is noiseless when in standby mode as well. Instead of emitting those annoying “servo motor” sounds like other leveling systems, this sensor makes just a small clicking noise as the push pin moves. The device also features an power saving system. While in idle mode, the power flow of the solenoid remains below 15mA, and around 800mA while in use.

Additionally, the push pin is capable of self-testing and will blink an LED light should a problem be found. According to Lee, the machine could be disassembled using nothing more than an Allen wrench, and any issue can likely be solved by simply wiping the pin.


Interested? Head over to BLTouch’s Indiegogo page, where its team is currently seeking $20,000. Pending all goes to plan, delivery is slated for November 2015.

This HAT is bringing Power over Ethernet to your Raspberry Pi

You can now power your Raspberry Pi and provide an Ethernet connection in any location with just a single cable.

Power over Ethernet (PoE) is nothing new. In fact, this method of transmitting data and electricity has been used for quite some time by devices like computers, IP telephones, web severs and throughout the music industry. Now, one startup is looking to bring the standard to the Rasbperry Pi. The idea was first conceived as a DIY kit for the Model B, but eventually transcended into a fully-assembled, plug-and-play system that gives Makers an innovative way to reduce wire clutter and manage power.


The brainchild of Pi Supply, who has launched other successful crowdfunding campaigns like the PaPiRus and the Pi Supply Switch, the Pi PoE Switch HAT is an snap-on accessory that provides Makers with an Ethernet connection and the ability to easily power their Pi from any location with just a single cable, making it ideal for use in remote areas.

“The Pi Supply Switch was our very first Kickstarter project which we launched way back in February 2013 and has been extremely popular with our customers,” the London-based startup writes. “Since then we have had a number of requests to make all sorts of power management add ons for the Raspberry Pi, but the most intriguing of these was a Power over Ethernet switch.”


Based on an ATtiny13A MCU, Pi PoE includes a configurable on/off switch for intelligent power management, open GPIO pins for other expansion boards, a fully-isolated switched-mode power supply (1500V isolation input to output), as well as overload, short circuit and temperature protection. In addition, the 802.3af-compliant HAT contains physical layer power negotiation circuitry, presenting itself as a Class 0 device.

The Switch HAT offers power to the Pi via its GPIO pins and sends an Ethernet connection using a patch cable. This opens the door to endless possibilities for projects, ranging from garden monitoring and surveillance systems to web servers and media centers. Aside from being solder-free, another nice Maker-friendly feature of the Pi PoE is that it doesn’t require any software. Meaning, it’s ready for action right out of the box. Moving ahead, the Pi Supply team even has plans to introduce some scripts and guides to help implement the configurable on-board button and harness the unused power of the versatile tinyAVR MCU.


Looking for a great alternative to USB for your next Raspberry Pi gadget? Head over to its Kickstarter campaign page, where Pi Supply is currently seeking $15,476. Delivery is expected to begin in August 2015.

Counting prime numbers with the ATtiny13A

Dave M. has created a prime number machine – TinyPrime – powered by Atmel’s ATtiny13A microcontroller (MCU).

“The ATtiny13A is a neat chip: AVR with 1K of flash, 64 bytes of RAM and 64 bytes of EEPROM,” Dave wrote in a recent blog post.

“I programmed it using a Teensy-2.0-based waldo running Ward Cunningham’s TXTZYME. Every time you push the button, the AVR retrieves the currently-displayed number (which is stored in EEPROM), and then increments it, clicks the counter and tests for primality.”

If the number isn’t prime, says Dave, the machine increments and clicks again.

“When a prime number is reached, it stops and waits for another button press,” he added.

Interested in learning more? You can check out TinyPrime’s official project page here.

How low is low power?

A buddy called up asking me the minimum power consumption of Atmel chips. He has an application that has to be battery powered and it just can’t suck much more than the self-discharge out of the battery. I had another application years ago with the similar problem. I was trying to steal power from a phone line to run a little micro. If you look at the very strict laws, you are only allowed about a microampere out of the -48V POTS (plain-old-telephone-system) line.

So the trick is to steal the microampere continually, and let it charge up a big capacitor, so your micro has more than a few uA to run on for a little while. My buddy had a pretty high battery voltage. So with a switching power supply he can take in 1 uA at 24V and make 10uA at 2V that will power the MCU. Better yet, you can put the system to sleep or all the way into power-down, and only wake it now and then. With a 1% duty cycle, your 10uA continuous current can instead become 1mA when you are in wake mode and 0.1uA the other 99% of the time.

So back to the task of figuring just how low a low-power AVR chip is. Since this is a hardware issue, and you only have to worry about hardware once in your design, the salient info is towards the end of the datasheet. And you do have to dig up the “full” datasheet, not the summary version. CMOS microprocessors use power in direct relation to the clock frequency they are operated at, as well as the power supply voltage you run them on.

So I started with the smallest physical part we make, the ATtiny13A . It is fully static. On page 126 they actually have a 2-dimentional power consumption graph, but the first one shows 100k-1MHz active clock. Scroll down to page 127, and Figure 19-6 shows 32kHz clock figures. The part sips about 7uA at 2V Vcc. Then scroll down for idle power—Figure 19-12, it’s about 1.2uA. Then more scrolling and you get a power-down consumption of 0.1uA with no watchdog, and 3uA with the watchdog.


My suggestion is to let the switching power system run the show. Have it gently steal power and when it has charged up a big ol’ ceramic cap, then have the power system take the MCU out of power-down, (not idle) do the measurement, and either kill itself or handle the alarm. This part does have a 10-bit ADC so you have to look at the time it takes to get a good conversion out of it.

This can get really tricky. My buddy Nick Gray noted that sometimes you are better using a faster ADC since you can get a good conversion out of it in less time, so the duty cycle of “on” goes down, and you end up using less power despite having a higher-current ADC. Same deal here— you need to think in Coulombs—what is the fewest number of electrons needed to wake up, do a test, and go back to sleep.

In any event, it is obvious that you can set up an AVR system to draw less than the self-discharge rate of your battery system. Note that if you need to do 500MHz processing, well all bets are off. The speed-power tradeoff in semiconductor devices is pretty absolute, so don’t think you can do HD video on a uA.