Friday, May 3, 2013

RGB SMD LED module




Hey the longest uppercase title appeared around here! It's for a small nice Arduino module I came across recently. I was so excited to try the new module that I wired it to Arduino and immediately uploaded the sketch. While uploading I heard a strange sound, like frying oil…


It was the led! I disconnected power instantly and started reading the documentation to understand what was going on. Finally, I read the seller advice: 

"THIS MODULE DOES NOT INCLUDE CURRENT LIMITING RESISTORS. This allows the module to be used with a range of supply voltages but you must drive the LED's via an appropriate current limiting resistor otherwise damage to the LED's will occur. "

Gasp! And it was written in capital letters!

Setting up an alarm on the RTC module




Reading the MCP79410 data sheet, I found the purpose of the MFP pin on the RTC module (see this post). I promised to come back in the near future to dig more about this. This pin is used for special functions like setting an alarm or getting a square wave signal.

MCP79410 Alarms

This chip provides two alarms: alarm 0 and 1. They are both structured as the main time/date registers, just the address change. Alarm 0 uses the addresses ranging from 0x0A to 0x0F, while Alarm 1 is from 0x11 to 0x16.

In order to set an alarm one should first set bits 4 and 5 of the configuration register according to the following table

Bit 4 Bit 5 Meaning
0 0 No alarm
0 1 Alarm 0 is set
1 0 Alarm 1 is set
1 1 Unused

The configuration register can be found at address 0x7.

Library

I developed a small library for playing with the RTC module. Successively, I decided to expand the library to cover all sort of sensors, modules, etc that I was cumulating so far. It can be found on github at the following address: https://github.com/maczinga/ASOM. Commands related to RTC module are in RTC.h and RTC.cpp. Below we briefly resume those relative to alarms.

LCD Module (MR007-005.1)




My first add-on! This a LCD module with a 16x2 lines display. It is based on the controller SPLC780D which is totally compatible with the Hitachi HD44780 LCD controller chip. Hence all examples coming with the Arduino-IDE worked fine provided the change of RS pin from 12 to 7 and Enable pin from 11 to 6.


In order to try the module and its functionalities out, I conceived a small sketch for managing a menu with four options. The options that cannot be displayed can be visualized using button 3 (line up) and button 4 (line down). It remains to test for button 1 pressed to select the option from the menu, I leave this for the reader ;-)

IR remote control




Just received! A new nice module for Arduino. This an IR remote control module. As usual I rushed to the web page of the seller looking for informations and test programs. 




This time informations are terse. It says that I bought a 38KHz IR receiver module. The pin out is as follows


Black wire = GND
Red wire = +5V
Green wire = data


SD card reader




The third add-on I bought was an SD card reader from LC Studios. Here is a picture of this small module.

When I received it, I rushed to take the first SD card I could find: the one in the digital camera of my daughter. :-(

Soon after, I came across some difficulties since there were no instructions on how to use it and how to wire it to the Arduino board. Finally, after some web search, I arrived at this excellent page and… miracle! Everything worked fine.

The secret was in the correct interpretation of the acronyms of the pins in the SD card. Here it is:


+5, 3.3 and GND are clear

CS is also clear (connect it to digital pin 10)
MOSI means digital output (connect it to digital pin 11)
MISO means digital input (connect it to digital pin 12)
SCK means CLK (connect to digital pin 13)

Real-time clock (RTC) module





Yet another module bought on Ebay! This is a nice RTC (Real Time Clock) module based on the MCP79410 chip. It hosts also a 3V battery for memorizing data even when power has been turned off.



I connected the corresponding pins on the Arduino Board. Since there was no indication, the MFP terminal has been connected to Analog pin A0 on Arduino. After some time, reading the MCP79410 datasheet, I found what is the purpose of MCP! It is meant to signal alarm and clock out.

What that blinking LED?




At first power on I saw a blinking led on Arduino board and got immediately worried about it! I rushed to the internet and after some surfing I found the answer. In most boards sold over the internet, Arduino come with a pre-loaded program which is "Blink". The program can be found in the examples provided with the Arduino IDE, I report it below. Just upload another program to get the LED stopped.

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);    
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}
This was the first experience hopefully the next ones will be less threatening and more exciting ;-)

How all started




I recently came up on this page www.arduino.cc. I got fulgurated. A simple playground for electronic/robotic hobbyist, at last! I immediately rushed to xybay to buy the card dreaming of fantastic applications and of the most futuristic robotic scenarios.

This is open hardware! That is the hardware version of open software. I immediately bought lots of small add-ons and read lots of stuff.I will try to record here my progress and small discoveries.