We've gone through our stock and we have found that some shields don't have the seven segment module pins cropped enough so will come into contact with the USB connector when fully inserted. Unfortunately you must have one of these. However most of the shields we have checked are OK when the shield fully inserted. If this isn't done on these shields they can be tilted to one side which would allow them to make contact. I've put a note of the forum in the description to check for this which will shortly be added to the various listing pages.

_________________Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Tue Jun 10, 2014 7:49 am

barewires

Joined: Wed Aug 21, 2013 7:38 amPosts: 49

Re: Multifunction shield for Arduino Uno (HCARDU0085)

gadjet wrote:

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

Thanks,at the moment I only need one digit to have a decimal point and therefore I just AND the required digit with 0x7f and that switches on the DP for just that digit position whatever the number is.

Wed Jun 11, 2014 3:19 pm

barewires

Joined: Wed Aug 21, 2013 7:38 amPosts: 49

Re: Multifunction shield for Arduino Uno (HCARDU0085)

To turn on a designated Decimal Point, the segment map can be expanded with ten more values. Simply replace the following lines. A-OK on the 0x7F mask, I posted and then read your comments. We all can benefit from this forum.

The silkscreen layout is correct with the flat side facing the bottom side of the board towards the 3 pushbuttons.The designation "U5-18b20-LM35-A4" has an arrow pointing up toward the centre DQ data pin. Gnd on the left, +5 on the right. DQ data is on pin A4.

"Each DS18B20 contains a unique 64–bit code stored in ROM. The least significant 8 bitsof the ROM code contain the DS18B20’s 1-Wire family code: 28h. The next 48 bits contain a uniqueserial number. The most significant 8 bits contain a cyclic redundancy check (CRC) byte that iscalculated from the first 56 bits of the ROM code." The serial monitor output is shown below: R= 28 is the family code.

Byte 0 and byte 1 of the scratchpad contain the LSB and the MSB of the temperature register respectively.P= 01 A2 is 0x01A2 = 418 decimal x 0.0625 = 26.125 degrees C, increases to 0x01A3 on the next sample.

Last edited by barewires on Sun Jul 20, 2014 11:08 am, edited 2 times in total.

Sun Jun 15, 2014 1:02 pm

linker3000

Joined: Mon Jun 23, 2014 9:26 pmPosts: 5

DS18B20 Code for 7 segment display

Hi everyone,

I am really new to Arduino so I purchased a Uno and this shield for learning. My first effort has been to merge some code for a DS18B20 temperature sensor and the 7 segment display. The resulting sketch is below - it uses a timer interrupt routine to keep the display refreshed and bright. Suggestions for improvements are most welcome.

The sketch comments include additional notes - for example, you need to install the OneWire library to read the temperature sensor.

This is an example of how to use Hobby Components Arduino compatible Multi Function experimenter shield (HCARDU0085), fitted with a (optional) DS18B20 1-wire digital temperature sensor in socket U5.

The main loop of this sketch reads the temperature sensor approximately every 250mS and updates a variable with the reading. In the background, an interrupt routine is constantly reading this value and displaying it on the 7-segment LED display.

This code is based on the original 7-Segment sketch example from HobbyComponents.com together with interrupt servicing code from http://www.instructables.com/id/Arduino-Timer-Interrupts/ which was released under the terms of the GPL3 licence.

OneWire code located at various sources, including: http://forum.arduino.cc/index.php?topic=143382.0

To compile this sketch, download and install the OneWire library from here: http://www.pjrc.com/teensy/td_libs_OneWire.html

You may copy, alter and reuse this code in any way you like, but please leave reference to HobbyComponents.com and the author 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.

NOTES:

This version of the sketch sets a fixed decimal point, so assumes the input temperature is in the range 00.00-99.00C.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS AND THE AUTHOR MAKE 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. */

#include <OneWire.h>

int DS18S20_Pin = 18; //DS18S20 Signal pin on A4 (pin 18)

//Stores the value for the 7-segment display//Initial setting turns on all segments as a lamp testint Number = 8888;

//Can be used to set the position of the decimal point on the LED display - in this example code, the DP is fixedint Dec_one;int Dec_two;int Dec_three;int Dec_four;

/* Segment byte maps for numbers 0 to 9 *///This map is the revised version of the map that adds decimal point support. There is also an additional map//(highest value in the map) for a blank segment display, but it is not used in this sketchconst byte SEGMENT_MAP[] = { 0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0X80,0X90,0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0X00,0X10,0XFF}; // msb is DP/* Byte maps to select digit 1 to 4 */const byte SEGMENT_SELECT[] = { 0xF1,0xF2,0xF4,0xF8};

This re-tasks one of the hardware timers to run code in the background at regular intervals. There's a blink example that shows how it works and will give you an idea on how you may be able to use it to run the code for updating the display outside of the main loop.

_________________Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Sun Jul 06, 2014 10:08 am

linker3000

Joined: Mon Jun 23, 2014 9:26 pmPosts: 5

Re: Multifunction shield for Arduino Uno (HCARDU0085)

andrew wrote:

You may find our HCTimer2 library of use to you. You can download it here:

This re-tasks one of the hardware timers to run code in the background at regular intervals. There's a blink example that shows how it works and will give you an idea on how you may be able to use it to run the code for updating the display outside of the main loop.

Thanks Andrew - I modified my original post as I worked out a timer-based interrupt routine, but I will take a look at the code you suggest too.

Sun Jul 06, 2014 6:51 pm

linker3000

Joined: Mon Jun 23, 2014 9:26 pmPosts: 5

Re: Multifunction shield for Arduino Uno (HCARDU0085)

I FRIED YOUR BOARD!!!

Well, not actually!

We have an industrial oven at work that's used to heat test consumer electronics for failure analysis and development testing. The oven was in use the other day so I took the opportunity to pop in a Uno plus the multifunction shield fitted with a DS18B20 temperature sensor, and running the code I recently posted. You can dial up any temperature you want and the oven will oblige to within 1C. I took the board up to 40C and then down by a few steps, leaving everything to settle for 10 mins before taking readings - here's a picture and the results:

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum