In earlier article we have seen the software creation using pure Simulink with out using any Stateflow for reading and displaying the potentiometer value. In this article we will explore the software deployment, circuit diagram and demo.
Schematic for reading potentiometer value using Arduino
Potentiometer wiper is connected to the Arduino analog pin 2, 5V power and ground is supplied from Arduino. Three LED's are connected to the Arduino digital pin 3,4 and 5 to display the potentiometer reading in binary format. When the processed analog value is 1 only first LED will be turned on and rest all LED's are turned off. So these three LED's represent the three bits of the binary number.
Software deployment to Arduino from Simulink
Following video presents the steps required to prepare the Simulink
model for code generation for the Arduino board. The steps for the code
generation are same as the steps explained in this article
Demo for Potentiometer value reading using Arduino
As you can see in the demo video the potentiometer value is read by the Arduino using the analog pin 2 and then process it and displayed the mapped value using three white LED's.
I hope you enjoyed the article and we will catch up in our next article where we will discuss the traffic lights simulation for four junction signals.
No comments:
Post a Comment