The online replacement vs repair decision helper

I wrote this tool to help decision-making when you have have to repair or replace something.
It uses a pair of jeans as an example, but it’s meant to be generic. Just replace its parameters and let it calculate.

(I’m assuming onChange="updateAll();" onKeyUp="updateAll();" /> as a currency and one onChange="updateAll();" onKeyUp="updateAll();" /> as a time unit.
I also assume a onChange="updateAll();" onKeyUp="updateAll();" />%/year growth rate of your assets.)

You are thinking about replacing a: onChange="updateAll();" onKeyUp="updateAll();" />
You have owned pair of jeans for: onChange="updateAll();" onKeyUp="updateAll();" /> year(s)
Replacing the pair of jeans would cost you: onChange="updateAll();" onKeyUp="updateAll();" /> $
Your pair of jeans is costing you in repairs: onChange="updateAll();" onKeyUp="updateAll();" /> $ / year
While the pair of jeans is undergoing repairs, you have a backup plan which costs you: onChange="updateAll();" onKeyUp="updateAll();" /> $ / year
Do you feel the pair of jeans at risk of a major, catastrophic, sudden failure?
onChange="updateAll();" onKeyUp="updateAll();" />Not really.
onChange="updateAll();" onKeyUp="updateAll();" />Possibly… but maybe an ice cream would cheer me up again. (+5 $ / year)
onChange="updateAll();" onKeyUp="updateAll();" />I think I’ll have to pay a couple of fine dinners if that happens. (+50 $ / year)
onChange="updateAll();" onKeyUp="updateAll();" />Well, that would cost me about onChange="updateAll();" onKeyUp="updateAll();" /> $.
Would a new pair of jeans have significant advantages, or technological advancements, over the old one?
onChange="updateAll();" onKeyUp="updateAll();" />Not really. I’m kind of emotionally bonded to the old one.
onChange="updateAll();" onKeyUp="updateAll();" />For starters, it wouldn’t look old. (+15% value over the old one.)
onChange="updateAll();" onKeyUp="updateAll();" />It has an improvement or two. (+30% value over the old one.)
onChange="updateAll();" onKeyUp="updateAll();" />The new one is way better! (+ onChange="updateAll();" onKeyUp="updateAll();" />% value over the old one.)
onClick="updateAll(); document.getElementById('response').style.display = '';" />

Bluetooth low-energy temperature beacon using the nRF24L01: cheap and compatible with existing smartphone apps!

The reason I did this project is because I have a slight overheating issue in a server room; I was wondering if there would be some way to check another room’s temperature from my desk. That’s how I came up with a “wireless thermometer” that can send readings to my Android phone, and my colleagues can use it too!

You might have heard about the nRF24L01: it is a cheap (0.80€) radio frequency module that, back in 2013, Dmitry Grinberg was able to use to “fake” a BTLE beacon. Real Bluetooth 4.0 modules are, nowadays, about 5€ each.

I wondered if I could use it to make a BTLE compatible temperature beacon. Turns out there are 3 major BTLE beacon protocols: iBeacon (by Apple), Eddystone (by Google), and AltBeacon (by Radius Networks). And well, none of them can be emulated with the nRF24L01, since it is only able to send a 16-byte payload (among other limitations), and all three of those protocols require bigger PDUs.

BUT!!! Although I didn’t find a name for it, Nordic Semiconductors Bluetooth ICs (namely the nRF8001 and nRF51822) have their own protocol they use to send telemetry data (which means: temperature, battery level and device ID); turns out this protocol is simple enough to be emulated by the nRF24L01 as well, although with some limitations. They also are so nice to distribute a suite of Android and iOS apps to work with them; the most relevant apps are nRF Master Control Panel (useful for debugging BTLE devices) and nRF Temp 2.0 (a temperature logger; I think it was meant to track device overheating, but hey). You can also download the source code from the app page!


The knock-activated noisy box

This project was intended as a prank; when I was thinking about the uses of a knock sensor I thought it would be funny to use it to make a doorbell. The thing you see is a small box that produces a funny chirping noise when you knock or shake it. It is intended to be attached to a door, or some other moving object. Not really an Arduino project since it uses only basic electronic components, but still it was quite entertaining to make and it’s a chance to have fun with analog electronics!

Read ahead to see instructions on how to make one!


InconTRAMi, a “route planner for meeting points” with Milan public transports.


InconTRAMi is a route planner for Milan’s public transports network ATM, differently from “usual” route planners it will try to find the best meeting points for two persons. By inputing your starting points, it will show the more easily reachable places for both persons. By moving the mouse over the map it will show which lines will permit you to reach that place.

Short usage policy: it is very experimental, I decline every responsibility coming from the use or misuse of it. It considers just ATM’s network; it doesn’t consider line hopping; the data it’s using may be not up to date. It uses data kindly made available by Comune di Milano. See the application page for the full policy (in italian).

The source code is available on GitHub.

p.s. “route planner for meeting points” is a horrible name, I’m taking suggestions.


The Arduino Pro Mini, the Baite BTE13-010, and the ultra low power consumption I achieved thanks to new programming tools

Please welcome my latest programming tool, the Arduino Power Cutter:


The BTE13-010 is a cheap Chinese clone of the Arduino Pro Mini, manufactured by Baite, which can be found from their Aliexpress store (among other places). The internets and the producer are unfortunately lacking much documentation about it.

Today I was trying to achieve a very low power consumption on the BTE13-010. You might already have had a look to popular pages when it comes to power saving on the Arduino, two popular ones being Power saving techniques for microprocessors on Gammon Forum and Arduino sleep mode basics on EngBlaze.

However, at first I struggled to achieve the promised great savings, possibly because I was using the BTE13-010 instead of rebuilding a circuit from scratch, like many of them suggest?

To make a long story short, after browsing everywhere, I came up with these two subroutines that will cut (no pun intended) through your power consumption:

The power_saving_init() should be the first thing to be called at setup(), it will initialize all your pins to LOW. power_saving_sleep() will put everything to sleep, and wake up every 8 seconds. With these two, with the regular board (no bootloader modifications, with the power regulator on, etc) when sleeping I was able to achieve 3.24mA of power consumption, which is already pretty good considering it was draining about 10.2mA when fully powered on in the first place.

(I also tried to change the board internal clock with avrdude options, but that didn’t seem to be possible on this board. I also tried to clock it down via clock_prescale_set(), but nothing was gained).

But it doesn’t end here! That’s were the Power Cutter comes in. Thanks to Talpa PCB retrace of the BTE13-010 I was able to elaborate an evil power saving plan:


[Credits for this picture to Talpa, with a few corrections/additions by me]

With a cutter, I was able to cut (pun intended) thru power consumption by cutting the two traces in the picture (in light blue in the upper right), thus phisically cutting out the power LED and the regulation circuit (I wasn’t using that regulator anyway, both USB power and my batteries bypass it). The LED and the regulator were draining about 0.47mA and 2.44mA respectively. Note to adventurers: always check with a multimeter before and after attempting to cut traces.

Without those two components, my power consumption went down to 4uA.

For best results, use batteries with low self-discharge rates, like coin cell! AA batteries can have discharge rates up to 30 mA, it’s a lot!

Let me know your thoughts in the comments!

Content Policy

All the content on these pages is my property, unless it is owned by someone else.

All media and data are published under the CC BY-NC 3.0 license unless otherwise stated.

All data published represents an effort for accuracy, but without any guarantees of correctness.

All code published in these blog pages is public domain, unless otherwise stated.

I deny any responsibility for any use or misuse of the informations contained here.

Do not eat. Only use under adult supervision.



Hello, welcome to my blog! This is where I collect my projects and other thoughts!

This website is divided in these sections:

  • Arduino: hardware projects and my journey logbook in electronics;
  • Programming: all of the software I wrote;
  • Italy: stuff that is either in Italian or only relevant if you live there;
  • Blog: works in progress, thoughts, ideas, unit tests, documentation, and everything else.

You can find most resources via the sidebar or the header menu. Have a look around, follow me on social media to receive updates!