‏إظهار الرسائل ذات التسميات ARDUINO. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات ARDUINO. إظهار كافة الرسائل

الثلاثاء، 19 يناير 2016

Best 4 books in the world of Arduino

Best 4 books in the world of Arduino

-1-

Practical Arduino Cool Projects for Open Source Hardware

https://drive.google.com/open?id=0B1HQ0B8hfRtBY2MtTmJEa3hsM3M&authuser=0

-2-

All about Arduino Simulation

https://drive.google.com/open?id=0B1HQ0B8hfRtBUUJybmVTRmJtZ0k&authuser=0

-3-

Arduino Workshop A Hands-On Introduction with 65 Projects

https://drive.google.com/open?id=0B1HQ0B8hfRtBY2p5YmdKR2dEbDQ&authuser=0

-4-

Make Basic Arduino Project

Feb 2014
https://drive.google.com/open?id=0B1HQ0B8hfRtBME1LNkZXel81aTA&authuser=0

30 Arduino Projects for the Evil Genius


الثلاثاء، 8 ديسمبر 2015

Multiple Shift-out Registers on Arduino – part 2



Arduino daisy chain 7 segment leds

In this second article we will see a practical application of the daisy-chained shift registers.

We want to use four 7-Segments LEDs controlled by the Arduino board. As you can imagine, that is impossible without a series of shift-registers as we need 32 output pins. As we can do in many other applications of the daisy-chained shift registers, in this case we don’t need a specific software or library: it is sufficient what we already know about the shift registers.

As in the previous article I wrote that the board is a general purpose tool, this is one of the hundreds possible applications that only need hardware. The only thing we must know is how the 7-segments LED devices work.

The 7-segments LED devices

The general principle behind this kind of devices is the same that makes the common LEDs working. To get a LED lighting we should connect its ground pin to the circuit GND and the positive pin to an output pin on the microcontroller. Everytime the microcontroller pin goes high the LED is powered.

led resistor circuit

It’s important to know that there are two different types of 7-segments LED displays: common cathode and common anode. As shown in the scheme below the common cathode display shares the GND signal while the common anode display shares the VCC signal.

7-segment2

By the point of view of the circuit schematics there are no particular differences and we have adopted common anode devices because of some advantages compared to the opposite common cathode.

Schematics[2]

The only different thing is our sketch; We should consider that with this kind of configuration a certain LED segment will light when the corresponding digital pin of the shift register is set to LOW and vice-versa.

Display-7Seg 11

As the 7-segments display components have eight independent LEDs (seven for the bars and one extra for the point), every segment corresponds to one of the 8 signals/pins of the corresponding shift register so the four display board consumes four shift registers.

Why the choice of the Common Anode Display

The board has a set of connectors showing 33 pins: four sets of eight pins plus the common pin connected to the anodes of the four devices. This 33th pin can be connected to the shift register board – explained in the previous article – that shares the VCC signal on its connectors: simply connect one-to-one the two boards and it will work.

Display-7Seg 9

But what happens when you connect the VCC common anode of the board to one of the free digital pins of the Arduino? Setting the common anode digital pin to HIGH, we power on the entire display board while setting it to LOW the display board will not work. One more suggestion: if we use an Arduino PWM pin as the common anode pin, we can power on/off the display and change its brightness.

What if using Common Cathode Display

If we put in the sockets four 7-segments LED common cathode LCD display devices, we should connect the pin 33 of the board (the common pin) to the Arduino GND signal. At this point, all works fine again, the only difference being that every display LED segment is enabled when the corresponding shift register signal is ON and is disabled when the signal is OFF.

PCB-Botttom

7-segments Display mapping

As every segment is associated to one of the corresponding bits (with an extra eight bit for the separator point) there are 128 different statuses of the devices. With the board and the daisy-chained shift register we can set any of these configurations but the most common are the characters 0-9 and A-F. For more information on how the 7-segments LED displays work, read this almost exhaustive description on wikipedia.

7-segment-map

Sketches suggestions and samples

What now? There are many helpful suggestions to manage the board in your Arduino sketches. The ideal hardware configuration will be the four daisy-chained shift registers described in the first part of this article and the 7-segments board discussed above.

Don’t forget to try using an Arduino digital pin instead of the VCC pin to control the common anode signal of the LEDs.

  1. #include <ShiftOutX.h>
  2. #include <ShiftPinNo.h>
  3.  
  4. // Digital pins connected to 74HC595
  5. int latchPin = 2; // pin 12 on the 74hc595
  6. int dataPin = 3; // pin 14 on the 74hc595
  7. int clockPin = 4; // pin 11 on the 74hc595
  8.  
  9. // Digital pin to enable/disable the display common Anode
  10. int vccControlPin = 7;
  11.  
  12. //shiftOutX(_latchPin, _dataPin, _clockPin, _bitOrder, _NofRegisters);
  13. shiftOutX shiftDisplay(latchPin, dataPin, clockPin, MSBFIRST, 4);
  14.  
  15. void setup() {
  16. // Set the ShiftRegister PINs
  17. pinMode(latchPin, OUTPUT);
  18. pinMode(clockPin, OUTPUT);
  19. pinMode(dataPin, OUTPUT);
  20.  
  21. // Set the common Anode control pin
  22. pinMode(vccControlPin, OUTPUT);
  23. // Disable (power off) the display disabling the common Anode pin
  24. digitalWrite(vccControlPin, LOW);
  25. // Initialize the serial (for testing purposes)
  26. Serial.begin(9600);
  27. // Startup message
  28. Serial.println("/*** Display 7 Segments Test Started ***/");
  29.  
  30. }
  31.  
  32. void loop() {
  33. // Enable the display
  34. digitalWrite(vccControlPin, HIGH);
  35. Serial.println("- Display on");
  36. delay(2000); // wait 2 sec
  37.  
  38. shiftDisplay.allOn();
  39. Serial.println("- shiftDisplay.allOn()");
  40. delay(2000); // wait 2 sec
  41. shiftDisplay.allOff();
  42. Serial.println("- shiftDisplay.allOff()");
  43. delay(2000); // wait 2 sec
  44. // Disable (power off) the display disabling the common Anode pin
  45. digitalWrite(vccControlPin, LOW);
  46. Serial.println("- Display Off");
  47. delay(2000); // wait 2 sec
  48. }

You can find a pre-assembled daisy-chained four shift registers board or the PCB only at BalearicDynamics. Don’t forget to use the discount code ELEKTRO1008 to get 20% off discount, the special price for Electroschematics.com users.

الأحد، 6 ديسمبر 2015

Arduino Linear Thermistor Experiment

Thermistor is a semiconductor device made of materials whose resistance varies as a function of temperature. A thermistor can be used to compensate for temperature variation in other components of an electronic circuit.
Here is an Arduino experiment with a famed linear active thermistor chip MCP9700A from Microchip Technology Inc. The chip comprises an analog temperature sensor that converts temperature to analog voltage. Unlike resistive sensors, this linear active thermistor chip does not require an additional signal- conditioning circuit. Therefore, the biasing circuit development overhead for thermistor solutions can be nullified by implementing this low-cost IC. Further, the voltage output (VOUT) pin can be directly connected to the ADC input of a microcontroller.

pin annotation of the linear active thermistor chip
(pin annotation of the linear active thermistor chip)
Although the 3-pin SOT-23 package of MCP9700A is very popular, the experiment was conducted with an MCP9700A in 5-pin SC70 package, purchased from an online store (RhydoLabz). The chip soldered on the SC70 – DIP adapter was linked to an Arduino UNO (R3) as shown below.
connection diagram of the linear active thermistor
(connection diagram of the linear active thermistor)
Next important hardware is a standard 16×2 LCD unit. The experiment was conducted with an Arduino compatible LCD shield, circuit diagram of the relevant section is shown below.
partial circuit diagram of the lcd shield
(partial circuit diagram of the lcd shield)
The shield consists of a 1602 white character blue backlight LCD, and a keypad consists of 5 keys (select, up, down, right, and left). To save the digital I/O pins, the keypad interface uses only one ADC channel (A0) for reading the key values through a 5-stage resistive-voltage divider.
table
real view of the lcd keypad shield
(real view of the lcd keypad shield)
Now it is clear, a MCP9700A temperature sensor connected to the Arduino analog input pin A1 is used to measure temperature. The Arduino sketch for the experiment handles the inputted data and displays the current temperature on the display panel. That’s all!
/*‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Project: Arduino Temperature Monitor
Description: Realized using the simple MCP9700A linear thermistor
connected to pin A1 of the Arduino Uno (R3). The system converts
the output voltage from MCP9700A to a temperature value
and displays it on a 16x2 LCD
Tested at: TechNode PROTOLABZ
Date: November 2015
Author: T.K.Hareendran (with great respect for the inspirations of other designers/coders)
Exclusive for: http://www.electroschematics.com
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐*/
#include <LiquidCrystal.h>
// Arduino pins used for LCD
LiquidCrystal lcd(8, 9,4, 5, 6, 7);
void setup() {
   // initialize the LCD display
   lcd.begin(16, 2);
}
void loop() {
   float temperature = 0.0; // stores the calculated reading
   int sample; // counts through ADC samples
   float ten_samples = 0.0; // stores sum of 10 samples
   // take 10 samples from the MCP9700 sensor
   for (sample = 0; sample &lt; 10; sample++) {
      // convert A1 value to temperature
      temperature = ((float)analogRead(A1) * 5.0 / 1024.0) ‐ 0.5; // 500mV offset corrected – see datasheet of MCP9700
      temperature = temperature / 0.01;
      // sample every 10ms
      delay(100);
      // sum of all samples
      ten_samples = ten_samples + temperature;
   }
   // get the average value of 10 samples
   temperature = ten_samples / 10.0;
   // display the temperature on the LCD
   lcd.setCursor(0, 0);
   lcd.print(temperature);
   lcd.print(" deg. C ");
   ten_samples = 0.0;
}
author’s prototype of the experiment
(author’s prototype of the experiment)
Notes
  • Overall stability of the system can be increased by adding two 100nF capacitors very close to the MCP9700A chip as indicated in the following diagram. This stabilises the power input, and the signal output from MCP9700A
  • The 6 μA (typical) low operating current of the MCP9700A makes it ideal for battery-powered applications. However, for applications that require a tighter current budget, this device can be powered from one Input/ Output (I/O) pin of the Arduino microcontroller. The I/O pin can be toggled to shut down the device
ALT-6

Twitter Delicious Facebook Digg Stumbleupon Favorites More