Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

July 23, 2014

RFID tag reader with ARM microcontroller

   Good afternoon makers, and welcome back to Embedded-Clovis blog. Today I will show you one of the first steps in the make of my Chip Tag for every running club (click here) project: the RFID tag reader. It is a part of a Hackaday prize project I am in, so I think it is important to share it with you.
   RFID stands for Radio-Frequency identification and is a technology that reads/writes tag's (cards, keychains, tokens) contactless (by air); it may or may not feature a power supply in the target device, and when it doesn't have a power supply the energy for the target comes from the air as well (from the host device).
   I bought the module RFID-RC522 breakout board from a random seller on eBay, that features a MFRC522 RFID chip from NXP working on 13.56MHz; I also bought some programmable RFID cards/keychains for testing: the MIFARE 1K . I haven't tested recording data on it but this is surely the next step in my journey (since I will need that on my "Chip tag for runner's" project. 
   The schematic of my project can be seen below, featuring a Freescale FRDM-K64F development board, a RFID-RC522 module and an USB cable connected to my PC. Every time a card is ready (in a 2-3 centimeters range) its data is sent to a serial console on PC: I am using the Arduino IDE console on this project. 

click in the image to Enlarge

The wiring is done as follow: 

MFRC522 SPI_MOSI => PTD2 port of my board
MFRC522 SPI_MISO => PTD3 port of my board
MFRC522 SPI_SCK => PTD1 port of my board
MFRC522 SPI_CS => PTE25 port of my board
MFRC522 MF_RESET => PTD0 port of my board
MFRC522 3.3V => 3.3V of my board
MFRC522 GND => GND of my board

   There is a test code on GitHub here,  for reading tags and sending its information to the serial console of a PC. It is important to mention here that most of the code was taken from libraries and examples created by other users on the mBed platform (please refer to the GitHub link above for credit information).
   This was only the first step on the development of my summer project (Chip tag for running clubs), but I am sure it will help people get started with RFID technology. Having any question or concern, please contact me via Twitter: @ClovisDuino  or e-mail: clovisduino AT gmail .com . See you guys next time; have fun hacking and making!. 

June 27, 2014

Leds and Buttons - Freescale FRDM-K64F

Hi makers, programmers and curious :)

   This post will be about my first contact with the ARM technology, by means of my newly arrived Freescale FRDM-K64F development board. As a good Arduino user the first thing I wanted to do with my board was to blink the RGB led it features onboard, so I did it!. The code I developed can be found here . I got a lot of help and examples from the mBed online compiler.

my first ARM-based project

   The blinking LED example from mBed website uses a "wait()" function which I don't like (because wastes processing time), so I developed my own code based on a counter that controls the "entering or not" in the blinking function. It is possible to notice in the gif image above that all the led colors are being lit, one after another; I was satisfied with the results, so I moved to the next step: adding buttons to it!. 
--------------------------------------------

   Again my code is very simple (and can be found here): when no buttons are pressed the blue LED is on; when the left button is pressed the LED turns green and for the right button the LED turns red. It took me only a few minutes to write, compile and test both circuits!.

buttons and LED's on my ARM board

I hope you guys are enjoying my blog, and I surely want to here from you. See you all soon.

My project featured on SeeedStudio

Hello Makers,

   Last Tuesday, June 24th I had a project featured in a contest of Seeed Studio website: my 6-bit Arduino thermometer, that can be seen here. The contest consists of sharing your first maker project, and you can get $5 in credits to use in SeeeD Studio website. I found their initiative very nice, because it encourages other to become makers just like me, and turn the world into a better place.


   The project inside my blog: here
   The project on Seeed Studio: here

June 18, 2014

First project - Arduino Binary Thermometer with LM35

Hello folks! 

   As a first project post I will show you the steps I take to develop a binary thermometer with a LM35 temperature sensor. It is a bit similar to this one from instructables, but mine is arduino-powered. My intention on this project was simply to test the power of arduino (UNO R3) on handling one of its ports (6 bits) at a time, and also the efficacy of the LM35 digital temperature sensor.

The prototype schematic

   The schematic I created was drawn in Fritzing. My code (also available below) can be found in GitHub ( here). It is important to notice that the limits of temperatures that can be read are NOT the ones of the LM35, instead they are limited by the Arduino power supply voltage (0 +5V): so you are able to read  temperatures between +2 and +150 degrees Celsius.

// Arduino timer CTC interrupt example (timer), from www.engblaze.com
// This example is a binary meter - shows a analog value in a binary (6-bit) output
// Modified by Clovis Fritzen, to fit as a binary thermomter (in may/2014)

// avr-libc library includes
#include < avr/io.h >
#include < avr/interrupt.h >

int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor (LM35)
byte binaryValue= B00000000; // initialize port value as zeros

void setup()
{
DDRB = DDRB | B00111111; // set 6 pins in port B as outputs

// initialize Timer1
cli(); // disable global interrupts
TCCR1A = 0; // set entire TCCR1A register to 0
TCCR1B = 0; // same for TCCR1B

// set compare match register to desired timer count:
OCR1A = 15624; // for temperature
// turn on CTC mode:
TCCR1B |= (1 << WGM12);
// Set CS10 and CS12 bits for 1024 prescaler:
TCCR1B |= (1 << CS10);
TCCR1B |= (1 << CS12);
// enable timer compare interrupt:
TIMSK1 |= (1 << OCIE1A);
// enable global interrupts:
sei();
}

void loop()
{
// You would put another stuff program here
}

ISR(TIMER1_COMPA_vect)
{
// read the value from the sensor :
sensorValue = analogRead(sensorPin);
//digitalValue= sensorValue;
binaryValue= byte(sensorValue/2);
PORTB = binaryValue;
}


   Some notes:
- The LM35 sensor is connected to the analog input A0;
- I put three colors of leds only to give an impression of "the warmer the color, the warmer the ambient (since the MSB is a red led, connected to pin 13 of arduino);
- I have only tested it indoors so far, and it showed to be accurate enough for a sensor like that, when compared to a DTH11 temperature sensor. 

I hope you have liked it, and I promised I will try to put some videos of the actual circuits working, for the next experiments.