Category Archives: Arduino with Python

Using an Arduino with Python LESSON 15: Model of Bouncing Marble in 3D Room

In this video lesson we model a 3D room, and have a marble bouncing around in the room, off of each of the six walls. Below we include the code we develop in the video above

 

Using an Arduino with Python LESSON 14: Model a Moving Marble in a Room Using Parameters


In this lesson we show how to model a moving marble in vPython. We show how to create an animation where the marble bounces off the left and righty walls of our virtual room. For your convenience, we include the code below:

 

Using an Arduino with Python LESSON 11: Controlling an LED from Python

In this video lesson, we show how to control an LED using python. Python sends commands to arduino, which then controls the LED. We also create a vPython visual, where the ‘Virtual’ LED mimics the behavior of the real LED. This a really cool demonstration and hope you enjoy it. I include below the code we develop in the video. On the arduino side we end up with the following:

And on the python side we have:

 

Using an Arduino with Python LESSON 8: Live Thermometer 3D Visual Using DHT11

In this video lesson we connect the Arduino to a DHT11 temperature and humidity sensor. We show how to wire the device up, and then how to code the Arduino. The data is passed from the Arduino to python. We then create a live 3D thermometer model that updates as the temperature changes.

On the arduino side, this is the code which we use:

Then on the python side, we use the following code:

 

Using an Arduino with Python LESSON 5: Analog Voltage Meter in vPython

In this lesson we begin coding a 3D analog voltmeter model in vPython. We begin by connecting a potentiometer to an arduino to create a voltage divider. The voltage is read from the center tap of the potentiometer by the arduino, and then the arduino passes the data to python. Then, we animate the  analog voltmeter based on the readings passed from the Arduino. Enjoy!

Then this is the code we developed for the Python side.