__Shady__

by eeg22 in Circuits > Arduino

209 Views, 2 Favorites, 0 Comments

__Shady__

On-frame-animation-2.gif
WhatsApp Image 2021-07-20 at 8.34.26 AM.jpeg
WhatsApp Image 2021-07-20 at 8.35.24 AM (1).jpeg
7.jpg

__Shady__ is a project originally developed for CDDF Seminar at ITECH Master Program, at the University of Stuttgart 2020/21 by Michael Gosk, Hyowook Kim and Alan Eskildsen

DISCLAIMER:

Our project is, at the current stage, very similar to many other "Y" shaped hanging plotters that can be found, among other places, also here at Instructables. We greatly inherit lots of good solutions from other people, who we will try to mention in our instructions and references. If you feel we should include your name and have not found yours at one of those places - make sure to contact us - we feel in debt and would like to give you the necessary credit. Without the grateful help and detailed tutorials provided by the "makers" community, this project would not be possible.

Introductory description:

Project parts consist mostly of popular DIY electronic devices from the Arduino family (Arduino boards, sensors, and actuators), slightly reaching into more professional and heavier equipment like NEMA17 stepper motors and the world of CNC machines. This should not put you off as this is still pretty much a very simple and understandable project.

What is needed:

DIY electronic parts [this is the 5V part]

-Arduino Uno (without which it would not be a simple and nice project of course!, Why Uno and not something else? Read further on... )

-MLX90614 Touchless Temperature Sensor

-TEMT6000 Light Sensor (or any other reliable light sensor for Arduino)

-Micro-Servo MG90S (important that it should be MG, not SG as it is stronger and we would need strong grip)

- *OLED 0,96" LCD Screen (I2C, not SPI - do not do the mistake we did and do not confuse one with another as it will not be possible to mount it) [not necessary]

- jumper wires mostly male-female (a lot of Red and Black, at least two Yellow and Green for I2C, some Orange for other data, and Brown to accompany the Servo Ground)

- 9V battery + wires with DC Jack (or without) to power the Arduino board (or any other battery that will be sufficient for the Arduino part, separate voltage) On more mechanical but still very much electronic-driven part: [this is 12V part]

- CNC Shield (3.0) for Arduino (this is why we need particularly Arduino Uno as this shield Fits the Uno well)

- jumpers for the CNC Shield

- 2x NEMA 17 bi-polar Stepper Motors (the lighter the better but the important part is how )

- 2x stepper motor drivers - DRV8825 (possible to work with A4988 too, but might require some changes in code) with heatsinks (+a little bit of thermal paste might be a plus)

- DC adapter - from DC Jack to separate wires (to power up the Shield)

- DC powering thicker wires (Red and Black, only a few cm)

- DC power adapter (12V, at least 2A)

- for Shelf Production of the plastic parts:

+ Access to the 3D printer machine or someone who can print the files for you + White (or any other you prefer, but white is advisable)

3D Printed Parts

1.jpg
2.-3D-Printed-Parts.jpg
WhatsApp Image 2021-07-16 at 8.59.03 PM.jpeg
WhatsApp Image 2021-07-16 at 9.47.58 PM.jpeg

Let us start with 3d printing of our plastic parts as it takes a lot of time but once put into motion, does not require too much of attention, and while they are being produced we can focus on the electronic devices.
We were using white PLA material 1,75mm thick, as the printer that had been available to use was Prusa i3,
but of course, you can use different colours, filaments and printers. White is advisable because of its reflective properties.
Some of our parts were designed by us, some were borrowed from other similar projects and accessible sources - all the rights to the respective authors:

L-bracket by Jimi_Hendrik
https://www.thingiverse.com/thing:18019

Pulleys by dustynrobots
https://www.thingiverse.com/thing:3324

Triggering part by McLareniak
https://www.thingiverse.com/thing:4177894
This one was a base for our upgrade (new version suiting our needs) but we have used this direct file for testing, and we strongly recommend printing it out first for the servo triggering tests and to understand how it works.
We want to post it here also to acknowledge the genuine design of the author to point out how informative and didactic it is.

Our parts are added to download and provided as files in this step.

Electronic (mechanic!) Circut - Building Up the Prototype - Part 1 - Basics and Motors

Screenshot 2021-07-19 155647.png
WhatsApp Image 2021-07-17 at 4.59.11 PM.jpeg

In parallel to printing parts that will take up to several hours we can try to see how electronic things come together: First, we will start with some basics and will already do the most complicated part of accessing the motors!

Both 5V and 12V parts come together pretty tightly at the level of our build and seem to be undistinguishable which is which but actually, it is important not to mix them as our stepper motors will not run on 5V and our sensors will be burned by 12V (especially with this bigger than just small Amperage).
Do not worry - everything is under control and with those instructions you should be able to prevent those things from happening. (Still, it is advisable to have some spare parts, especially stepper motor drivers, more wires, and MG servos).

Firstly, we will take Arduino and directly attach the CNC shield - it is simple - just attach it on top of your board. Everything should clearly align and it is hard to mix the directions as both boards have the same size and shape - a most important part of 5V vs 12V management is already done!
(you may of course check if your Arduino is working properly first by plugging it into your computer with usb cable and checking if it blinks (a pre-coded example that is left in all-new Arduinos) and does the connection to the Arduino IDE is working properly by sending there any other of the example scripts -> more on that on the official Arduino tutorial and in many other places)

The second step is to prepare the drivers - those purple (or sometimes red) little boards that look like a tiny version of the Arduino itself - glue the heatsinks (should be there provided together with drivers) with the self-adhesive glue provided on them or, and that is even better - put a little bit of a thermal-paste on them (like for the CPUs and graphic cards) and place it on top of the black squares (logic chips, actual drivers).
They are provided with the little screws like potentiometers on their top-left part - carefully turn them to the right as far as it is possible (up to 1 full rotation, not even that, be careful not to break the stop). Now drivers are safe to be plugged into the board.

The third step is to put the drivers into their sockets - we will use those called X and Y on the CNC Shield.
--- Beware of powering the board without plugging the motors into it first - this way you will burn the drivers!--- (Excellent tutorial about that is possible to be seen here: )

Now is the time to introduce the heavies hardware we are gonna use - the stepper motors.
Depending on the type of motors you will use they may come with wires separated, coupled or sealed as one plug - this would be the easiest option as then you only have 2 possibilities of connecting them. If in motors are not working properly, (first plug the power off!!!) just rotate the plug 180deg... but with power plug off !! - see the warning above! In any other cases we need to direct you to some further steps here or external tutorials:

- If your wires are separated and there is no hint on how they should be paired (like a doc) () - If your wires are somehow pre-coupled (pairs represents coils in the bi-polar motor) - you got only a few options of placing pairs Motors part is ready! Let's move to sensors!

Stepper Motors Mounting

00_Miachel_GIF.gif
WhatsApp Image 2021-07-18 at 1.03.47 AM.jpeg
WhatsApp Image 2021-07-17 at 1.09.09 PM.jpeg
WhatsApp Image 2021-07-17 at 1.09.25 PM.jpeg
WhatsApp Image 2021-07-20 at 8.37.53 AM.jpeg
WhatsApp Image 2021-07-20 at 8.37.54 AM (1).jpeg
WhatsApp Image 2021-07-20 at 8.37.58 AM (1).jpeg
WhatsApp Image 2021-07-20 at 8.34.25 AM (1).jpeg

Now is the time to introduce the heavies hardware we are gonna use - the stepper motors.

Depending on the type of motors you will use they may come with wires separated, coupled, or sealed as one plug - this would be the easiest option as then you only have 2 possibilities of connecting them.
If in motors are not working properly, (first plug the power off!!!) just rotate the plug 180deg (with power plug off !!) - see the warning in the previous step!

In any other case we need to direct you to some further steps here and to the external tutorials:
- If your wires are separated and there is no hint on how they should be paired (like documentation for a particular model of the motors you have with colors stated - for example, GREEN and BLACK, RED and BLUE marked as pairs) there are two options:
(pairs represent coils in the bi-polar motor)

-> checking it with a multimeter (testing the connectivity of the circuit option) - with one probe touching one wire, and second touching each other till the moment it will beep or show information on the screen that
-> (without a multimeter) connecting them manually for a moment as pairs and testing if it is possible to rotate the shaft of the motor (it should be much more difficult in case of right pair touched together than without it)
(both learned from the tutorial from V-SLOT (unfortunately not in English) https://www.youtube.com/watch?v=0woxrCEWYNI )
Then you can move to the second step:

() - If your wires are somehow coupled or are already pre-coupled - you got only a few options of placing pairs in the right order - Pair A at the top, Pair B bottom (each with 0 or 180 deg rotation) or another way round B at the top A at the bottom - check all options, but each time switching off the 12V electricity as without it you will burn the drivers. It is tedious but needed step. At some point, everything will start to work :)

Motors part is ready! Let's move to sensors!

Sensors and Paint Trigger

00_Spray_GIF (1).gif
WhatsApp Image 2021-07-20 at 8.34.36 AM (4).jpeg
WhatsApp Image 2021-07-20 at 8.34.27 AM (1).jpeg

Since the first part of the electronic prototype is done, now is the time to add some sensors and one (very important!) actuator - servo motor! This all will be from the subject of 5V circuts, and even though we are going to place them all on the CNC board In a next couple of steps we are going to assemble those


It will be a little bit unorthodox use of the CNC shield as we will not use GRBL software that is usually flashed to the Arduino memory while working with this Shield. It is because our project is not a classical XY(Z) machine that actuates motors directly in those primary axes. Our directions work differently and are not that simple.
Instead of that, we will try to take an advantage of what CNC shield gives us as it is - what connections to the (unaltered) Arduino pins it provides. To explain that we need to take into consideration 2 super important images that will help to understand what we will be doing and why it makes sense, even though the marks on the CNC shield may be saying something different.
Those two images are reciprocal - one is showing the ports of Arduino mapped on the CNC shield, the second exactly the opposite - CNC shield ports mapped onto Arduino. We hope this excellent graphical aid done by some generous internet authors will be explaining our moves well.

Both examples are from Circuitsboards.blogspot.com (https://circuitsboards.blogspot.com/1969/12/arduin...)

1: https://lh3.googleusercontent.com/proxy/WrxIApeuMP...

2: https://wiki.keyestudio.com/images/thumb/a/ad/KS01...

(we do not place them directly as we are not authors of those excellent images)

With this in mind we will guide you through how we will connect those 5V logic sensors through the CNC shield onto the Arduino pins below it.

Next steps (can be done in any order):

- light sensor

- temp sensor

- paint trigger

-* oled screen

Light Sensor - TEMT6000

TMT6000.jpg
TEMT6000_2.png

The light sensor will be placed on the back (outer side) of the robot, measuring how much light is at the particular part of the environment where the robot is temporarily located at the moment. This data will be used to decide what shall happen next.

There is no big trouble in wiring although wires should have sufficient length - it looks like standard jumper wires are enough for that. VCC goes to 5V supply (white next to Y+ = equals D10, REDwire), GND to GND (any GND, for clarity it can me black pin next to HOLD, BLACKwire) and SIG -actual measurement to white pin next to HOLD caption() - will you have the purple or red version of it, just make sure you can secure it with any kind of adhesive or screw and that is pointing to the outside, not to the bottom.

(You can also use any other light sensor but then you need to figure out the wiring of it (and if it is at all possible to be placed in our tightly fit central unit) and how to calibrate it and make it work with the rest of the code.

Temperature Sensor - MLX90614

MLX90614.jpg
MLX90614_2.png

Inspired by the project by Alex Newton that was published at how2electronics.com https://how2electronics.com/infrared-thermometer-...
we decided to use the MLX90614 sensor to measure the temperature of the environment where the robot is located. This sensor is facing the bottom of the robot - to measure the surface on which the robot is moving, not the sky around it.

You may find different sub-type of it but the method of working is fairly similar. What changes are distances, the field of view angle, and (sometimes) the input voltage, therefore we remind you to always check with the documentation of the particular model.
Melexis documentation webpage:
https://www.melexis.com/en/documents/documentation...

It not only measures the temperature of the one particular object that it ‘sees' but also the general temperature of the environment - so it can provide the difference between those two measurements pretty easily.

Wiring is not too complicated - VIN to 5V (white pin next to Z- = D11, REDwire), GND to GND (for clarity black pen next to Z-, BLACKwire), and two communication pins (SDA and SCL, GREENwire, YELLOWwire) to… designed SDA and SCL pins on the CNC Shield... that however are still A4 and A5 in disguise (not actual SDA and SCL pins of the Arduino below - what a plot twist!)

We will use the I2C protocol so, theoretically speaking, we can use many more devices than just this one (up to 256 in address-logic-wise) - in our case the possible usage is the OLED screen. If you want to use it then you need to consider how to connect two yellows and two greens into one wire per each. -> see OLED screen step

*OLED Display

OLED DISPLAY.jpg
OLED DISPLAY_2.png

This is an optional step, also because we did not manage to finally utilize the capacity of having such a nice graphical device as a screen.

Please do not make the same mistake as we initially did and do not buy the one on SPI protocol, as most of those Pins are already taken and then it is virtually impossible to connect it to our project.
The good news is both types I2C and SPI are in fact very similar things so all the tutorials about creating nice graphics or printing values should be possible to be used even if the type of protocol is different.

WIP: we will add printing the results of the measured values and information is servo triggered (stating if printing/painting action of robot triggered or not)

The biggest trouble is the connection. As always VIN to 5V and GND to GND and, similarly like in the MLX - SDA and SCL to SDA and SCL (green and yellow). As we already have MLX plugged there it takes some redo of the Possible ways of managing that are different types of connectors, soldering, thermal tubes, and all other similar solutions.

One link we would like to point you to that may help with the development of this area (if you are interested)
https://www.instructables.com/Monochrome-096-i2c-O...

Paint Trigger - Servo Motor MG90S `

SERVO MG90s.jpg
SERVO MG90s_2.png


To test if the spraying mechanism works properly with your can of spray(paint) we need the first 3d printed element (testing servo trigger) already being ready to be used and a servo motor capable of turning the mechanical trigger - MG90S.

We got inspired and directly influenced by the project

https://www.thingiverse.com/thing:4177894

Assemble plastic elements together with the servo and try to rotate it between 0 and 90 degrees with a simple code (you can change any of the Example files for Servo like Sweep or Knob)

Assembly

Assembly-diagram-animation.gif
WhatsApp Image 2021-07-20 at 8.37.54 AM.jpeg
WhatsApp Image 2021-07-20 at 8.37.55 AM.jpeg
WhatsApp Image 2021-07-20 at 8.37.56 AM (1).jpeg
WhatsApp Image 2021-07-20 at 8.37.56 AM.jpeg
WhatsApp Image 2021-07-20 at 8.37.57 AM (2).jpeg
IMG_2572.jpeg
IMG_2571.jpeg
IMG_2570.jpeg
1.-Complete.jpg
5.-Electronics-with-cable-management.jpg

So for this step you are going to assemble everything together. As you printed every 3D printed parts you will have 3 parts. The head, body and the tail for the Arduino. You can also see in the images that we upload.

<Head>
First, assemble the Servo motor with the 3D part together and after that put the can together.

<Body>

Screw the MLX90614 sensor, TEMT6000 sensor and the OLED display in the body part and connect the cable to the sensors. And try to think how you will manage the cables to the Arduino.

<Tail>

Before you connect the Arduino and the CNC shield together, fix the Arduino to the 3D printed part which we called the tail part. After that you can connect the Arduino and the CNC shield.

So you have the head, body and tail parts, now you can build the part together. Put the can to the body part and use some screws, washers and nuts to fix them together. At the end plug the tail part to the end of the spray can. Now you can connect the cables together. Don’t forget to plug the 9V battery first to the Arduino and then the 12V cable/battery to the CNC shield. And let’s test them in the next step!

Final Words and References

WhatsApp Image 2021-07-20 at 8.34.36 AM (1).jpeg
WhatsApp Image 2021-07-20 at 8.34.25 AM.jpeg

We would like to point out some interesting references we have used or come across during the process of designing and building our project:

Arduino CNC Shield V3.0 Wiring and Pinout
https://www.youtube.com/watch?v=2N2A2F1HpNQ

Arcuino CNC Shield V3 + DRV8825 - Zone Maker Tutorial
https://www.youtube.com/watch?v=DZcrrFcs4N4

Arduino stepper motor control with CNC shield and DRV8825
https://www.youtube.com/watch?v=k95UAI4eDX4

Arduino CNC Shield V3 and A4988 Hybrid Stepper Motor Driver, CNC Shield pinout, wiring, code, DIY https://www.youtube.com/watch?v=TMK_fLgpESQ&t=424...

ARDUINO CNC SHIELD CONTROL STEPPER MOTOR WITH DRV8825 http://aconcaguasci.blogspot.com/2016/11/arduino-...

CNC Shield, Arduino UNO, DRV8825 - Tips for success!
https://www.youtube.com/watch?v=OfyT1xTZC6o

Control Stepper Motor with DRV8825 Driver Module & Arduino
https://lastminuteengineers.com/drv8825-stepper-m...

Jak skonfigurować GRBL , Arduino, CNC Shield. Sterownik CNC
https://www.youtube.com/watch?v=zXcXm4-ZOzg

Jak podłączyć silnik krokowy ? Dobieranie par przewodów do silnika. || Silnik krokowy nie działa? https://www.youtube.com/watch?v=0woxrCEWYNI

How to get additional 5V and GND pin for Arduino
https://www.youtube.com/watch?v=Vmrmp7reHOY