Skip to main content

Post in evidenza

Router table with power lift, built around Ikea BEKVÄM and parts from old drafting machine

This is my (quite) completed router table built around IKEA kitchen cart BEKVÄM and a precise drafting machine cannibalized.

Router is a Bosch POF 1200.
Router table is equipped with power lift feature (missing only router support in the photos).

IOT RECIPE: 02 Energy Monitor

In this post i'll cover actual sensor setup for energy monitor.

Energy monitor

To evaluate power consumption i've routed main cable coming from utility energy monitor in a new electrical panel. In this panel i've installed:
  • 3 three-phase energy meter (16 kW of maximum power)
  • 1 single-phase energy meter
This is an internal view of my setup inside an ABB electrical panel (upper part, with two of these energy monitor) after thermal-magnetic circuit breaker and surge protector.

For this duty i preferred to go with an industrial solution, because i was not confident with DIY solutions on main power side.
My solution is a products from Italian manufacturer LOVATO:
LOVATO DMED300T2 is a compact (four modules) energy meter. The main advantage is the presence of two programmable pulse output (up to 1000 pulses/1kWh or programmable threshold).
The output is an open collector, in which each pulse has a duration of 60ms: an open collector is a transistor based output that can be read by an external PLC (like arduino).

The electrical connection requires only to route an input pin of the arduino to open collector and connect the two IC grounds to have the same reference level and let current from arduino to flow once open collector is open.

There are two methods to read these output, with interrupts or with pooling.
Because i had only one external interrupt, i had to go with pooling: loop forever and check if digital input is high or low. If is high, and previous one was low, than increment a counter and go on to next input. 

First of all, in my system maximum power is 16 kW: this means each hour i can have a maximum number of pulses of 16 * 1000 = 16.000 pulses/hour equal to 4.45 pulses/second, each one of 60 ms.
If entire loop timing is less than 60ms, no pulse is missed.

Because open collector is transistor based, i found no debounce routine is needed (situation like button press may need a stabilisation in input reading).

My piece of code for pooling is:

pinMode(LOVATO1, INPUT);           // set pin to input

digitalWrite(LOVATO1, HIGH);       // turn on pullup resistors

READ1 = digitalRead(LOVATO1);

if (READ1 != LASTSTATE1) {
    if (LASTSTATE1 == 1) {
      COUNTER1 ++;

Taking into account the time delta between reading A and reading B (60s in my case), is possible to average the energy consumption during this period, and to define average power consumption during the period.
Passing via serial milliseconds and pulse numbers between loops, i can reduce the time spent communicating with host, leaving calculation on other side.

Resulting chart of 1 day power consumption average (1 tick/30 minutes):


Popular posts from this blog

PEATOL/TAIG: the most beautiful affordable metal lathe

I bought a PEATOL/TAIG because i need a small lathe (despite i have a 7x20 lathe) i can operate in my house. I have known about it from the conspicuous fans all over the world.

Here some links if you want to know more about PEATOL/TAIG:
Peatol Machine Tools: the home of PEATOL/LATHE;
Deansphotografica: beautiful projects;
CarterTools: the biggest resource i know about taig;
LeeValley Instruction booklet;

I received it from Peter of Peatol (UK) on August, and now i'm showing it once assembled the base, the motor and it's fully functional. The motor was blue so i repainted to black.
I assembled also the motor mount from aluminium with primitives dovetails. My version of lathe come with powerfeed already installed and a sturdy block of aluminium for raise the entire lathe.

This is my start package:
1015Micro lathe with power feed1030Four jaw chuck, with reversible, heat-treated steel jaws10921/16"-3/8" Jacobs chuck1150Drilling tailstock - lever operated1151Needle bearing centr…

COIN-OP: mini arcade cabinet build log

My father bought some wood panels from Ikea. He donated two to build a mini arcade cabinet for my son. The arcade cabinet will use a raspberry pi with PiMame and some Sparkfun arcade goods, like a Zippy arcade joystick and concave buttons. In this post you'll find a short build log. The cabinet is 1 meter tall (39") and 0.42 meter wide (17").

Cutting the hpl boards. Masking tape installed for marking

The monitor, a 19" sony sdm-hs95
Build log:

Monitor installation test

EMBROIDERY CNC: Software completed

The software for the cnc embroidery is finally completed and fully functional.

Screenshot: Main screen
Screenshot: Palette selection
Screenshot: Color selection
Screenshot: Artwork translate panel
Screenshot: Grbl dashboard panel (realtime via browser thanks to Websocket)
Screenshot: G-Code Inspection panel