Fun with Arduino - a Series of Introductory Videos

A series of tutorial videos for those who wish to learn more.
User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 29 DCC Accessory Decoder

#51

Post by RudyB » Mon May 06, 2019 11:38 am

With the aid of very little extra hardware we can use Arduino as a DCC decoder, with a price tag that is almost 10x lower than commercially available decoders. In this video we create a DCC Accessory Decoder. In the next video we'll make a DCC Servo Decoder.

In stead of DIY, alternatively you can use the ARCOMORA software, which is fully configurable via a user interface.


Link to Fun with Arduino 29 DCC Accessory Decoder


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 30 DCC Servo Decoder

#52

Post by RudyB » Mon May 13, 2019 11:10 am

Based on the code for the DCC Accessory Decoder we can create a Servo Decoder. All we have to do is add a couple lines of code to toggle the setpoint of the servo, based on the DCC status, and add the code to rotate the servos based on a millis() timer.

Link to Fun with Arduino 30 DCC Servo Decoder


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 31 Stepper Motor with 4 Pulse Driver

#53

Post by RudyB » Thu May 23, 2019 11:45 am

With some applications a stepper motor is prefered over a servo. For instance for the continuous rotation of say a wind mill model. Or with applications like a turn table, a linear shift table or an elevator, a stepper motor can be of great help thanks to the accurate positioning that is possible.

In this video we connect a very cheap (less than $2,-) toy motor to our Arduino and run it. In the coming videos we'll look at features like change directon, speed control and accurate positioning, and we'll look at more powerful motors and drivers.

Link to Fun with Arduino 31 Stepper Motor with 4 Pulse Driver


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 32 Stepper Motor Change Direction and Control Speed

#54

Post by RudyB » Fri May 31, 2019 10:40 am

In the previous video we made the stepper motor run. In this video we'll add 2 functions: change direction and control speed.


Link to Fun with Arduino 32 Stepper Motor Change Direction and Control Speed


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 33 Find Zero Switch or Sensor

#55

Post by RudyB » Thu Jun 06, 2019 10:26 am

A stepper motor does not know where it is after power up. If we want to use a stepper for accurate positioning, we first have to define its ‘zero’ point. This can be done by slowly rotating the motor until a sensor or a micro switch is activated.

In this video we'll add a zero find routine as a preparation to the following vodeo where we will accurately position the motor. The video after that we will build a complete turn table control.

Link to Fun with Arduino 33 Find Zero Switch or Sensor


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 34 Rotate an Exact Number of Steps

#56

Post by RudyB » Thu Jun 13, 2019 11:02 am

Now that we can find the zero switch or -sensor, we can start to position our application by rotating the motor an exact number of steps. No matter if the motor has to make 97 steps or maybe 144668 ... as long as the motor torque and the driver electronics voltage and current suffice in order to not lose steps on the way, we can position the motor with 1 step accuracy.

Fun with Arduino 34 Rotate an Exact Number of Steps


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 35 Turn Table Control with a Stepper Motor

#57

Post by RudyB » Mon Jun 17, 2019 12:11 pm

Now that we can find the zero switch or -sensor, and we know how to position our application by rotating an exact number of steps, we have all ingredients to build say a turn table, or a translating table or an elevator.

We use a Tuning sketch to determine the number of steps for every stop position, counting from the zero position. The numbers are entered into the Turntable Control sketch. Digital inputs are used to tell the Arduino to which position we want to move.

Link to Fun with Arduino 35 Turn Table Control with a Stepper Motor


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 36 Store Data in Non Volatile Memory EEPROM

#58

Post by RudyB » Mon Jul 01, 2019 10:49 am

Because a stepper motor does not know where it is after startup, we need a way to find out where it is. We used a zero find routine to rotate the motor until a sensor is triggered. But suppose we were able to store the last position we moved to in memory and read it our after startup?

The good news is: this is possible. The Arduino has 1024 bytes of non volatile EEPROM memory on board. The video shows how we can write data to memory and how we can read it out at startup such that we can start to use our turntable immediately after starup, without the need to find zero first.

Link to Fun with Arduino 36 Store Data in Non Volatile Memory EEPROM


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 37 Control a NEMA 17 Stepper Motor with Easy Driver

#59

Post by RudyB » Mon Jul 08, 2019 1:44 pm

Several driver circuits are available to control a more powerful stepper motor like a NEMA 17. In this video the EasyDriver is used, but the software is applicable to any driver with Enable, Direction and Step inputs.

Link to Fun with Arduino 37 Control a NEMA 17 Stepper Motor with Easy Driver


Image

User avatar
RudyB
Posts: 49
Joined: Fri Jan 04, 2019 2:26 pm
Location: Netherlands
Contact:

Fun with Arduino 38 - Ultrasonic Distance Measurement with HC-SR04

#60

Post by RudyB » Mon Aug 19, 2019 11:28 am

The HC-SR04 is a sensor that has a little loudspeaker and a little microphone via which the distance to an object can be measured. It's ultrasonic, humans can not hear it.

Don't expect super high accuracy of this less than $1,- costing device, yet I was pleasantly surprised to see that measurements with an accuracy of a couple of mm are very well possible.

Link to Fun with Arduino 38 - Ultrasonic Distance Measurement HC-SR04


Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest