Multifunction shield for Arduino Uno (HCARDU0085)

admin
Site Admin
Posts: 865
Joined: Sun Aug 05, 2012 4:02 pm

Multifunction shield for Arduino Uno (HCARDU0085)

Post by admin » Thu May 29, 2014 9:25 am

Image

Description:
This Arduino Uno and Leonardo compatible multifunction experimenter shield (HCARDU0085) has a large range of features which makes it ideal for beginners who just want to experiment and learn, or just as a general purpose shield for more advanced uses. Besides the feature rich range of components fitted to the shield, there are also a range of expansion headers for convenient interfacing of external modules and components. The shield includes R3 type headers for easy connection to your Arduino board. If you have a pre R3 design board please check for compatibility before purchase.

Please note: Before applying power to your Arduino board check that other than the header pins, no part of the underside of this shield is in contact with the host board. This shield includes a header for attaching an IR reciver (U4-IR-2). The pinout order is not suitable for direcly connecting a SFH506-38. However the order is compatible with our 1838B Infrared IR receiver (HCSENS0014). Please always check the attached schematic before connecting external components.

Order Yours Here.

Multi function experimenter shield features:

4 digit 7-segment LED display module driven by two serial 74HC595's
4 x surface mount LED's in a parallel configuration
10K adjustable precision potentiometer
3 x Independent push buttons
Piezo buzzer
DS18B20 temperature sensor interface
LM35 temperature sensor interface
Infrared receiver interface
Serial interface header for convenient connection to serial modules such as Bluetooth, wireless interface, voice module, a voice recognition module etc


FAQ:

When trying the seven segment display example, one or more segments are permanently illuminated.

See above warning.


LED D1 glows very dimly when the digital pin connected to it is configured as in input but the other LED's are all off.

If you have an old Arduino board this may have an LED labled 'L' permanently connected (via a resistor) to the same pin that controls LED D1 on the shield (digital pin 13). This is providing a current path via these two LED's which causes both LED's to always be forward biased and turned on. In newer revisions of Arduino boards the design was changed to resolve issues caused by this LED being connected to digital pin 13 .



Example Sketches:

Push Button:

Code: Select all

/* FILE:    ARD_Multifunction_Shield_Push_Button_Example
   DATE:    28/05/14
   VERSION: 0.1
   
REVISIONS:

28/05/14 Created version 0.1

This is an example of how to use the 3 push buttons on the Hobby Components Arduino 
compatible Multi Function experimenter shield (HCARDU0085).

This example sketch will continuously read the state of the 3 push buttons and 
output it to the serial terminal. To see the output open up the serial
monitor (Tools-> Serial Monitor) in your Arduino development environment and make 
sure the baud rate is set to 9600 Baud.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used for the purpose of promoting or selling products 
that directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/


/* Define pin numbers used to read the state of the buttons. 
   The buttons are connected to the Arduino's analogue pins but 
   because they only have two states we will read them as digital 
   inputs */
#define BUTTON1 A1
#define BUTTON2 A2
#define BUTTON3 A3

void setup()
{
  Serial.begin(9600); 
}

/* Main program */
void loop()
{
  /* Has button one been pressed? */
  if(!digitalRead(BUTTON1))
    /* If so then send a message to the serial port */
    Serial.println("Button 1 Pressed!");
  /* Has button two been pressed? */
  if(!digitalRead(BUTTON2))
    /* If so then send a message to the serial port */
    Serial.println("Button 2 Pressed!");
  /* Has button three been pressed? */
  if(!digitalRead(BUTTON3))
    /* If so then send a message to the serial port */
    Serial.println("Button 3 Pressed!");
}
Potentiometer:

Code: Select all

/* FILE:    ARD_Multifunction_Shield_Potentiometer_Example
   DATE:    28/05/14
   VERSION: 0.1

REVISIONS:

28/05/14 Created version 0.1

This is an example of how to read the position of the 10K potenetiometer 
on the Hobby Components Arduino compatible Multi Function experimenter shield
(HCARDU0085).

The sketch will read the current position of the potentiometer and output it to
the serial terminal once every 0.5 seconds. To see the output open up the serial
monitor (Tools-> Serial Monitor) in your Arduino development environment and make 
sure the baud rate is set to 9600 Baud.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/


/* Define the analogue pin used to read the potentiometer */
#define PotPin 0

void setup()
{
  Serial.begin(9600); 
}

/* Main Program */
void loop()
{

  Serial.print("Potentiometer: ");
  Serial.println(analogRead(PotPin));
  
  /* Wait 0.5 seconds before reading again */
  delay(500);
}
Buzzer:

Code: Select all

/* FILE:    ARD_Multifunction_Shield_Buzzer_Example
   DATE:    28/05/14
   VERSION: 0.1

REVISIONS:
28/05/14 Created version 0.1

This is an example of how to use the buzzer on the Hobby Components Arduino compatible

Multi Function experimenter shield (HCARDU0085).

The sketch will use the buzzer to create 'pings' at a repetition rate dependant on 
the current position of the 10K potentiometer.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/


/* Define the analogue pin used to read the potentiometer */
#define POT_DIO 0

/* Define the digital pin used to control the buzzer */
#define BUZZER_DIO 3

#define OFF HIGH
#define ON LOW

void setup()
{
  /* Set the buzzer pin to an output and turn the buzzer off */
  pinMode(BUZZER_DIO, OUTPUT);
  digitalWrite(BUZZER_DIO, OFF);
}

/* Main Program */
void loop()
{
  /* Read the current position of the 10K potentiometer and use it 
     as a time delay */
  delay(analogRead(POT_DIO));
  
  /* Turn the buzzer on for 20ms and then turn it back off again */
  digitalWrite(BUZZER_DIO, ON);
  delay(20);
  digitalWrite(BUZZER_DIO, OFF);
}
LEDS:

Code: Select all

/* FILE:    ARD_Multifunction_Shield_LED_Example
   DATE:    28/05/14
   VERSION: 0.1
   
REVISIONS:

28/05/14 Created version 0.1

This is an example of how to use the 4 LED's on the Hobby Components Arduino 
compatible Multi Function experimenter shield (HCARDU0085).

This example sketch will repeatedly turn each LED on in sequence to create a 'cylon' 
effect.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used for the purpose of promoting or selling products 
that directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/


/* Define the DIO pin numbers for each LED */
const byte LED[] = {13,12,11,10};

void setup()
{
  /* Set each pin to outputs */
  pinMode(LED[0], OUTPUT);
  pinMode(LED[1], OUTPUT);
  pinMode(LED[2], OUTPUT);
  pinMode(LED[3], OUTPUT);
}


/* Main program */
void loop()
{
  byte Index;
  
  /* Step through each LED and turn it on in sequence */
  for(Index = 0; Index <= 3; Index++)
  {
    /* First turn all the LED's off */
    digitalWrite(LED[0], HIGH);
    digitalWrite(LED[1], HIGH);
    digitalWrite(LED[2], HIGH);
    digitalWrite(LED[3], HIGH);
    /* Then turn the next LED ON */
    digitalWrite(LED[Index], LOW);
    /* Wait a little between each sequence */
    delay(100);   
  }
  
  /* Do the same thing but in reverse order */
  for(Index = 3; Index > 0; Index--)
  {
    /* First turn all the LED's off */
    digitalWrite(LED[0], HIGH);
    digitalWrite(LED[1], HIGH);
    digitalWrite(LED[2], HIGH);
    digitalWrite(LED[3], HIGH);
    /* Then turn the next LED ON */
    digitalWrite(LED[Index], LOW);
    /* Wait a little between each sequence */
    delay(100);   
  }
}
4 Digit Seven Segment Display:

Code: Select all

/* FILE:    ARD_Multifunction_Shield_Seven_Segment_Example
   DATE:    28/05/14
   VERSION: 0.1
   
REVISIONS:

28/05/14 Created version 0.1

This is an example of how to use the 4 digit seven segment display on the Hobby 
Components Arduino compatible Multi Function experimenter shield (HCARDU0085).

This example sketch will display a decimal number on the seven segment LED display 
which will increment by one wever 100ms.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used for the purpose of promoting or selling products 
that directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/


/* Define shift register pins used for seven segment display */
#define LATCH_DIO 4
#define CLK_DIO 7
#define DATA_DIO 8
 
/* Segment byte maps for numbers 0 to 9 */
const byte SEGMENT_MAP[] = {0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0X80,0X90};
/* Byte maps to select digit 1 to 4 */
const byte SEGMENT_SELECT[] = {0xF1,0xF2,0xF4,0xF8};


unsigned long Cur_ms_Count; // Stores the current time in ms
unsigned long Last_ms_Count; // Stores the last time in ms the counter was last updated
int Count; // Stores the value that will be displayed

void setup ()
{
  /* Set DIO pins to outputs */
  pinMode(LATCH_DIO,OUTPUT);
  pinMode(CLK_DIO,OUTPUT);
  pinMode(DATA_DIO,OUTPUT); 
  
  /* Initiliase the registers used to store the crrent time and count */
  Cur_ms_Count = millis();
  Last_ms_Count = 0;
  Count = 0;
}

/* Main program */
void loop()
{
 
  /* Get how much time has passed in milliseconds */
  Cur_ms_Count = millis();
  
  /* If 100ms has passed then add one to the counter */
  if(Cur_ms_Count - Last_ms_Count > 100)
  {

    Last_ms_Count = Cur_ms_Count;
    
    if(Count < 9999)
    {
      Count++;
    } else
    {
      Count = 0;
    }
  }
  
  /* Update the display with the current counter value */
  WriteNumber(Count);
}


/* Write a decimal number between 0 and 9999 to the display */
void WriteNumber(int Number)
{
  WriteNumberToSegment(0 , Number / 1000);
  WriteNumberToSegment(1 , (Number / 100) % 10);
  WriteNumberToSegment(2 , (Number / 10) % 10);
  WriteNumberToSegment(3 , Number % 10);
}

/* Wite a ecimal number between 0 and 9 to one of the 4 digits of the display */
void WriteNumberToSegment(byte Segment, byte Value)
{
  digitalWrite(LATCH_DIO,LOW); 
  shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_MAP[Value]);
  shiftOut(DATA_DIO, CLK_DIO, MSBFIRST, SEGMENT_SELECT[Segment] );
  digitalWrite(LATCH_DIO,HIGH); 	
}

Schematic:
Multifunction_Expansion_Shield_Schematic.pdf
You do not have the required permissions to view the files attached to this post.

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Fri Jun 06, 2014 2:38 pm

There is a mistake in the code for the seven segment display.
"if(Count >= 9999)" should be "if(Count <= 9999)"

It never counts!

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Fri Jun 06, 2014 2:40 pm

There is a mistake in the code for the seven segment display.

Code: Select all

if(Count >= 9999)
should be

Code: Select all

if(Count <= 9999)
It never counts!

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Fri Jun 06, 2014 3:14 pm

Looking at the schematic, it looks like it doesn't have decimal point support, is that correct?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by andrew » Fri Jun 06, 2014 5:44 pm

Thanks for pointing this out, I've corrected it although I believe the correct line should be if(Count < 9999)

Looking at the pinout for the seven segment module fitted to the board, I think the decimal point is controlled by the connection P0.7 on the schematic which is connected to output QH on the second shift register.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Fri Jun 06, 2014 7:37 pm

Hi,
Just started to look into controlling the decimal point and was getting confused until I realised that the 'b' segment is permanently illuminated on all the digits and is also slightly brighter than the other segments.

I think the unit is faulty, I only recieved it this morning. :?: :?:

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Fri Jun 06, 2014 9:45 pm

andrew wrote:Thanks for pointing this out, I've corrected it although I believe the correct line should be if(Count < 9999)

Looking at the pinout for the seven segment module fitted to the board, I think the decimal point is controlled by the connection P0.7 on the schematic which is connected to output QH on the second shift register.
Oh yes, sorry didn't look at the circuit first just the code.

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Fri Jun 06, 2014 10:12 pm

Also the bleep code is wrong you don't use the buzzer output variable the pot in is used in error.

This is the corrected code not the original

Code: Select all

/* FILE:    ARD_Multifunction_Shield_Buzzer_Example
   DATE:    28/05/14
   VERSION: 0.1

REVISIONS:
28/05/14 Created version 0.1

This is an example of how to use the buzzer on the Hobby Components Arduino compatible

Multi Function experimenter shield (HCARDU0085).

The sketch will use the buzzer to create 'pings' at a repetition rate dependant on 
the current position of the 10K potentiometer.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used directly for the purpose of selling products that
directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER.
*/


/* Define the analogue pin used to read the potentiometer */
#define POT_DIO 0

/* Define the digital pin used to control the buzzer */
#define BUZZER_DIO 3

#define OFF HIGH
#define ON LOW

void setup()
{
  /* Set the buzzer pin to an output and turn the buzzer off */
  pinMode(BUZZER_DIO, OUTPUT);
  digitalWrite(BUZZER_DIO, OFF);
}

/* Main Program */
void loop()
{
  /* Read the current position of the 10K potentiometer and use it 
     as a time delay */
  delay(analogRead(POT_DIO));
  
  /* Turn the buzzer on for 20ms and then turn it back off again */
  digitalWrite(BUZZER_DIO, ON);
  delay(20);
  digitalWrite(BUZZER_DIO, OFF);
}
Last edited by gadjet on Sat Jun 07, 2014 9:18 am, edited 1 time in total.

gadjet
Posts: 25
Joined: Thu Mar 13, 2014 12:46 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by gadjet » Fri Jun 06, 2014 10:20 pm

LED Code is wrong, correct code for LED sketch below.
Also because of the 'L' led (i think) LED D1 is always illuminated

Code: Select all

  /* Set each pin to outputs */
  pinMode(LED[1], OUTPUT);
  pinMode(LED[2], OUTPUT);
  pinMode(LED[3], OUTPUT);
  pinMode(LED[4], OUTPUT);

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: Multifunction shield for Arduino Uno (HCARDU0085)

Post by andrew » Sat Jun 07, 2014 7:47 am

LED Code is wrong, correct code for LED sketch below.
Thanks, this is now updated.
Also because of the 'L' led (i think) LED D1 is always illuminated
The 'L' LED is connected to digital pin 13 and can be turned on and off with the D1 LED on the shield by changing the state of this pin.

Also the bleep code is wrong you don't use the buzzer output variable the pot in is used in error.
I'm not sure what you mean by this but the value read back from the potentiometer is fed into the delay function to vary the amount of delay time between beeps. I've just checked the code and it seems to work fine.
Just started to look into controlling the decimal point and was getting confused until I realised that the 'b' segment is permanently illuminated on all the digits and is also slightly brighter than the other segments.

I think the unit is faulty, I only recieved it this morning. :?: :?:
I think you have contacted us via eBay so we will discuss this further via the eBay's messaging system.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “Arduino Shields”