Friday, September 4, 2020

BLDC motor driver v02 speed test

In my last video about the new BLDC driver I've written you can find here, I was talking about testing other motors.

Here you can find a sample speed test I've run over a Brushless motor Mistery D2025-5000.

To test the speed I've used a cheap Laser Tachometer DT-2234C+.
I've put tape around the motor and mark just one side of the motor tape with a black marker.

Results are pretty good, the motor spins at almost 11000rpm  running at 12V, with a current consumption of 0.9A.
Don't forget that this driver is not made for performance, this driver was built to be fairly simple and easly modify in order to be easly embedded in any project. If you are looking at performance, you should take a look at the SimonK firmware (

Testing the the same motor running at almost the same speed 11000rpm with SimonK firmware, results in a current consumption of 0.8A. However with SimonK i was able to run this motor at 30000rpm, 

This means that even if my driver is not build with performance in mind, it still runs pretty well.

I've tested the driver over other BLDC motor I've around here, all the motor spins without much problems. Startup sequence is good.

However, if you want to trick up performance, you can still make changes to the bldcsetupmotor.h file. In that file you can find various parameters used during the ramp startup time as long as the running time, like the ZC error setting and PWM timer counter settings, that will set the speed.

One last word about this BLDC driver that makes me happy, an article has been published on the italian Elettronica In ( magazine.

  • read risk disclaimer
  • excuse my bad english

Monday, August 3, 2020

Homemade PCB Cutting Machine

Here i present you my homemade PCB Cutting Machine.
It's a simple DIY project to build, there are just a few key points to watch out for.

This Cutting Machine it's based on a drill 12V DC motor. I've a broken electric drill, that's the donor of the motor. My motor is a ZG-RS550S-12V.

Then the inkjet printer sliding mechanism, once again something broken you can find without problem.
The sliding mechanism need to be prepared to make the motor fit on the ink sled.

I've buy the motor bracket and the motor adaptor, and of course the circular blade.
As for the circular blade mine it's a 50mm diamond plated steel disc used for Dremel. I've found that this kind of blade works better on PCB than saw blade with teeth like the ones for wood.

Then we need the piece of wood that will be base of our machine. We need to saw away the line where the cutting blade will slide in.

The key point now is to assembly all the pieces in such a way that is all perpendicular, that will affect the 90 degrees cutting that we want on our PCB. As you notice on my Cutting machine I've used big screw to mount the sliding mechanism, the hole that I've drill on the mechanism it's a bit larger then the screw, this way i can arrange the mechanism horizontally and vertically.

I've tried it with PCB up to 2mm without problem.

The PWM board it's a 6..90V, 15A.
A switch is attached in order to enable the PWM board, or to skip it and give the motor the full speed.

  • read risk disclaimer
  • excuse my bad english

Sunday, July 5, 2020

My Score Keeper: a simple app to track score of your games

My Score Keeper is a simple app that allows your track score of your games.
You can add multiple Games, each games may have many Match and each match many Rounds. You can add as much Players as you need. Points are recorded so you can take a look at the full historical points list.

A Dice tool and the Countedown Timer are also included. Just tap on the dice to generate a random number, or use the Countdown Timer to time your Round. The free Backup and Restore cloud agent allows your data to be upload on a temporary cloud space you can use to restore to another device just in case. My Score Keeper is Open Source, and it's built using React Native.
You can find the app on the Google Play Store. It's not published yet on the Apple Store, but it works with iOS too.
The app reley on the Realm database.
The first app screen is the Game one, all the Games are listed here. User can create a new math or select one listed. Long tapping on the game enters the edit/delete mode.
Inside the Game screen, user can add Match. When a Match is selected, Players needs to be added. Players of course can be removed or added whenever the user wants. When a new Round is added the user can select which are the Players that play that round.

During the Round points can be added or substracted to each Players.
A couple of tools can be enabled on the Round screen.
A Dice, that select a random number between an interval and a Countdown Timer.
Database can be backupped on a cloud service that is hosted free on Firebase. The web folder contains the code of the backup server.
Backup are rotated, this way the server space does not fill up.


  • read risk disclaimer
  • excuse my bad english

Monday, June 1, 2020

AppDressBook: Address Book app that synchronizes contacts using a custom API server

AppDressBook is an Address Book app that synchronizes contacts using a custom API server.
It is useful for companies or associations that's want to share contacts using a unique application.
They just have to build their own server that provides the contact list and eventually an authentication method, then the server url can be shared with people engaged and used in this app.

AppDressBook is Open Source and it's built using React Native.
It works both on Android and iOS. Although it's not yet published on Apple Store. You can find the Android app here at the Google Play Store.
The backend server itself it's pretty simple, in the Docs folder you can find all the json schemas for the routes you have to serve.
Ther's a simple test server written in node.js published with the application code, you can find it in the appdressbookapisample folder. I've implemented a C# server for my company. Building the API server is really a simple job. Contacts can be secured by username and password validation. Contacts can of course be synced according to the logged in user. You can even chose to deploy your contacts without authentication.

When the application is executed for the first time, the API server must be filled. Then that server is beeing asked for settings. If authentication is required user has to authenticate, if not contacts can be synced instantly.
Contacts list is cheked against the server each 10 minutes, using the hash of the list, this is to prevent bandwith consumption.
The application itself is simple, and customizable for your needs.


  • read risk disclaimer
  • excuse my bad english

Saturday, May 2, 2020

NRI G-13.mft parallel coin acceptor to Serial adapter

The NRI G-13.mft by Crane ( is a versatile and high secure coin validator.
It can be programmed using the propretary WinEMP software and PC interface, or event it has some DIP Switch that can be used to program the device.
Unluckily it does not come with a UART interface. But it features a "machine tester" I/O interface we can use to track the inserted coins.

On page 50/51 of the Technical Documentation for NRI G-13.mft G-13.mft parallel Standard, Casino and AMU Models (from Version /4) 05.05 Hns/WP/ds Edition 1.2 BA.G13MFTPAR4-GB, we find the specification for the interface we could use.

For the G-13.mft standard/Casino model – vending machine 10pin interface, we notice that
PIN 1 is the GND while PIN 2 the VCC, we can use those pin to power the device on.
Moreover, if we scope on the PIN3,4,7,8,9,10 we may notice that as the datasheet said, the signal is active low when a coin is inserted on the specific line.

Because those PIN also inhibit a signal line we can even instruct the coin acceptor to disable a specific coin line. This will not be the case we are investigating here, I'm only interested in getting the coin signal.
For this reason I just connect the output of the Coin signal line, with a pullup resistor to our microcontroller.
That's easy, now it's just a pin reading matter, with a bit of debounching.

The schematics itself is simple. The main microcontroller is an ATmega8. The UART to USB adapter chip is the Silab CP2102, attached to a microUsb port.

For this project I've also design the PCB, which i prototype using a chinese PCBA service. We are able to build the final board after 3 prototype, that's because I'm not a pro in the PCB design, but I've to start somewhere. Then the company I work request 100 boards production from the chinese company. It was the first time that I try the PCBA service of a company, think this was a good experience, to start with a small and simple board like this one.

Code, Schematics and PCB

  • read risk disclaimer
  • excuse my bad english

Friday, April 3, 2020

3 kind of Ruby Amp: Standard, Bassman and Hiwatt with distortion mod

I've introduced you the Ruby Amp here when I was talking about my bass amplifier 1W amp.
The Ruby Amp is a small guitar amplifier built around the LM386 IC.

This time i present you 3 kind of Ruby Amps from my collection.

Then the first one, it's a standard one, straight like the one of the site with a gain control.

Second one is a Bassman mod one, with a distortion switch that pump up the LM386 gain to it's limit. It was built on a PC speaker case.

Last one, the third, like the previous, was built on a PC speaker case, but this time it's an Hiwatt mod, again it cames with distortion switch.

All those you see above, I've built using a PCB board I've design.

Then some bonus pictures of the first one I've built. It's a standard one without gain pot. It was built on a prototyping board, it was 2010.

Most of them runs on a 9v supply voltage, some on 12v.
A personal note on the supply, if you are using a high to low voltage transformer and a rectifier to get your supply voltage, use big caps or even better a voltage regulator like the LM7809 if you want to avoid noise from your power line.

As you can see, I've always use salvaged parts, even that, they sound pretty well to my ears.
I've built others, always using recovered case and parts.
Although I've never use those amps in a record they sounds good, are simple to build and portable, so if you need one small amp at your friend house or during a BBQ, those are the amps.

  • read risk disclaimer
  • excuse my bad english

Monday, March 2, 2020

D03: the "LESA Boogie" guitar amplifier

I've built this guitar amplifier from a 50's turntable with speakers.
This turntable was built by LESA (Laboratori Elettrotecnici Società Anonima), which sounds like Electrotechnical Laboratories of an Anonymous Company.

It happens that this turntable was left in an house with water leaks, the water was running just over the turntable, luckly speakers was intacts.
Because i like the turntable front and the speakers case, i decide to build a small guitar amplifier our of that piece.

As a side note to this project, the main PCB of this turntable contains some germanium transistor that I've use to build this Germanium Fuzz guitar pedal:
Stage one was the building of the case.

I've glued and screwed two speakers, a hole between the two speakers was drilled for the cables.
Then on top of the speaker I drill some holes for potentiometers and panel devices.
On the back panel I put the power plug with fuse and power button.
Once I was sure that the case was correctly built it was time for the interesting stage, the electronic.
I've a +-13V 80VA transformer that I salvage from an old HiFi system, so I can build something with dual rail supply.

The design reference I use are the schematics of the following amplifiers:
  • Marshall MG10
  • Fender Frontmain 10g
  • Vox Pathfinder 10
The power stage is pretty simple, just a bridge rectifier, capacitors, two resistors used for voltage reduction, and two zener diode for the +V and -V of the opamps.
The preamplifier uses a TL072 opamp, the input stage rectify the guitar high impedance and gain the signal of 8.9.

The second stage is the overdrive channel, which is also TL072 based. This channel is enabled by the bypass selector, that is simply a DPDT switch.
The gain of the overdriver in my construction is fixed, cause I do not want to drill an hole for a gain potentiometer, instead I want to use one button of the original amplifier.
So in my design I can switch between a crunch/soft gain overdrive to an overdrive/high gain.
It would be easy to mod this amp adding the gain potentiometer for a more accurate setting.
You could simply add a 1M pot instead of the gain fixed resistors.

The tone stack it's based on the Fender 6G5 circuit with some little mods.
The signal then goes to a PT2399 based reverb. It's rectified by the TL072 that fits the signal for the amplifier board.

The reverb board has two trimmers, one for the feedback signal, the other for the delay time. Adjusting the trim the reverb sounds change. The two trimmer are in parallel with two resistors, a switch on the amplifier select which resistor is enabled, this way I can select between two different reverb styles.

The amplifier is based on the TDA2030A IC. It's basically the datasheet sample with some fleavours and signal filtering additions.

Speakers are obviously old. They comes with a woofer and a tweeter, joined togeter using a single capacitor filter. The original speaker impedance was 3.2ohm. In order to connect the amplifier board to the speaker I've wire the two speaker using a single filtering capacitor.

The amplifier sounds and looks pretty good to my hear and eyes.
Furthermore it's a LESA and I have an apartment in Lesa (, a town on the Major Lake. Guess where this amplifier is built for?

  • read risk disclaimer
  • excuse my bad english

Monday, February 3, 2020

AVR Brushless motor driver PWM scheme samples

A three-phase brushless motor it is usually drive by six-state commutation step sequence.
The commutation sequence drive the motor coils in order to make it spin.
The picture above represent a standard commutation scheme, each line is the motor coil status.

Given a 360 degree commution space, each commuation happens takes a 60 degree space.
A coil it is usually driven by mosfet bridge.
The coil can be drive on or off, but we can also drive it in PWM.
The PWM scheme is the way the power gates bridge is controlled in order to drive each motor coil.

In the AVR bldc driver here:

I've implemented 4 PWM scheme.

H PWM L ON: PWM is performed on the ON channel

H ON L PWW: PWM is performed on the OFF channel

H PWM ON: PWM is performed on UWV channels every 60degrees, starting from U ON-ON

H ON PWM: PWM is performed on UWV channels every 60degrees, starting from V OFF-NULL

See above the signal sample recordered using a CD-ROM motor.

H PWM L ON sample

H ON L PWW sample

H PWM ON sample

H ON PWM sample

  • read risk disclaimer
  • excuse my bad english

Saturday, January 4, 2020

An ATmega brushless sensored motor driver v02

Brushless electric motor (BLDC motors) are synchronous motors that are powered by a DC electric source via an integrated inverter/switching power supply, which produces an AC electric signal to drive the motor. Hall sensored motors uses hall effect sensors or a rotary encoder to directly measure the rotor's position.
For an introduction to BLDC motors, you can take look at my sensored motor driver post, here:

This library implements a brushless sensorled motor dirver for AVR ATmega.

Take this library:

This is exacly the same library as the previous linked, so, for further information on this library please look at the link above.
There are just a few difference due to the hall sensor presence. The motor position this time it is discovered using hall sensors insted of using the the ZC crossing detection.
When we get the hall sensor status, we can select the next hall sensor status we expect after the step emission. The hall sensor status expected to current status is defined in the bldc.h file.
The picture below reports the commutation step agains the next status expected.

Once again, this is a simple implementation of a sensored driver, there are improvements that can be made to make this driver works even better. The purpose of this implementation is to offer a simple yet hackable way to run a bldc sensored motor.

  • find the source code for this project on the sensorless post linked above

  • read risk disclaimer
  • excuse my bad english