The alarm will attempt to be done with the cycle at the appropriate time set, so it will start with the UV LEDs and move through the progression fading the LEDs in and out as indicated in the arrays at the top of the program.
Posted by Jayesh Yewale
Posted on 10:48:00 AM
with No comments
World’s smallest Bluetooth location ‘stickers’ using Nordic Semiconductor SoCs
Nordic Semiconductor announced earlier that its SoC series nRF51822 has been specified into the world’s smallest Bluetooth low energy coin-sized location stickers, ‘StickNFind’ by Stick-N-Find Technologies. Using a free smartphone app, users can locate their stickers using a ‘radar screen’, set distance alerts called ‘virtual leash’, and do much more.
A system on a chip or system on chip is an integrated circuit that integrates all components of a computer or other electronic system into a single chip. It may contain digital, analog, mixed-signal, and often radio-frequency functions all of which would exist on a single chip substrate. A system-on-chip blurs the lines between chip design and system design.
World’s smallest Bluetooth location ‘stickers’ Ultra low power (ULP) RF specialist Nordic Semiconductor ASA announced earlier that its SoC series nRF51822 has been specified into the world’s smallest Bluetooth low energy coin-sized location stickers, ‘StickNFind’ by Stick-N-Find Technologies. StickNFinds are the size of a U.S. quarter at just 0.98-inch (24mm) in diameter and 0.16-inch (4mm) thick. Users can easily track up to twenty location stickers on a smartphone app. They can be used to track keys, remote controls, pets, and even people. Using a free smartphone app, users can locate their stickers using a ‘radar screen’, set distance alerts called ‘virtual leash’, and do much more.
StickNFind is offering developers a free software development kit (SDK) and technical support with its stickers already being developed for use in a wide range of applications including automated inventory tracking and monitoring within shops, stores, and shipping crates, plus security tracking of high value items such as precious stones and expensive tools or equipment.
The Nordic Semiconductor nRF51822 The Nordic Semiconductor nRF51822 is a multi-protocol Bluetooth low energy / 2.4GHz proprietary RF Flash-based SoC that is designed specifically to be used as a single-chip solution for a range of Bluetooth low energy and 2.4GHz proprietary designs in cost, power, and size constrained applications including PC peripherals, connected TV remote controls, sports/fitness/healthcare sensors, toys, and automation.
Key features of the IC include: It has a 256 kB on-chip Flash and 16 kB RAM with a wide range of digital and mixed signal peripherals including SPI, 2-wire, ADC, and a quadrature decoder. The IC comes with 16 PPI channels, an on-chip LDO and an On-chip drop down DC/DC converter for 3V batteries such as coin cells. A +/- 250 ppm 32kHZ RC oscillator enables the implementation of Bluetooth low energy applications without an external 32kHz crystal thus saving cost and board space along with a 6x6mm 48-pin QFN package with up to 32 GPIOs.
The S110 Bluetooth low energy stack The S110 Bluetooth low energy stack for the nRF51822 is provided as a downloadable, royalty-free, pre-compiled binary that can be programmed and updated separately.
The Key features of the stack include: It has an asynchronous and event driven SVC-based API with run-time protection, GATT, GAP and L2CAP level APIs, peripheral and broadcaster roles and GATT client and server. It operates with a non-concurrent multi-protocol operation with a 2.4 GHz RF proprietary protocols while requiring less than 128 kB code space and 6 kB of RAM, leaving more that 128 kB flash and 10 kB RAM for application code. When compared to two-chip implementations using Nordic’s previous generation nRF8001 the nRF51822, running the S110 stack slashes power consumption by up to 50 per cent.
The S110 stack and the nRF51822 are complemented by the nRF518 SDK that includes a comprehensive set of Bluetooth low energy profiles, services, and example applications. For proprietary applications, the nRF51822 is complemented by a new and improved Gazell 2.4GHz RF protocol stack providing interoperability with nRF24L Series Gazell-based applications. The combination of the nRF51822 and the new Gazell protocol stack slashes power consumption by up to 30 per cent compared to Nordic’s previous generation nRF24LE1
Posted by Jayesh Yewale
Posted on 8:23:00 PM
with No comments
I Have My BE Final Year Project In Electronics and Telecommunications Engineering Named "MultiPurpose Robot For Shopping Mall" Which Includes "Camera For Video Surveillance + Fire FIghting + Robotic Arm For Pick And Place Purpose + Floor Cleaning"
Posted by Jayesh Yewale
Posted on 10:30:00 PM
with No comments
While looking for ideas for new some new project I noticed there aren’t many lists of Arduino projects online so I decided to make one and in the last few days I’ve been carefully digging Reddit (r/Arduino) and the Arduino forum until I ended up with a list of 20 Arduino projects.
All the projects in this list follow two simple criteria:
They’ve been published/released in 2012.
They provide quite detailed info (the more the better).
The second criteria forced me to discard some amazing projects, but I didn’t want this post to be a simple showcase of cool Arduino projects, I wanted it to be an useful reference for Arduino users.
20. arduino-l3dgecomm
This project aims to integrate a 3D world with real sensors and motors, more a proof of concept than a proper project, but still an interesting idea. Project page.
19. Charlieplexed ATTiny LED Christmas Ornament
A custom PCB designed in the shape of a Christmas tree, an Atmel ATTiny45 microcontroller, 5 IO pins, and 20 LEDs make a perfect Christmas ornament. Project page.
18. Sound Alarm
A simple idea, but it comes with quite few interesting features. The device built in this project is a sound level detector which sets off an “alarm” via IR when it detects the sound level is to high for too long. Project page.
17. Sleepy Timer
SleepyTimer is an Arduino-based sleep monitor which uses a 3-axis IMU to infer nightly sleep patterns. It graphs the results on an LCD and on a thermal-transfer printer.Project page.
16. Polar Plotter
A polar plotter is a plotter with a rotating, extendable arm. The construction is powered by an Arduino Uno and Maker Beams. Project page.
15. Lite Brite LED clock
An instructable that shows you how to make a Lite Brite clock using a Lite Brite, an Arduino, 46 LED’s and a few other miscellaneous parts. Project page.
14. Game Controller
A game controller powered by a Teensy microcontroller. No project page, but a photo gallery and the source code are available.
13. MP3 Player
Mix an Arduino Mega, an MP3 decoder, an SD card, and a nokia LCD with thousand lines of code and you’ll get a working MP3 player. Project overview.
12. Recognizing token image with camera
Devices built using LEGO always have something special… this one uses an Arduino Nano and an old webcam to recognize digits from a security code. Project page.
11. Reddit message indicator
This project could be useful to all the Reddit users, it’s a small desk notifier that lights up when your Reddit account receives a message. Project page.
10. PIP-Boy
A PIP-Boy is a device used by the protagonist in the popular Fallout series of video games for navigation, radiation detection, data storage/playback, and inventory management. This instructable explains how to make one. Project page.
9. WiiChuck steered laser pointer
This project uses a Wii Nunchuck to control a laser pointer moved by 2 mini servos. Project page.
8. RCArduino Yaw Control
The aim of this project is to make race RC cars more stable and easy to drive especially for beginner drivers. Project pages 1 and 2.
Last summer a black hat called Cody Brocious (aka Daeken) managed to gain access to 4 million hotel rooms with Arduino board. Probably not an usual project, but it definitely deserved a place in this list! Paper and PDF slides available online.
5. Hidden light control
Controlling a LED strip with an action figure of Ezio Auditore (Assassin Creed) is pretty cool, isn’t it? Project page.
4. ExpeditInvaders
A simple bookshelf can be strongly enhanced by some LED modules controlled by an Arduino board. Project page.
3. Pumpktris
The perfect project for Halloween: combining a pumpkin with the classic video game Tetris!Project page.
2. The Inebriator
An Arduino powered cocktail machine, with plenty of cocktails to choose from. Project website.
1. Pinokio
Pinokio is not just a lamp, it’s a beautiful animatronic powered by Arduino, Processing and OpenCV, which is aware of the environment around and expresses different behaviours in an incredibly natural way. Project log and in-action video.
Bonus project of 2012: Arduino cake
A lucky guy got this from his mum on his 18th birthday, unfortunately no schematic or sketch code are available, but you can check his forum post and maybe ask him for the recipe.
And that’s all for this list of 20 Arduino projects of 2012!
What’s your favourite one? Can you suggest any other awesome project? Just leave a comment below
Posted by Jayesh Yewale
Posted on 10:10:00 PM
with 1 comment
Circuit
Description
The digital lock shown below uses 4 common logic ICs to allow controlling a relay by entering a 4 digit number on a keypad. The first 4 outputs from the CD4017 decade counter (pins 3,2,4,7) are gated together with 4 digits from a keypad so that as the keys are depressed in the correct order, the counter will advance. As each correct key is pressed, a low level appears at the output of the dual NAND gate producing a high level at the output of the 8 input NAND at pin 13. The momentary high level from pin 13 activates a one shot circuit which applies an approximate 80 millisecond positive going pulse to the clock line (pin 14) of the decade counter which advances it one count on the rising edge. A second monostable, one shot circuit is used to generate an approximate 40 millisecond positive going pulse which is applied to the common point of the keypad so that the appropriate NAND gate will see two logic high levels when the correct key is pressed (one from the counter and the other from the key). The inverted clock pulse (negative going) at pin 12 of the 74C14 and the positive going keypad pulse at pin 6 are gated together using two diodes as an AND gate (shown in lower right corner). The output at the junction of the diodes will be positive in the event a wrong key is pressed and will reset the counter. When a correct key is pressed, outputs will be present from both monostable circuits (clock and keypad) causing the reset line to remain low and allowing the counter to advance. However, since the keypad pulse begins slightly before the clock, a 0.1uF capacitor is connected to the reset line to delay the reset until the inverted clock arrives. The values are not critical and various other timing schemes could be used but the clock signal should be slightly longer than the keypad pulse so that the clock signal can mask out the keypad and avoid resetting the counter in the event the clock pulse ends before the keypad pulse. The fifth output of the counter is on pin 10, so that after four correct key entries have been made, pin 10 will move to a high level and can be used to activate a relay, illuminate an LED, ect. At this point, the lock can be reset simply by pressing any key. The circuit can be extended with additional gates (one more CD4011) to accept up to a 8 digit code. The 4017 counting order is 3 2 4 7 10 1 5 6 9 11 so that the first 8 outputs are connected to the NAND gates and pin 9 would be used to drive the relay or light. The 4 additional NAND gate outputs would connect to the 4 remaining inputs of the CD4068 (pins 9,10,11,12). The circuit will operate from 3 to 12 volts on 4000 series CMOS but only 6 volts or less if 74HC parts are used. The circuit draws very little current (about 165 microamps) so it could be powered for several months on 4 AA batteries assuming only intermittent use of the relay.
Posted by Jayesh Yewale
Posted on 11:13:00 PM
with No comments
Image: Raygun Studio
The human eye is a perceptual powerhouse. It can see millions of colors, adjust easily to shifting light conditions, and transmit information to the brain at a rate exceeding that of a high-speed Internet connection.
But why stop there?
In the Terminator movies, Arnold Schwarzenegger’s character sees the world with data superimposed on his visual field—virtual captions that enhance the cyborg’s scan of a scene. In stories by the science fiction author Vernor Vinge, characters rely on electronic contact lenses, rather than smartphones or brain implants, for seamless access to information that appears right before their eyes.
These visions (if I may) might seem far-fetched, but a contact lens with simple built-in electronics is already within reach; in fact, my students and I are already producing such devices in small numbers in my laboratory at the University of Washington, in Seattle [see sidebar, "A Twinkle in the Eye"]. These lenses don’t give us the vision of an eagle or the benefit of running subtitles on our surroundings yet. But we have built a lens with one LED, which we’ve powered wirelessly with RF. What we’ve done so far barely hints at what will soon be possible with this technology.
Conventional contact lenses are polymers formed in specific shapes to correct faulty vision. To turn such a lens into a functional system, we integrate control circuits, communication circuits, and miniature antennas into the lens using custom-built optoelectronic components. Those components will eventually include hundreds of LEDs, which will form images in front of the eye, such as words, charts, and photographs. Much of the hardware is semitransparent so that wearers can navigate their surroundings without crashing into them or becoming disoriented. In all likelihood, a separate, portable device will relay displayable information to the lens’s control circuit, which will operate the optoelectronics in the lens.
These lenses don’t need to be very complex to be useful. Even a lens with a single pixel could aid people with impaired hearing or be incorporated as an indicator into computer games. With more colors and resolution, the repertoire could be expanded to include displaying text, translating speech into captions in real time, or offering visual cues from a navigation system. With basic image processing and Internet access, a contact-lens display could unlock whole new worlds of visual information, unfettered by the constraints of a physical display.
Besides visual enhancement, noninvasive monitoring of the wearer’s biomarkers and health indicators could be a huge future market. We’ve built several simple sensors that can detect the concentration of a molecule, such as glucose. Sensors built onto lenses would let diabetic wearers keep tabs on blood-sugar levels without needing to prick a finger. The glucose detectors we’re evaluating now are a mere glimmer of what will be possible in the next 5 to 10 years. Contact lenses are worn daily by more than a hundred million people, and they are one of the only disposable, mass-market products that remain in contact, through fluids, with the interior of the body for an extended period of time. When you get a blood test, your doctor is probably measuring many of the same biomarkers that are found in the live cells on the surface of your eye—and in concentrations that correlate closely with the levels in your bloodstream. An appropriately configured contact lens could monitor cholesterol, sodium, and potassium levels, to name a few potential targets. Coupled with a wireless data transmitter, the lens could relay information to medics or nurses instantly, without needles or laboratory chemistry, and with a much lower chance of mix-ups.
Three fundamental challenges stand in the way of building a multipurpose contact lens. First, the processes for making many of the lens’s parts and subsystems are incompatible with one another and with the fragile polymer of the lens. To get around this problem, my colleagues and I make all our devices from scratch. To fabricate the components for silicon circuits and LEDs, we use high temperatures and corrosive chemicals, which means we can’t manufacture them directly onto a lens. That leads to the second challenge, which is that all the key components of the lens need to be miniaturized and integrated onto about 1.5 square centimeters of a flexible, transparent polymer. We haven’t fully solved that problem yet, but we have so far developed our own specialized assembly process, which enables us to integrate several different kinds of components onto a lens. Last but not least, the whole contraption needs to be completely safe for the eye. Take an LED, for example. Most red LEDs are made of aluminum gallium arsenide, which is toxic. So before an LED can go into the eye, it must be enveloped in a biocompatible substance.
So far, besides our glucose monitor, we’ve been able to batch-fabricate a few other nanoscale biosensors that respond to a target molecule with an electrical signal; we’ve also made several microscale components, including single-crystal silicon transistors, radio chips, antennas, diffusion resistors, LEDs, and silicon photodetectors. We’ve constructed all the micrometer-scale metal interconnects necessary to form a circuit on a contact lens. We’ve also shown that these microcomponents can be integrated through a self-assembly process onto other unconventional substrates, such as thin, flexible transparent plastics or glass. We’ve fabricated prototype lenses with an LED, a small radio chip, and an antenna, and we’ve transmitted energy to the lens wirelessly, lighting the LED. To demonstrate that the lenses can be safe, we encapsulated them in a biocompatible polymer and successfully tested them in trials with live rabbits.
Photos: University of WashingtonSecond Sight: In recent trials, rabbits wore lenses containing metal circuit structures for 20 minutes at a time with no adverse effects.
Seeing the light—LED light—is a reasonable accomplishment. But seeing something useful through the lens is clearly the ultimate goal. Fortunately, the human eye is an extremely sensitive photodetector. At high noon on a cloudless day, lots of light streams through your pupil, and the world appears bright indeed. But the eye doesn’t need all that optical power—it can perceive images with only a few microwatts of optical power passing through its lens. An LCD computer screen is similarly wasteful. It sends out a lot of photons, but only a small fraction of them enter your eye and hit the retina to form an image. But when the display is directly over your cornea, every photon generated by the display helps form the image.
The beauty of this approach is obvious: With the light coming from a lens on your pupil rather than from an external source, you need much less power to form an image. But how to get light from a lens? We’ve considered two basic approaches. One option is to build into the lens a display based on an array of LED pixels; we call this an active display. An alternative is to use passive pixels that merely modulate incoming light rather than producing their own. Basically, they construct an image by changing their color and transparency in reaction to a light source. (They’re similar to LCDs, in which tiny liquid-crystal ”shutters” block or transmit white light through a red, green, or blue filter.) For passive pixels on a functional contact lens, the light source would be the environment. The colors wouldn’t be as precise as with a white-backlit LCD, but the images could be quite sharp and finely resolved.
We’ve mainly pursued the active approach and have produced lenses that can accommodate an 8-by-8 array of LEDs. For now, active pixels are easier to attach to lenses. But using passive pixels would significantly reduce the contact’s overall power needs—if we can figure out how to make the pixels smaller, higher in contrast, and capable of reacting quickly to external signals.
By now you’re probably wondering how a person wearing one of our contact lenses would be able to focus on an image generated on the surface of the eye. After all, a normal and healthy eye cannot focus on objects that are fewer than 10 centimeters from the corneal surface. The LEDs by themselves merely produce a fuzzy splotch of color in the wearer’s field of vision. Somehow the image must be pushed away from the cornea. One way to do that is to employ an array of even smaller lenses placed on the surface of the contact lens. Arrays of such microlenses have been used in the past to focus lasers and, in photolithography, to draw patterns of light on a photoresist. On a contact lens, each pixel or small group of pixels would be assigned to a microlens placed between the eye and the pixels. Spacing a pixel and a microlens 360 micrometers apart would be enough to push back the virtual image and let the eye focus on it easily. To the wearer, the image would seem to hang in space about half a meter away, depending on the microlens.
Another way to make sharp images is to use a scanning microlaser or an array of microlasers. Laser beams diverge much less than LED light does, so they would produce a sharper image. A kind of actuated mirror would scan the beams from a red, a green, and a blue laser to generate an image. The resolution of the image would be limited primarily by the narrowness of the beams, and the lasers would obviously have to be extremely small, which would be a substantial challenge. However, using lasers would ensure that the image is in focus at all times and eliminate the need for microlenses.
Whether we use LEDs or lasers for our display, the area available for optoelectronics on the surface of the contact is really small: roughly 1.2 millimeters in diameter. The display must also be semitransparent, so that wearers can still see their surroundings. Those are tough but not impossible requirements. The LED chips we’ve built so far are 300 µm in diameter, and the light-emitting zone on each chip is a 60-µm-wide ring with a radius of 112 µm. We’re trying to reduce that by an order of magnitude. Our goal is an array of 3600 10-µm-wide pixels spaced 10 µm apart.
One other difficulty in putting a display on the eye is keeping it from moving around relative to the pupil. Normal contact lenses that correct for astigmatism are weighted on the bottom to maintain a specific orientation, give or take a few degrees. I figure the same technique could keep a display from tilting (unless the wearer blinked too often!).
Like all mobile electronics, these lenses must be powered by suitable sources, but among the options, none are particularly attractive. The space constraints are acute. For example, batteries are hard to miniaturize to this extent, require recharging, and raise the specter of, say, lithium ions floating around in the eye after an accident. A better strategy is gathering inertial power from the environment, by converting ambient vibrations into energy or by receiving solar or RF power. Most inertial power scavenging designs have unacceptably low power output, so we have focused on powering our lenses with solar or RF energy.
Let’s assume that 1 square centimeter of lens area is dedicated to power generation, and let’s say we devote the space to solar cells. Almost 300 microwatts of incoming power would be available indoors, with potentially much more available outdoors. At a conversion efficiency of 10 percent, these figures would translate to 30 µW of available electrical power, if all the subsystems of the contact lens were run indoors.
Collecting RF energy from a source in the user’s pocket would improve the numbers slightly. In this setup, the lens area would hold antennas rather than photovoltaic cells. The antennas’ output would be limited by the field strengths permitted at various frequencies. In the microwave bands between 1.5 gigahertz and 100 GHz, the exposure level considered safe for humans is 1 milliwatt per square centimeter. For our prototypes, we have fabricated the first generation of antennas that can transmit in the 900-megahertz to 6-GHz range, and we’re working on higher-efficiency versions. So from that one square centimeter of lens real estate, we should be able to extract at least 100 µW, depending on the efficiency of the antenna and the conversion circuit.
Having made all these subsystems work, the final challenge is making them all fit on the same tiny polymer disc. Recall the pieces that we need to cram onto a lens: metal microstructures to form antennas; compound semiconductors to make optoelectronic devices; advanced complementary metal-oxide-semiconductor silicon circuits for low-power control and RF telecommunication; microelectromechanical system (MEMS) transducers and resonators to tune the frequencies of the RF communication; and surface sensors that are reactive with the biochemical environment.
The semiconductor fabrication processes we’d typically use to make most of these components won’t work because they are both thermally and chemically incompatible with the flexible polymer substrate of the contact lens. To get around this problem, we independently fabricate most of the microcomponents on silicon-on-insulator wafers, and we fabricate the LEDs and some of the biosensors on other substrates. Each part has metal interconnects and is etched into a unique shape. The end yield is a collection of powder-fine parts that we then embed in the lens.
We start by preparing the substrate that will hold the microcomponents, a 100-µm-thick slice of polyethylene terephthalate. The substrate has photolithographically defined metal interconnect lines and binding sites. These binding sites are tiny wells, about 10 µm deep, where electrical connections will be made between components and the template. At the bottom of each well is a minuscule pool of a low-melting-point alloy that will later join together two interconnects in what amounts to micrometer-scale soldering.
We then submerge the plastic lens substrate in a liquid medium and flow the collection of microcomponents over it. The binding sites are cut to match the geometries of the individual parts so that a triangular component finds a triangular well, a circular part falls into a circular well, and so on. When a piece falls into its complementary well, a small metal pad on the surface of the component comes in contact with the alloy at the bottom of the well, causing a capillary force that lodges the component in place. After all the parts have found their slots, we drop the temperature to solidify the alloy. This step locks in the mechanical and electrical contact between the components, the interconnects, and the substrate.
The next step is to ensure that all the potentially harmful components that we’ve just assembled are completely safe and comfortable to wear. The lenses we’ve been developing resemble existing gas-permeable contacts with small patches of a slightly less breathable material that wraps around the electronic components. We’ve been encapsulating the functional parts with poly(methyl methacrylate), the polymer used to make earlier generations of contact lenses. Then there’s the question of the interaction of heat and light with the eye. Not only must the system’s power consumption be very low for the sake of the energy budget, it must also avoid generating enough heat to damage the eye, so the temperature must remain below 45 °C. We have yet to investigate this concern fully, but our preliminary analyses suggest that heat shouldn’t be a big problem.
Photos: University of WashingtonIn Focus: One lens prototype [left] has several interconnects, single-crystal silicon components, and compound-semiconductor components embedded within. Another sample lens [right] contains a radio chip, an antenna, and a red LED.
All the basic technologies needed to build functional contact lenses are in place. We’ve tested our first few prototypes on animals, proving that the platform can be safe. What we need to do now is show all the subsystems working together, shrink some of the components even more, and extend the RF power harvesting to higher efficiencies and to distances greater than the few centimeters we have now. We also need to build a companion device that would do all the necessary computing or image processing to truly prove that the system can form images on demand. We’re starting with a simple product, a contact lens with a single light source, and we aim to work up to more sophisticated lenses that can superimpose computer-generated high-resolution color graphics on a user’s real field of vision.
The true promise of this research is not just the actual system we end up making, whether it’s a display, a biosensor, or both. We already see a future in which the humble contact lens becomes a real platform, like the iPhone is today, with lots of developers contributing their ideas and inventions. As far as we’re concerned, the possibilities extend as far as the eye can see, and beyond.
The author would like to thank his past and present students and collaborators, especially Brian Otis, Desney Tan, and Tueng Shen, for their contributions to this research.
About the Author
Babak A. Parviz wakes up every morning and sticks a small piece of polymer in each eye. So it was only a matter of time before this bionanotechnology expert at the University of Washington, in Seattle, imagined contact lenses with built-in circuits and LEDs. “It’s really fun to hook things up and see how they might work,” he says. In “For Your Eye Only”, Parviz previews a contact lens for the 21st century.
To Probe Further
You can find details about the fabrication process using self-assembly in “Self-Assembled Single-Crystal Silicon Circuits on Plastic,” by Sean A. Stauth and Babak A. Parviz, in Proceedings of the National Academy of Sciences, 19 September 2006.
Posted by Jayesh Yewale
Posted on 10:21:00 AM
with 4 comments
Moving-message displays are ideal to get your message (advertisements, greetings, etc) across in an eye-catching way. You can make an LCD show a brief moving message by interfacing it to a microcontroller.
Here’s an AVR-based moving-message display that uses a 16×2 LCD display incorporating HD44780. The 16×2 LCD can display 16 characters per line and there are two such lines.
Circuit description Fig. 1 shows the circuit for AVR ATmega16-based moving-message display on an LCD. It consists of an ATmega16 microcontroller, a 16×2 LCD, an SPI6 connector and a power supply section.
Fig. 1: Circuit for AVR microcontroller-based moving-message display on the LCD
To derive the power supply for the circuit, 230V AC mains is stepped down by a 9V, 250mA secondary transformer, rectified by bridge rectifier module BR1A and filtered by capacitor C1. The voltage is regulated by a 7805 regulator. LED1 glows to indicate the presence of power in the circuit. The regulated 5V DC powers the entire circuit including SPI6 connector.
Port-C pins PC4 through PC7 of the microcontroller (IC2) are connected to data lines D4 through D7 of the LCD. The LCD control lines—read/write (R/W), register-select (RS) and enable (E)—are connected to PD6, PC2 and PC3 of IC2, respectively.
Why AVR microcontroller? AVR is faster and more powerful than 8051 microcontroller, yet reasonably cheaper and in-circuit programmable. Most AVR development software are free as these are Open Source. Moreover, discussions and tutorials on the AVR family of processors are available on the Internet.
ATmega16 is a high-performance, low-power 8-bit AVR microcontroller. It has 16 kB of in-system self-programmable flash, 1 kB of internal SRAM, 512 bytes of EEPROM, 32×8 general-purpose working registers and JTAG Interface (which supports programming of flash, EEPROM, fuse and lock bits).
Some of the on-chip peripheral features are: 1. Two 8-bit timers/counters with separate pre-scaler and compare modes 2. One 16-bit timer/counter with separate pre-scaler, comparator and capture modes 3. Four pulse-width-modulation channels 4. 8-channel, 10-bit analogue-to-digital converter 5. Byte-oriented two-wire serial interface 6. Programmable serial USART 7. Master/slave serial peripheral interface 8. Programmable watchdog timer with separate on-chip oscillator
LCD display module The project uses a Hitachi HD44780-controlled LCD module. The HD44780 controller requires three control lines and four or eight input/output (I/O) lines for the data bus. The user may choose to operate the LCD with a 4-bit or 8-bit data bus. If a 4-bit data bus is used, the LCD will require a total of seven data lines—three lines for sending control signals to the LCD and four lines for the data bus. If an 8-bit data bus is used, the LCD will require a total of eleven data lines—three control lines and eight lines for the data bus.
The enable control line is used to tell the LCD that the microconroller is sending the data to it. To send data to the LCD, first make sure that the enable line is low (0). When other control lines are completely ready, make enable pin high and wait for the LCD to be ready. This time is mentioned in the datasheet and varies from LCD to LCD. To stop sending the data, bring the enable control low (0) again. Fig. 2 shows the timing diagram of LCD control lines for 4-bit data during write operation.
When the register-select line is low (0), the data is treated as a command or special instruction (such as clear screen and position cursor). When register-select is high (1), the text data being sent is displayed on the screen. For example, to display letter ‘L’ on the screen, register-select is set to high.
When the read/write control line is low, the information on the data bus is written to the LCD. When read/write is high, the program effectively queries (or reads) the LCD. This control command can be implemented using ‘C’ programming language.
For 4-bit interface data, only four bus lines (D4 through D7) are used for data transfer. Bus lines D0 through D3 are disabled. The data transfer between HD44780 and the microcontroller completes after the 4-bit data is transferred twice.
Fig. 2: Timing diagram of LCD control lines for 4-bit data during write operation
Controlling a standard numeric LCD is not that difficult. To display text on the LCD, correct library files for the LCD are needed. Many LCD libraries are available on the Internet, which are used in various applications. You may get confused which library is suitable for your application.
Libraries for LCDs found in AVRLIB library occupy unnecessary program memory space. To solve the problem, you can write your own library for LCD control.
Software program This project demonstrates sending the text to the LCD controller and scrolling it across the LCD. For the project, AVR Studio 4 and WINAVR software need to be installed in your PC. Three program codes are used here—movm.c, lcd2.c and lcd2.h. The movm.c contains the text message to be scrolled on the LCD. lcd2.c and lcd2.h are the library files. The programming technique given here may not be the best as it uses a simple logic, but it works pretty fine.
The LCD library for 4-line or 4-bit mode operation is used here. Each pin connected to the LCD can be defined separately in the lcd2.h code. The LCD and AVR port configurations in the C code along with comments are given below:
#define LCD_RS_PORT LCD_PORT LCD port for RS line #define LCD_RS_PIN 2 PORTC bit 2 for RS line #define LCD_RW_PORT PORTD Port for RW line #define LCD_RW_PIN 6 PORTD bit 6 for RW line #define LCD_E_PORT LCD_PORT LCD port for enable line #define LCD_E_PIN 3 PORTC bit 3 for enable line
Enable control line. The E control line is used to tell the LCD that the instruction for sending the data on the data bus is ready to be executed. E must always be manipulated when communicating with the LCD. That is, before interacting with the LCD, E line is always made low. The following instructions toggle enable pin to initiate write operation:
The complete subroutine of this code can be found in lcd2.c.
The E line must be left high for the time required by the LCD to get ready for receiving the data; it’s normally about 250 nanoseconds (check the datasheet for exact duration).
Busy status of the LCD. It takes some time for each instruction to be executed by the LCD. The delay varies depending on the frequency of the crystal attached to the oscillator input of the HD44780 as well as the instruction being executed.
While it is possible to write the code that waits for a specific amount of time to allow the LCD to execute instructions, this method of waiting is not very flexible. If the crystal frequency is changed, the software needs to be modified. Additionally, if the LCD itself is changed, the program might not work even if the new LCD is HD44780-compatible. The code needs to be modified accordingly.
The delay or waiting instruction can be implemented easily in C language.
In C programing, the delay is called using the delay( ) function. For instance, delay(16000) command gives a delay of 16 milliseconds.
Initialising the LCD. Before using the LCD, it must be initialised and configured. This is accomplished by sending a number of initialisation instructions to the LCD.
In WINAVR GCC programming given here, the first instruction defines the crystal frequency used in the circuit. This is followed by a standard header file for AVR device-specific I/O definitions and header file for incorporating program space string utilities. The initialisation steps in movm.c file are as follows:
#define F_CPU 16000000 #include #include #include #include “lcd2.h” #define RATE 250 Clearing the display. When the LCD is first initialised, the screen should automatically be cleared by the HD44780 controller. This helps to clear the screen of any unwanted text. Clearing the screen also ensures that the text being displayed on the LCD is the one intended for display. An LCD command exists in ‘Assembly’ to accomplish this function of clearing the screen. Not surprisingly, the AVR GCC function is flexible and easy to implement. Refer the code given below: lcd_init(LCD_DISP_ON); lcd_clrscr(); Here the first line is for LCD initialisation (turn on the LCD) with cursor ‘off.’ The second line clears the display routine to clear the LCD screen. Writing text to the LCD. To write text to the LCD, the desired text is put in the memory using the char string[ ] function as follows: char string[] PROGMEM=”WECOME TO ELECTRONICS FOR YOU – NEW DELHI”; The program makes this text scroll on the first line and then the second line of the LCD. The speed of scrolling the text on the LCD screen is defined by “# define RATE 250” in the beginning of the movm.c code. To start with, first the LCD screen is cleared and then the location of the first character to appear on the screen is defined. Getting the text from the program memory and then scrolling it on the LCD screen continuously is achieved using the following code: while(j<=(len-1)) { lcd_clrscr(); lcd_gotoxy(0,0); for(k=0,i=j;(k<16) && ( pgm_ read_byte(&string[i])!=’\0’ );k++,i++) { lcd_putc(pgm_read_ byte(&string[i])); } WaitMs(RATE); j++; } Compiling and programming. Compiling the movm.c to generate the movm.hex code is simple. Open AVR Studio4 from the desktop and select new project from ‘Project’ menu option. Select AVR GCC option and enter the project name. Next, select ‘AVR Simulator’ and click ‘Ok’ button. First, copy the three codes (movm.c, lcd2.c and lcd2.h) to your computer. Import the movm.c and lcd2.c files into ‘Source Files’ option on the left side of the screen. Next, import the lcd2.h file into ‘Header Files’ option. Select the device as ATmega16 and tick the box against ‘Create Hex’ option in the project configuration window. Now click ‘Rebuild All’ option in ‘Build’ menu. If the code is compiled without error, the movm.hex code is generated automatically under ‘Default’ folder of the project folder.
To burn the hex code into ATmega16, any standard programmer supporting ATmega16 device can be used. There are four different AVR programming modes: 1. In-system programming (ISP) 2. High-voltage programming 3. Joint test action group (JTAG) programming 4. Program and debug interface programming Here two options for burning the hex code in standard ISP mode are explained. Some AVR tools that support ISP programming include STK600, STK500, AVRISP mkII, JTAGICE mkII and AVR Dragon. There are also many other AVR programming tools available in the market. PonyProg2000 software. This software along with programmer circuit is available from www.lancos.com/prog.html website. After installing PonyProg2000, select the device family as AVR Micro and device type as ATmega16. Now in ‘Setup’ menu, select ‘SI Prog’ I/O option for serial programmer and COM port from ‘Interface Setup’ option. In ‘Security and Configuration Bits’ option, configure the bits as shown in Fig. 3. Next, open the device file (hex code) and click ‘Write All’ option to burn the chip. Frontline TopView software. This software along with programmer board is available from www.frontline-electronics.com website. After installing the software, select COM port from ‘Settings’ menu. In ‘Device’ menu, select the device as ATmega16. Burn the hex code into the chip by clicking ‘Program’ option. Note that the microcontroller uses a 16MHz externally generated clock. Program the fuse bits in the software by selecting upper and lower bytes as follows: Fuse low byte = EF Fuse high byte = C9 If the fuse bits are not configured properly, the text will scroll slowly or text scrolling may not function properly even if the scrolling rate in the code is changed. The SPI6 connector allows you to program the AVR using SPI adaptor in ISP mode.
Fig. 3: Screenshot of configuration and security bits option
Fig. 4: An actual-size, single-side PCB for the moving-message display on an LCD using AVR microcontroller
Construction and testing An actual-size, single-side PCB for the moving-message display using AVR is shown in Fig. 4 and its component layout in Fig. 5. Before mounting the AVR onto the PCB, ensure proper power supply to the circuit. Program the AVR as mentioned above, insert it into the PCB and power-‘on’ the circuit. The text will scroll from right to left in the first line and then in the second line of the LCD, repeatedly. If there is any problem in the display, press reset switch S1 momentarily. If there is no message display at all, vary the contrast-control preset (VR1) until the text is visible on the LCD.