Embedded Systems Oriented
Assignment 3
REQUIRED EQUIPMENT
1. Arduino Uno + USB cable
2. Open Smart Rich Shield
3. Laptop PC + Arduino IDE + Rich Shield library
INTRODUCTION
ASSIGNMENT 3 – THE CAR SYSTEM
Version: 2021vj
Electric Cars & Co is an electric car manufacturer. Their new model needs a smart steering wheel and a touch screen in the dashboard. A prototype system has to be developer. In the image above you see the system consisting of two subsystems: (1) the steering wheel has three LED lights, two buttons, temperature sensor, light sensor and a potentiometer, and (2) the touch screen has a hazard warning button, two text fields and a list box. The steering wheel embeds an Arduino and a Rich shield, whereas the touch screen is a laptop with a Windows app. Both subsystems communicate with each other using a serial connection. You are tasked to create a proof of concept that demonstrates the system according to the description below.
DESCRIPTION
The two subsystems, the modes of operations and the communication are described in this section.
Modes of operations
The car can be in one of two modes at any given time, namely the normal mode or hazard mode. The user can toggle between normal mode and hazard mode by pressing a hazard button on the screen.
Subsystem 1: The Steering Wheel (Arduino)
This application is a C program on the Arduino with the Rich shield. The potentiometer simulates the steer- ing wheel. You can use the full scale of the potentiometer.
In normal mode, the two buttons are used to indicate in which direction the user want to turns. The left but- ton lets the yellow LED blink until the user steers from the left to the centre (or a small percentage in the right half). The right button lets the blue LED blink until the user steers from the right to the centre (or a
1/2
Embedded Systems Oriented Assignment 3
small percentage in the left half). This behaves like a real car. Be aware that the yellow and blue LEDs never blink at the same time in normal mode.
In the hazard mode, the turning lights (yellow and blue) and the red LED blink at the same time. They blink at the interval of 1 second. The buttons and potentiometer still operate, i.e. they still alter the state but they do not affect the LEDs. When the user switches back to the normal mode then the state is depicted by the LEDs.
The headlights are automatic and they turn on when it’s dark, otherwise they’re off. The green LED simulates the headlights. The headlights may never flash due to a cloud or shadow. The steering wheel measures the temperature inside the car at all times every 5 seconds.
Subsystem 2: The touch screen (laptop)
This application is a C# program controller with a touch screen or
you use the mouse if you have no touch screen on your laptop. The
user can toggle between the normal mode and hazard mode by
pressing the hazard warning (ALARM) button. The hazard mode
warns road users that there is a problem, e.g. a traffic jam ahead or
car problems. The text fields show the temperature and headlight status. The list box is used to collect activi- ties and acts as a black box of the car. You must determine what information is important to be collected.
Communication between both sub-systems (Arduinolaptop)
The steering wheel and touch screen communicate via the USB connection. Both subsystems exchange mes- sages. The button status is send from the laptop to the Arduino. The temperature and the headlight status are send from the Arduino to the laptop. The temperature is sent once per 5 seconds and the headlight sta- tus is sent on the change event. Also log info is send from the Arduino to the laptop, only when necessary.
Before you start programming, please, identify the messages, define the rules and describe the activities they invoke. Design the protocol of interactions between the two subsystems.
CRITERIA
After hand-in you will be given a formative indication and feedback of your work according to the following criteria:
The car system is expected to work according to the requirements.
Make use of debouncing and edge sensitive button handling.
Make use of sequence state patterns. Don’t forget the ‘else’!
Design the protocol of interaction.
The code must be well-structured with appropriate names, according to the C naming convention and variables must be in the right scope.
All three buttons must be working responsive at any time.
Code must be well commented and maintainable.
Communication between laptop and Arduino must work correctly.
2/2