AVR-T32U4 Arduino Leonardo interfacing to LEDs and Buttons in LED game

Image

We create small video tutorial http://www.youtube.com/watch?v=OCd_YFYHWnM how to connect LEDs and Buttons to AVR-T32U4 Arduino Leonardo and create small Game.

The code is on GitHub https://github.com/OLIMEX/DUINO

AVR-T32U4 Arduino Leonardo experiments with knock sensor and servo

Image

This is simple fun project which we build for couple of minutes with materials in the office.

What you need: AVR-T32U4 Arduino Leonardo clone, Breadboard-1 for AVR-T32U4, LiPo battery, some JumperWires, Knock sensor, MS-1.3-9 servo motor, some tape and empty carton box.

Tape the servo in the corner and put on it plastic arm which to rise the box lid, tape the knock sensor to the lid. Connect the servo to D9 and Knock sensor to A0 of AVR-32U4.

The code Knock.ino is on GitHub https://github.com/OLIMEX/DUINO/tree/master/AVR/KNOCK, as you can see it’s pretty simple, once on A0 is detected level above some threshold (you can experiment what this level is in your case as it depend on how you attach the knock sensor to the box) you move the servo motor up wait some time and move it back.

Watch the video in action: http://www.youtube.com/watch?v=HFmPvcbbiT4

Then one of our practicing students at Olimex decided to make code which will open the box only if you knock in some secret sequence of long and short knocks and the code is also on Github (please be gentle the code is crappy but written by enthusiast with no much experience).

The new video for the password knock is here: http://www.youtube.com/watch?v=3wsnxi5x2R0

Measuring temperatures from -250C to +1600C with AVR-T32U4 Arduino Leonardo and MOD-TC-MK2-31885 + thermocouple

Image

MOD-TC-MK2-31885 is UEXT module which uses MAX31885 and allow temperatures in range -250C to +1600C to be measured with proper thermocouple.

For this demo we use TC-K-TYPE which is low cost K-type thermocouple.

When the thermocouple is connected pay attention that it have polarity i.e. if your measurements start to decrease when you increase the thermocouple end temperature you have to swap the thermocouple wires to the connector.

Another issue we got with Arduino 1.0.4 is that Serial print from time to time stop working on Leonardo and several uploads usually solve the problem, we guess this is some USB port problem and Leonardo is not properly enumerated as CDC serial port every time.

Also I2C library on Leonardo sometimes beahve weird and in this case you have to decrease I2C speed a bit. So if the sketch do not work correctly just edit TWI_FREQ to 80000L in:

C:\arduino-1.0.4\libraries\Wire\utility\twi.h

#ifndef TWI_FREQ
 #define TWI_FREQ 100000L
 #endif

You can watch the demo at this video: http://www.youtube.com/watch?v=ltS5ZEJiCEM

As you can see there are two temperatures which are measured: the temperature on the thermocouple TC and the internal MAX31855 temperature INT (i.e. cold end thermocouple temperature).

Also MAX31885 recognize if the thermocouple is disconnected, shorted or connected to VCC.

The demo code is at GitHub: https://github.com/OLIMEX/DUINO/tree/master/AVR/MOD-TC-MK2-31885

FRIDAY FREE BOARD QUIZ ISSUE #18 PRIZE IS AVR-T32U4

Image

AVR-T32U4 is Arduino Leonardo compatible i.e. you can develop with Arduino IDE and at the same time Breadboard friendly.

With this board you can easily make your projects without soldering.

The T-shape board idea ws first invented by Ken Segler and we love it as it allow to feed your power supply to the breadboard too.

Today at 17.00 o’clock our local Bulgarian time (GMT+2) we will post on Twitter our question.

You have one hour to reply to our tweet with the correct answer.

At 18.00 o’clock we will count the correct answers and ask random.org to generate random number in range then anнounce the winner and ship the board by airmail next Monday.

Good luck!