Red Pitaya Jupyter Python programming

From SMART4ALL Docs
Jump to navigation Jump to search

Introduction[edit | edit source]

Jupyter Notebook


The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and explanatory text, and directly control or monitor hardware. Uses include data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.

The Jupyter Notebook enables beginners to learn how to start programming the Red Pitaya units in 5 minutes, and scientists or researchers to easily exploit the full potential of the hardware while keeping full focus on application level. The Jupyter Notebook is an open-source web application that combines live Python code, equations, visualizations, dashboards with real time graphs, dials, meters, sliders, buttons, and explanatory text. Jupyter running on the Red Pitaya units also provides intuitive access to all features of the hardware, and therefore almost a single line of Python code enables users to:

  • control onboard LEDs
  • utilize digital I/Os
  • utilize slow analog I/Os
  • acquire RF signals
  • generate RF signals
  • communicate over digital interfaces (I2C, UART, SPI)
Red Pitaya Sensor Shield


When the Red Pitaya units are used together with a sensor extension module, users are also able to connect many sensors and actuators that enable out of the box functionality for:

– Measuring temperature, moisture, alcohol, water level, vibrations, UV light, sound, pressure, air quality detect motion, and other parameters. Rr control things like: – LEDs, displays, motors, and relays that are able to control high load devices. Find detailed descriptions and examples at this LINK

Features

· In-browser editing of code, with automatic syntax highlighting, indentation, and tab completion/introspection.

· The ability to execute code from the browser, with the results of computation attached to the code which generated them.

· Displaying the results of computation using rich media representations, such as HTML, LaTeX, PNG, SVG, etc. For example, publication-quality figures rendered by the matplotlib library can be included inline.

· In-browser editing for rich text using the Markdown markup language, which can provide commentary for the code, is not limited to plain text.

· The ability to easily include mathematical notation within markdown cells using LaTeX, and rendered natively by MathJax.


Hardware – Extension module[edit | edit source]

Although the usage of Jupyter notebook does not require any additional hardware except the RedPitaya board, getting started with electronics is way more fun and interesting when you have loads of sensors that you can put to good use straight away. Whether you want to measure temperature, vibration, movement etc. we have an extension module compatible with Grove modules from Seeed®. All you need is to select the desired module, find the correct connector and get going with your project. We have also placed Arduino shields headers on the Extension module.


To get started, one simply access the Red Pitaya web interface and then navigate to Development/ Python programming.

Jupyter-3.jpg
Jupyter-4.jpg
Jupyter-5.jpg

Notebook documents contains the inputs and outputs of an interactive session as well as additional text that accompanies the code but is not meant for execution. In this way, notebook files can serve as a complete computational record of a session, interleaving executable code with explanatory text, mathematics, and rich representations of the resulting objects. These documents are internally JSON files and are saved with the .ipynb extension. Since JSON is a plain text format, they can be version-controlled and shared with colleagues.

Notebooks may be exported to a range of static formats, including HTML (for example, for blog posts), reStructuredText, LaTeX, PDF, and slide shows, via the nbconvert command.

Furthermore, any .ipynb notebook document available from a public URL can be shared via the Jupyter Notebook Viewer (nbviewer). This service loads the notebook document from the URL and renders it as a static web page. The results may thus be shared with a colleague, or as a public blog post, without other users needing to install the Jupyter Notebook themselves. In effect, nbviewer is simply nbconvert as a web service, so you can do your own static conversions with nbconvert, without relying on nbviewer.

Sensors[edit | edit source]

Grove is an open modular system designed for easy connection of any input or output model to a microprocessor. We provide Grove sensors in the category of Robotics, Proximity, Motion, Environmental, and Biomedical.

More types of sensors can be found here: link.

Sensor information Connector
Temperature sensor AI
Motion sensor DIO
Touch sensor DIO
Button DIO
Switch
Digital
Tilt DIO
Potentiometer AI
Light sensor AI
Air quality sensor AI
Vibration sensor AI
Moisture sensor AI
Water sensor AI
Alcohol sensor AI
Barometer not supported at the moment I2C
Sound sensor AI
UV sensor AI
Accelerometer not supported at the moment I2C
Actuators Connector
Relay DIO
Indicators Connector
Buzzer DIO
LED DIO
7 segment display Digital pins
LED bar Digital pins
Groove LCD Digital pins
LCD Digital pins

Examples[edit | edit source]

  1. Drive LEDs
  2. Control GPIO s
  3. Write slow analog I/Os
  4. Read slow analog I/Os
  5. Generator:
  6. Generate periodic sine wave
  7. Generate periodic arbitrary signal
  8. Two synchronized generators
  9. Burst mode
  10. Oscilloscope:
  11. Forced trigger
  12. Level trigger
  13. Two synchronized channels
  14. Synchronized with generator
  15. Demo applications using widgets:
  16. Generator
  17. Oscilloscope
  18. Grove sensors
  19. Temperature sensor
  20. Home heating automation