Internships/ProjectIdeas/ArduinoVisualisation: Difference between revisions

From QEMU
(Start 'Interaction with virtual sensors using the Arduino board'.)
 
Line 1: Line 1:
=== Interaction with virtual sensors using the Arduino board ===
=== Interaction with virtual sensors using the Arduino board ===
   
   
'''Summary:''' The project will add a visual representation of an Arduino board. By running the code on the emulated AVR processor, the virtual board is updated and displays the changes. Interracting with the code via external events (sensors) triggers changes on the UI.
'''Summary:''' The project will add a visual representation of an Arduino board. By running the code on the emulated AVR processor, the virtual board is updated and displays the changes. Interracting with the code via external events (sensors) triggers changes on the UI.
   
   
'''Goal:''' Be able to use a visual virtual Arduino board, and program it with the Arduino IDE. The result should be easily usable by newcomers to the Arduino world.
'''Goal:''' Be able to use a visual virtual Arduino board, and program it with the Arduino IDE. The result should be easily usable by newcomers to the Arduino world.


'''Deliverables'''
'''Deliverables'''


* IDE Integration
* IDE Integration
  Configure QEMU with the Arduino IDE (using chardev UART0).
** Configure QEMU with the Arduino IDE (using chardev UART0).
  Compile program and upload via serial.
** Compile program and upload via serial.
  The IDE doesn't need modifications.
** The IDE doesn't need modifications.


* UI (Python)
* UI (Python)
  Connect UART1 (via QMP or chardev), display as textbox
** Connect UART1 (via QMP or chardev), display as textbox (input is not important at this point).
  (input is not important at this point).


* QEMU: GPIO
* QEMU: GPIO
  Produce a script to extract the GPIO devices from the netlist.
** Produce a script to extract the GPIO devices from the netlist.
  Configure QEMU devices to use the previous names/values.
** Configure QEMU devices to use the previous names/values.
  Publish GPIO events (name as a string and tension as float) via
** Publish GPIO events (name as a string and tension as float) via a QMP socket (JSON form?).
  a QMP socket (JSON form?).
** Write a test which runs FreeRTOS to generate a stable output.
  Write a test which runs FreeRTOS to generate a stable output.


* UI (Python)
* UI (Python)
  Connect to the QMP socket and display the GPIO events.
** Connect to the QMP socket and display the GPIO events.
  Now GPIOs are connected to LEDs. Present graphical LEDs as ON/OFF.
** Now GPIOs are connected to LEDs. Present graphical LEDs as ON/OFF.
  Add an oscilloscope representation (matplotlib widget). Each GPIO
** Add an oscilloscope representation (matplotlib widget). Each GPIO can be plugged into the oscilloscope channels.
  can be plugged into the oscilloscope channels.
** Add Switches and PushButtons to the UI, generating QMP events which trigger GPIO input.
  Add Switches and PushButtons to the UI, generating QMP events which
  trigger GPIO input.


* QEMU: PWM
* QEMU: PWM
  Modify script to extract PWM devices used from the netlist.
** Modify script to extract PWM devices used from the netlist.
  Configure QEMU devices to use the previous names/values.
** Configure QEMU devices to use the previous names/values.
  Use QEMU sound API to generate a stream of PWM values (as a wav).
** Use QEMU sound API to generate a stream of PWM values (as a wav).
  Add a QMP command to lookup the PWM wav stream.
** Add a QMP command to lookup the PWM wav stream.
  Write a FreeRTOS test producing a sinusoidal via PWM, verify the
** Write a FreeRTOS test producing a sinusoidal via PWM, verify the wav form.
  wav form.


* UI (Python)
* UI (Python)
  Lookup the wav stream via the QMP socket, connect to it, display
** Lookup the wav stream via the QMP socket, connect to it, display it on the oscilloscope view.
  it on the oscilloscope view.
** Add a graphical representation of the LED intensity.
  Add a graphical representation of the LED intensity.


* QEMU: ADC
* QEMU: ADC
  Modify the script to extract the ADC devices from the netlist.
** Modify the script to extract the ADC devices from the netlist.
  Similarly to PWM, use the sound wav stream to read ADC samples.
** Similarly to PWM, use the sound wav stream to read ADC samples.


* UI: Python
* UI: Python
  Add a textbox to set the ambient temperature (a thermometer is
** Add a textbox to set the ambient temperature (a thermometer is connected to some ADC pins).
  connected to some ADC pins).
** Use a slider to set the tension sampled by the ADC (like if it was a potentiometer).
  Use a slider to set the tension sampled by the ADC (like if it
  was a potentiometer).


'''Materials provided'''
'''Materials provided'''


* [https://gitlab.com/xcancerberox/arduino-example-circuits/-/blob/master/arduino_led/arduino_led.sch a specific circuit configuration] represented as a netlist.
* [https://gitlab.com/xcancerberox/arduino-example-circuits/-/blob/master/arduino_led/arduino_led.sch a specific circuit configuration] represented as a netlist.
* [https://www.arduino.cc/en/Tutorial/BuiltInExamples preset Arduino tests] compliant with QEMU limitations.
* [https://www.arduino.cc/en/Tutorial/BuiltInExamples preset Arduino tests] compliant with QEMU limitations.
* [https://www.arduino.cc/en/Tutorial/Blink Digital example]: "Blink: Turn a LED on and off."
* [https://www.arduino.cc/en/Tutorial/Blink Digital example]: "Blink: Turn a LED on and off."
* [https://www.arduino.cc/en/Tutorial/Fading Analog example]: "Fading: Use an analog output (PWM pin) to dim a LED."
* [https://www.arduino.cc/en/Tutorial/Fading Analog example]: "Fading: Use an analog output (PWM pin) to dim a LED."
* [https://www.arduino.cc/en/Tutorial/AnalogInput Analog example]: "Analog Input: Use a potentiometer to control the blinking of a LED."
* [https://www.arduino.cc/en/Tutorial/AnalogInput Analog example]: "Analog Input: Use a potentiometer to control the blinking of a LED."
* QMP commands documentation
* QMP commands documentation


[https://www.mail-archive.com/qemu-devel@nongnu.org/msg681744.html Additional tasks are available] for applicants who completes the project.
[https://www.mail-archive.com/qemu-devel@nongnu.org/msg681744.html Additional tasks are available] for applicants who completes the project.
    
    
'''Essential skills required'''
'''Essential skills required'''


* Fluent in C
* Fluent in C
* Comfortable programming in Python
* Comfortable programming in Python
* Knowledge of Javascript might be useful (Java will *not* be used).
* Knowledge of Javascript might be useful (Java will *not* be used).
* Working knowledge with User Interfaces
* Working knowledge with User Interfaces


Electrical engineering background is not essential
Electrical engineering background is not essential


'''Details:'''
'''Details:'''


* Skill level: intermediate to advanced
* Skill level: intermediate to advanced
* Language: C
* Language: C
* Mentor: Philippe Mathieu-Daudé <f4bug@amsat.org> ("f4bug" on IRC)
* Mentor: Philippe Mathieu-Daudé <f4bug@amsat.org> ("f4bug" on IRC)
* Mentor: Joaquin de Andres <me@xcancerberox.com.ar> ("xcancerberox" on IRC)
* Mentor: Joaquin de Andres <me@xcancerberox.com.ar> ("xcancerberox" on IRC)

Revision as of 15:30, 26 February 2020

Interaction with virtual sensors using the Arduino board

Summary: The project will add a visual representation of an Arduino board. By running the code on the emulated AVR processor, the virtual board is updated and displays the changes. Interracting with the code via external events (sensors) triggers changes on the UI.

Goal: Be able to use a visual virtual Arduino board, and program it with the Arduino IDE. The result should be easily usable by newcomers to the Arduino world.

Deliverables

  • IDE Integration
    • Configure QEMU with the Arduino IDE (using chardev UART0).
    • Compile program and upload via serial.
    • The IDE doesn't need modifications.
  • UI (Python)
    • Connect UART1 (via QMP or chardev), display as textbox (input is not important at this point).
  • QEMU: GPIO
    • Produce a script to extract the GPIO devices from the netlist.
    • Configure QEMU devices to use the previous names/values.
    • Publish GPIO events (name as a string and tension as float) via a QMP socket (JSON form?).
    • Write a test which runs FreeRTOS to generate a stable output.
  • UI (Python)
    • Connect to the QMP socket and display the GPIO events.
    • Now GPIOs are connected to LEDs. Present graphical LEDs as ON/OFF.
    • Add an oscilloscope representation (matplotlib widget). Each GPIO can be plugged into the oscilloscope channels.
    • Add Switches and PushButtons to the UI, generating QMP events which trigger GPIO input.
  • QEMU: PWM
    • Modify script to extract PWM devices used from the netlist.
    • Configure QEMU devices to use the previous names/values.
    • Use QEMU sound API to generate a stream of PWM values (as a wav).
    • Add a QMP command to lookup the PWM wav stream.
    • Write a FreeRTOS test producing a sinusoidal via PWM, verify the wav form.
  • UI (Python)
    • Lookup the wav stream via the QMP socket, connect to it, display it on the oscilloscope view.
    • Add a graphical representation of the LED intensity.
  • QEMU: ADC
    • Modify the script to extract the ADC devices from the netlist.
    • Similarly to PWM, use the sound wav stream to read ADC samples.
  • UI: Python
    • Add a textbox to set the ambient temperature (a thermometer is connected to some ADC pins).
    • Use a slider to set the tension sampled by the ADC (like if it was a potentiometer).

Materials provided

Additional tasks are available for applicants who completes the project.

Essential skills required

  • Fluent in C
  • Comfortable programming in Python
  • Knowledge of Javascript might be useful (Java will *not* be used).
  • Working knowledge with User Interfaces

Electrical engineering background is not essential

Details:

  • Skill level: intermediate to advanced
  • Language: C
  • Mentor: Philippe Mathieu-Daudé <f4bug@amsat.org> ("f4bug" on IRC)
  • Mentor: Joaquin de Andres <me@xcancerberox.com.ar> ("xcancerberox" on IRC)