Tag Archives: Arduino

Arduino Tutorial 34: Simplest Way to Use a Pushbutton Switch

In this lesson we show you a quick hack that will allow you to incorporate a pushbutton switch into an Arduino project without having to use an external pullup resistor, and still get very stable operation. The trick is to create a digital input pin, which in our example is pin 2. We then digitalWrite that INPUT pin HIGH. What that does is put an internal pullup resistor on pin 2, and then connects it to 5 volts. In effect, we are using a clever command to use the Arduino’s internal pullup resistors. The code below is what we used in the video. Enjoy!


9-Axis IMU LESSON 11: Install Python

This is a quick lesson where we show you how to install Python on a Windows 10 machine. We have gone about as far as we can go on our 9-axis IMU project using only the arduino. What we want to do now is to pass the data we are taking from arduino to Python, and then use python to do animations and 3D renderings. So, to move forward, we will need to install Python, which is explained in the video.

Arduino Tutorial 33: Understanding How to Control Servos with a Joystick

In this lesson we show you how to precisely control the position of two servos using a joystick. We derive the math equations which will allow you to get smooth and precise control of the servo. We also add a buzzer to the project to create an audible alarm when the button the joystick is pressed.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Typically, the servos in electronics kits are not the best ones, but are suitable to learn with. If you want a more stable and better quality servo, this is the one I user in more of my projects: HiTEC

Below is the code we developed in this project.


Arduino Tutorial 32: Understanding and Using Joysticks in a Project

In this lesson we will explain how to hook up a Joystick. The easiest way to think of a joystick is to think of it as two independent potentiometer. Moving the joystick left and right changes one potentiometer, and moving the joystick up and down changes the other potentiometer. Also, pressing the knob on the joystick will activate a simple on/off switch. In this video we show you how to hook the joystick up, and then show you code that will allow you to read from the potentiometers and the switch.

If you want to follow along at home, you can order the Arduino Kit we are using HERE.

Typically, the servos in electronics kits are not the best ones, but are suitable to learn with. Heads up that in Lesson 33 we will be using a joystick to control two servos.  If you want to get ready for that lesson, go ahead and order your  HiTEC Servos.

This is the code that we developed in the video above.


9-Axis IMU LESSON 8: Using Gyros for Measuring Rotational Velocity and Angle

In this lesson we explore approximating the roll and pitch of our sensor using only the gyros. The advantage of gyros is that they are not susceptible to vibration as much as the acceleromters. In the video we show you how you can simply approximate roll and pitch from the data coming from the gyroscopes. Note that while the gyros do not have the noise problem seen in the accelerometers, we now have a new problem that the gyros are susceptible to long term drift. As you play with these devices what you end up seeing is you will need to combine the data from the accelerometers and the gyros in a clever way to take advantage of the long term stability of the accelerometers and the noise immunity of they gyros. In effect, you will want to apply a high pass filter to the gyro data, and a low pass filter to the acceleromters.

To follow along at home, you will need an Arduino Nano, and an Adafruit BNO055 Inertial Measurement Sensor. We suggest using identical hardware if you want to follow along as different sensors have very different characteristics, and things will work much better for you if we are using the same sensor

This is the code which we developed in the video to demonstrate these concepts.

The code below is for demo purposes only, and should not be used in any real applications. It just demonstrates how to work with this sensor in benchtop presentations.