Project 2.2. Persistence of Vision. (Reference: AVR Foundations: pp.35-38). It's strange to think that our eyes perceive much of the LED lighting around us to be uniformly ON, when they are actually OFF as much as half the time (maybe this is one of the reasons LED lighting is so cost-effective?). The next time you're in the DES, point your phone's camera at the digital clock and observe the interference bands generated by clock's display alternation and your camera's periodic scan rate.
Perhaps the most remarkable ACES PoV creation was engineered by K. Fiset-Algarvio (ACES '19, Guelph Mech. '23) in his amazing Grade 11 ISP: The Persistence of Vision Globe. Above are two images extracted from his DER. Be sure to watch his detailed video.
You have two 14-Segment Dual CC Alphanumeric Displays in your kit. An image of the device appears below, left, in which I have coloured a few segments to simulate a 'possible' depiction of the two-letter word AS. Here's the link to its datasheet so you can familiarize yourself with its pin layout. Given its 14 segments, this component can be driven by two SN74HC595 shift registers* and a pair of transistors (one NPN and one PNP) under control of a SINGLE square wave (bottom, right), in a Persistence of Vision scheme.
*Although the ATmega328p has enough pins to complete this task without using shift registers, you are required to do so, for practice.
BASIC Task. (Adapted for 2020-2021)
- This project requires you to combine a number of recent hardware and software techniques introduced in class to produce an alphabetic PoV display of letters entered by your users through the Serial Monitor's input text box. In particular, you will employ only TWO Shift Registers and the square wave alternation circuit above, to affect a Persistence of Vision strategy on your dual display device.
- Be sure to have available a complete 26-element array of type uint16_t that defines the segment maps for each uppercase letters from A to Z. The organization of the segments will have to match your wiring to the segments to be effective. These array definitions are typically called Lookup Tables or, simply, LUTs.
- Create the Arduino project, PoVWord.
- Within the project sketch of the same name, develop code that will call upon your LuT to echo the two-letter input from the user on your dual 14-segment display device.
- You do not need to implement the decimal point unless warranted.
- You can assume users enter two letters only, however your code must be prepared to change a lowercase entry to uppercase prior to its display.
- Be sure to FULLY document your (efficient and original as possible) code and attach POVWord.ino to your submission as the second attachment, along with your DER.docx file.
For the ambitious, consider the following any or all of the following. If you implement any enhancement add a section on you DER entitled Enhancement and document your creative extension(s).
- You have TWO of these dual displays...Hmmm....double the fun?
- Software comfortable ACES may wish to dive deeper into the Arduino String library in support of allowing users to enter more than two characters and have them scroll across your display.
- Fans of the Periodic Table fans may wish to create a LuT with each elements' 2-letter symbol (a space is a character) and allow users to enter the number of the element (echoed on two 7-segment displays). Your code would present the elements' symbol on the dual 14-segment display.
- There are many more ASCII characters than the uppercase letters. Consider, for example, enlarging your LuT to include the additional lowercase characters. Note: the ASCII Table inserts 6 characters between the uppercase letters [65,90] and the lowercase letters [97,122].
- Use Write14SegASCIIEEPROMKWA-541XPGB.ino code to populate EEPROM as a means to eliminating the need to define your LuT every time in your application code. Be sure to include this additional EEPROM code in your DER and attach it to your email.
- Lots of other ideas for the imaginative....
Advice (trust Mr. D's experience)
- This is a CHALLENGING project. Do NOT doubt yourself, you are all talented enough to complete it. Success follows those who simply devise a SMART plan and have the DISCIPLINE to execute it.
- If you are thinking about engineering, get used to hard work. A number of your Grade 10 peers have already fallen by the wayside because they feared the workload. More students will end up transferring out of engineering in university because they are not prepared to engage the demands. The GOOD news is that once you get used to the workload, like anything else, it doesn't seem so bad, and feels easier.
- You'll have far less trouble with this project if BREAK THE PROJECT DOWN INTO SMALL STEPS as you go.
- After reading the project description a few times and digesting as much content from the links as possible, CLOSE YOUR LAPTOP AND TOOLKIT, grab a pencil and paper and proceed to write down as many required steps as you can think of, in the correct order.
- Once you've done that. I encourage you to start SMALL and master the little things. For example, on the software side, develop test code to write and read 8 and 16 bit data to and from EEPROM. On the hardware side, wire up a SINGLE shift register and a SINGLE NPN transistor and write some TEST CODE to see if you can, reliably and predictably, light just 8 segments on a SINGLE digit. Again write LOTS of test code sketches as you go. Only after the first test was successful will you add a SECOND shift register and add a little more code to see if you can get 14 segments on the SINGLE digit to accurately present a letter.
- When writing software be wary of external processes taking time. These include, reading from and writing to the Serial Monitor, reading from and writing to the EEPROM, and analogRead functions using the ADC. Adding small delays , even 1 μs, can help and does not slow your performance down noticeably.
- You may wish to write a separate sketch for simply populating EEPROM with your letter segment maps. This could be useful in future projects. If you do, be sure to include this in your Report.
- Wire in the PNP transistor and change one line of your test code to have the same letter appear on the OTHER digit display. You get the idea...
- JUST LIKE SOLDERING, if you try to bang the ENTIRE project together without testing the individual stages along the way, your prototype will NOT work, you'll get depressed, will not finish the project on your own, wonder why you ever took this course, and question whether you have what it takes to be an engineer. All because you simply did not follow a careful step-by-step, stress-free strategy.
- BE SMART ON THIS PROJECT. You'll teach yourself a VALUABLE lesson and skill that you will use again and again, over the entire course of your life!
- Trust Mr. D.
For many of you, next to your Secondary School Graduation Diploma, your DER will be your most important high school document as the two of them may very well open the doors to your careers.
Take great pride in your craftsmanship of this work.
First, make the following edits to your DER,
- Add ICS3U to your title page after ICS2O, separated by a comma of course. Next year you can add ICS4U :)
- Insert a Next Page Section Break at the end of your Grade 10 ICS2O reports
- In the middle of the (divider) page type ICS3U, in large font, centered on the page. Suspend the display of the header and footer on this divider page (Hint: Section Breaks).
- Insert another Page Break.
- Adjust the new header to reflect the ICS3U course code, but continue the page numbering in the footer.
- Begin this year's submissions with a report entitled, Project 2.1. Traffic Light.
- Be sure to update your ToC prior to submission.
Project 2.1. Traffic Light. Since many of you will be pursuing your driver's license in the near future, the focus of this first project is the careful soldering and QUALITY programming of a standard traffic light. When Jasper Schaffer (Fraser's older brother) (ACES '18, Queen's '22) was in his ICS3U year, he designed the handy little PCB pictured to the right that we'll exploit to start our year off. For the assembly aspect of this project you will solder one each of a green, yellow, and red 10mm LED and a four-pin right-angle header from your toolkit onto the Schaffer Traffic Light PCB you have been provided with. Take care as there are NO replacement parts. The right-angled male header pins allow your device to be inserted directly into adjacent female port pins on your Arduino (eliminating the need to use a breadboard and hookup wires). Be sure to document your soldering of the device through video acquisition that you can include in your report. For the testing aspect, you will include media as well as a well-planned sketch modified but based on our discussions and models in class. The fully documented sketch should cycle through the LEDs continuously with the green and red remaining on for four times the duration of the yellow (amber) LED.
In your Report, you are include the Purpose, Reference, Procedure, Code, Media, and Reflection subsections in Heading 2 style. A full Parts Table, with background shading consistent with your previous ICS2O colour theme and width of 3" and should appear right-aligned within the Procedure section. Finally, ensure that no content is allowed to spill into any of the four page margins.