Today I completed another small project. I’ve got this ‘smart meter’ in my house. The smart bit is that automatically sends off the meter data to the network provider. But I can not see the actual power usage from inside my apartment.
My meter has an infrared LED interface (right next to the meter above 1000 imp / kWh), which gives a pulse for every kWh consumed. By measuring the time between pulses and to count I’m on a current consumption in watts (3.6 / pulse duration to be exact).
I already had a sensor network running based on my previous Simplyduino project, so the addition of a new node was a quick job.
The graph shows that it works well. I still can not explain all the peaks, but the high consumption (800W) between 10:30 and 16:00 is my electrical water boiler. The other major consumers are the refrigerator, the coffee and tea (for short peaks).
I was using LedControl library but I found it horribly slow. It took almost 100 msecs to refresh the display. So I’ve bypassed the library, used my own frame buffer and switched to hardware SPI.The current sketch (you see in the movie) makes use of the buffer shift to update all four displays at once, instead of shifting every row/display separately I’m now pushing screens so fast I needed to introduce a delay(25) between the screen updates (The screen scrolls 1 pixel every redraw).
I recently joined a hackerspace and they have some awesome equipment. One of the machines is a 40W laser cutter. I thought it was time for some experimentation!
For my Simplyduino project I needed a new solder paste stencil because the previous one I ordered at OSH Stencils (these guys offer excellent service!) is missing a few holes for the components I added with PCB version 1.07. While those 3 extra components are very easy to solder by hand I didn’t want to spend any more more on a stencil. I read quite a few articles on the net on the subject of laser cutting your stencils and here’s my formula.
After a few experimental runs, this is my end result, and I am very happy with it:
There are a little burning marks on the stencil, that’s all!
Configure the cream layer in eagle
Export as DXF
First go to layer settings and disable all but the tCream layer. Then go to file > export > DXF..
The important setting is ‘Fill Area’ which automatically forces the ‘Use line widths’.
Opening the file in VisiCut
Our lasercutter uses VisiCut as a printer software and I figure out that tool allows me to open .DXF files directly without the fuzz of converting it to PDF or SVG first. Another advantage is that the dimensions of the pcb are not lost, saving me a lot of time aligning the stencil.
After positioning, go to Mapping en select ‘Engrave All‘. Edit the details of the mapping and change the resolution to 1200 DPI. Finally, go to Laser Settings and select power 30 and speed 100. These settings work perfectly for me. I used 125micron Mylar sheets available from amazon.co.uk.
Commercial (zooming in on the 8 pins of a ATMega328p-au)
With some minor tweaking thing may get even better.
Check the photo below for solder paste applied to the board with the above DIY stencil. I shot the photo at an angle so you can see the height of the paste applied. This close up I notice a tiny alignment shift which is entirely my fault, not the stencil!
After assembly, this looks like this:
(I needed a little rework on the ATMega pins near C2, that kind of messed up the shot )
While working on my Sensorium monitoring website for the Sensoduino, it occurred to me that i can monitor much more than just the plant moisture level. Why not (ab)use the system for monitoring the server health?
For the Sensoduino monitor website ‘Sensorium’ i’ve implemented email notifications. These HTML message are sent whenever a trigger is activated. To avoid endless prototyping I wanted to use the php engine itself to come up with the email.
I made a php page named ‘NotificationTemplate.php’ and added some code to fill a few default variables. Also, the template includes shared header and footer file to allow the mail template to be reused.
public $TriggerID = "X";
public $SensorDescription = "[SENSOR NAME]";
public $Threshold = "[THRESHOLD]";
public $MetricDescription = "[METRIC NAME]";
$triggerInfo = new dummyTrigger();
$active = true;
$triggerType = "[IS ABOVE]";
$url = HOME_URL . '/notifications.php';
The sensor <b><?php echo $triggerInfo->SensorDescription; ?></b> has reported that the <b><?php echo $triggerInfo->MetricDescription;?></b> <?php echo $triggerType;?> <?php echo $triggerInfo->Threshold; ?>.
To use this template, it needs to be ‘rendered’. Below is a fragment from my ‘sendNotification’ method that initialises a few variables and renders the above template file to a string:
$logoImageSrc = "cid:logo_sensorium";
$poweredByImageSrc = "cid:logo_powered";
//construct the message by loading running a template
$message = ob_get_contents();
The $logoImageSrc variable is used to switch between inline image attachments. As you can see in the template it is given a default if $triggerInfo was not defined.
This way the message can be preview in the browser by directly opening the php file in Safari. I am still figuring out a way to automatically convert the inline images to attachment because it will clean up the code.
Now that we have the messagebody captured in $message, we can easily send the mail by the php mail() method, or even better use phpMailer.
As a way to demonstrate the possibilities of the Simplyduino I am writing a monitoring website called ‘Sensorium’ (the hub for all sensors).Below are a few screen shots of the mockup site.
The app relies on an Arduino rigged as a bridge-node that forwards the sensor metrics to the website using http requests. This way the system does not need any complete USB or Serial port handling, which makes it possible to run the website on any server in the world.
Sensorium will send notifications (by email) when one of your sensors reaches a configurable state. In a future version these notification should also be able to send out triggers to drive the output drivers of the Sensoduino, for example to turn on a light when garage door opens. Now I realise this is a bad example and could be better done by the Arduino directly, but this approach makes it possible to have complex and configurable logic taken outside the Arduino and into the ‘internet of things’.
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.