February 15, 2014

Unboxing: Opening Sugru Magnet Kit

Terrific idea from Sugru: Sugru + Magnets in a kit!

Ordered... and finally arrived!

Here's the customized envelope front:


and back:


Really a nice start.

Here's the contents of the envelope (the receipt and the kit):


Here's the kit (the little manual and the tin can):




Opening the tin can:


You can find three Sugru 5g packs and four round magnets:


Here's one magnet (you can see the round rubber that isolates a bit the magnet from the tin and makes it easy to lift up):


The cardboard packaging is very different from the one designed at first!

Now I'm ready to hack something...!

BTW, really interesting story of Where Sugru Comes From (from Make).

And from Sugru the story behind Sugru in general and this kit in particular (at the bottom of the page).


July 20, 2013

Arduino: problems compiling sketches for ATMEGA168 vs ATMEGA328

I was struggling to find a solution to a compile problem, trying to recompile code originally written for an ATMEGA168 to an ATMEGA328, when I came to this post that saved me the day...

I had problems with #define PB2 and #define PC2 (and other similar one) that have been renamed for some reason...

ATMEGA8 and ATMEGA168 uses:
/hardware/tools/avr/avr/include/avr/iomx8.h include file,
while ATMEGA328 uses:
/hardware/tools/avr/avr/include/avr/iom328p.h instead.

For example:

for ATMEGA8 and ATMEGA168:
#define PORTB   _SFR_IO8 (0x05)
/* PORTB */
#define PB7     7
#define PB6     6
#define PB5     5
#define PB4     4
#define PB3     3
#define PB2     2
#define PB1     1
#define PB0     0


while for ATMEGA328:
#define PORTB _SFR_IO8(0x05)
#define PORTB0 0
#define PORTB1 1
#define PORTB2 2
#define PORTB3 3
#define PORTB4 4
#define PORTB5 5
#define PORTB6 6
#define PORTB7 7


or, for ATMEGA8 and ATMEGA168:
#define PORTC   _SFR_IO8 (0x08)
/* PORTC */
#define PC6     6
#define PC5     5
#define PC4     4
#define PC3     3
#define PC2     2
#define PC1     1
#define PC0     0


while for ATMEGA328:
#define PORTC _SFR_IO8(0x08)
#define PORTC0 0
#define PORTC1 1
#define PORTC2 2
#define PORTC3 3
#define PORTC4 4
#define PORTC5 5
#define PORTC6 6


Other differences are in the interrupt vectors: ATMEGA 8 and ATMEGA168 uses iomx8.h include file, while ATMEGA328 uses iom328p.h instead.

June 8, 2013

Fixing Ikea Lottorp Clock

Ikea Lottorp Clock is a cheap, simple yet complete and easy-to-use alarm clock (and timer, and thermometer!).

UPDATED: Unfortunately, it's almost a discontinued product now...

It is so nice, I've resisted my impulse to hack it... till now...

After another tumble, the mechanism allowing to change function rotating the clock has stopped working.

Time to try to fix it!




With the help of a small flat screwdriver, you can lift and remove the front panel.


It is attached using bi-adhesive tape.





You can then peel-off the bi-adhesive tape (pay attention not to let it crush).


You can then see the four holes to access the small screws that hold the front panel.


With the help of a little philips screwdriver, remothe the four screws.



After removing the front panel, you get access to the main board (attached to the front panel itself) and the internals (the pushbuttions circuit board and the battery holder).



In my case, the tilt sensor (the white block in the picture) did not work anymore because the lid was detached (and the small metal ball was free to move in the clock container...).


After putting it back ad fixing it with super-glue, the tilt mechanism started working again.

Here is a detailed picture of the internals of the tilt sensor. When rotating the clock, the small metal ball makes different connections telling the microcontroller the clock orientation.


In this picture you can see the small (black) piezo speaker used by the alarm.


This speaker makes also a quite annoying "beep" each time you turn the clock. One possible hack is to add a switch in series to the speaker to stop it doing that... even if you have to remember to enable the speaker when you need your alarm to wake you up!

The printing on the main board gives you instant access to the battery, the RGB LED and the pushbuttons, too.




January 12, 2013

Arduino based data logging thermometer in IKEA RIBBA frame


And featured on Hack A Day, too!



I was looking for a nice enclosure to host my latest project (an Arduino baased data logging thermometer with multiple sensors) and, once again, I came to an Ikea product, a RIBBA photo frame that has enought space to host my project circuitry:



My idea was to relocate the back of the frame in line with the rear edge to use the empty space present in RIBBA:



Here's the back:



held in place with these tiny metal strips:


The inside of the frame seems to be a very convinient project box:



After removing the inner piece of paper, there's a nice cardboard frame I'm planning to keep in place:



Here's my idea: to put the LCD in the middle and all the circuitry nearby, masking the clear glass with tracing paper (to have a blurry vision of the circuit boards):



Here are all the circuits and components I have to fit in the frame, placed in the definitive places:



I've started putting some plastic spacers in the corners:



fixing them with hot glue:



Spacers are cut to size to leave enought space to fix the back of the frame.

All the circuitry is fixed to the back of the frame "sewing" the circuit boards with some thin wire that passes on top of the stripboard...



...and is fixed on the back of the frame with simple knots:



For example, here's a detail of the stripboard hosting the pushbuttons, with the "sewing" wire passing on the top of the board...



...and ending with two knots on the back:



Here's where the temperature sensors are connected to the thermometer, near the power connector (one sensor is hosted on the back of the thermometer itself):



Power is given by four AA batteries (in a battery holder provided with a switch) or by a wall adapter (connecting the wall adapter to the power connector, batteries are automatically disconnected).

Here's the blurry view of the electronics given by a sheet of tracing paper:



And here's the final view I'm going to achieve putting back the original cardboard frame:



To have a clear view of the LCD, I've cutted to size a window in the tracing paper:



Here's the back (hosting the circuitry) in place:



The SD card holder is on the outside for easy insertion/removal.

And here's the front:



Here's my thermometer in place and working to show temperatures and log data!


UPDATED: featured on Ikea Hackers!

UPDATED: featured on Hack A Day!

January 3, 2013

Thermometer with data logging and multiple sensors

After my first experiments (here and here) with Dallas One-Wire temperature sensors, I've decided to realize a thermometer that was able to log temperatures coming from multiple sensors, adding date/time information (coming from a Real Time Clock).

Here's the outcome: a thermometer based on Dallas DS18B20 sensors on a Dallas One-Wire bus, logging data on an SD card. Information are showed on a 2x16 LCD.

Thanks to three push buttons you're able to perform different tasks.

The first pushbutton is used select showing mode on LCD (alternating time/date show, single sensor temperature show or scanning sensors temperatures).

The second one is used to enable/disable logging data on SD card.

The third one is used to temporarily switch LCD backlight on.

There's a LED to show when logs are written on the SD.

When the "mode" push button is kept pressed during reset, verbouse startup is done (i.e. all sensor addresses are shown, together with other information like the number of sensors that has been found, the refresh period and the file name used for logging).


When the "end-log" push button is kept pressed during reset, temperatures logging is not done (i.e. it is possible to use this digital thermometer without an SD card inserted in its slot).


Temperatures are logged every temperature-refresh cycle.


Log file is closed each cycle (so it is safe to switch power off when the writing-status LED is off, e.g. right after an entry has been written - or you can use the "end-log" push button to end logging and safely switch off the thermometer).

When enable/disable log push button is pressed, logging on file is enabled/disabled (untill a reset, the same log file is used in append).

Temperatures logging is started on a new file each reset (to start loggin on a new file, press the reset button or switch the Thermometer off and on).


When the third "LCD backlight" push button is pressed, LCD backlight is temporarily switched on.


Date/time showing and date/time information in log files are based on a Real Time Clock module (using a Dallas DS1307 chip).


This is the schematics I've used to realize this thermometer:




It shows how the different components are connected to my Arduino 2009 board.

And (after several iterations...) here's the code I'm using:

DigitalThermometerV3final.pde
(compiled with Arduino IDE 0022)

If you're going to give it a try, send info/link to your work in the comments.

UPDATED: since I don't like to waste my precious Arduino hosted in a project, I've realized a stand-alone version on a single stripboard hosting a minimal version of Arduino, an LCD with a basic interface, the PNP transistor to control LCD backlight, and a 3.3V and 5V supply circuitry



I've connected to the stripboard a One-Wire bus for the temperature sensors, a small stripboard hosting the three pushbuttons (in enabled internal pull-up resistor configuration), the LED, the SD Card module, the RTC module and a power jack to give power to the unit (I'm planning to use a battery pack or a wall adapter).

November 24, 2012

TI Stellaris LaunchPad Evaluation Kit Unboxing

I've finally received from Texas Instruments the Stellaris LaunchPad Evaluation Kit!!!

It was 4.99$ free shipping worldwide! It took quite long to arrive but it's here!

Here's the unboxing.

the external cardboard box...


and well protected inside...


the evaluation kit cardboard box


the back of the box...


opening the box a "welcome" quick guide...


under the guide, the board!!! protected in antistatic bag...


a "Start Here" inviting to flip the cardboard...


to find a micro-USB/USB cable...

nice box, with a "Happy coding" by the Stellaris MCU Team under the cable...

the contents of the box...


here's the Stellaris LaunchPad board!!!


and the back of the board...


the board arrives pre-programmed with a simple program changing the color of the embedded RGB LED (the color can be changed also pressing the embedded user push-buttons on the board)...


can't look forward to playing with it!