viernes, 29 de marzo de 2013

Wiring up the elements

First things, first. We need to create a diagram of our wiring in order to prepare our job. Normally, an engineer creates wiring diagrams to indicate other people how to connect things together in the proper way. So, if I will wire myself... why shall I do a wiring diagram? 

There are a few very good reasons: 

1.- To keep track on what you did! Working a few hours per week, you shouldn't assume you will remember everything. 

2.- If you need to troubleshoot your design, you will need to check 2 things: the concept and the implementation. To visualize the concept you need a wiring diagram. 

3.- Obviously, if you need external help you need your wiring anyway.

So, do yourself a favor and create proper documentation of your projects!

If you're a beginner, I recommend you to use Fritzing. Once more, this software is easy to learn, to install and yes, it's for free! Here you have my Fritzing diagram:

CAUTION: When using library elements on Fritzing, please double check for accuracy. For example, the pin out of the Bluetooth Modem included in Fritzing is not compatible with mine. If you have a close look on the photos of real wiring you will realize the difference.

You can find the source code of this fritzing wiring here. It is not possible to preview this type of files. If you want to work with it, you must install Fritzing first and then download the file to your computer...  or you use the above picture!

Bill of materials:
1x Arduino Leonardo.
2x Motor Driver 1A Dual TB6612FNG
1x Bluetooth Mate Silver WRL-10393
3x small motors (I'm trying some different motor types. I will update this when I'm finished!)
1x Battery

4x Accumulators, to create 4,8 Volts.
1x +/- bus as explained here below.

Wiring Description:
I always create a + - bus for my projects. This is useful to power all the electronics we will install. It looks like this.

To avoid problems with the polarity, I use the 3 points plug I described here some time ago.

Bluetooth Modem: Imagine you are connecting 2 microphones with 2 loudspeakers. You must connect Data Source with Data Destination. Serial communication is the same: I connected the Tx Modem to Rx Arduino and also RxModem to Tx Arduino.

I used an "DiY plug" to connect it. This is the result

Drivers: The selected driver must receive 2 power voltages: one for the electronics and another one for the motors. I used a battery pack for the 7Volts, then I use the +5Volts from the Arduino Board to power the drivers and the modem. Here, a picture of the splitter board:

I wired together both "Stby" pins to control them with a single output. (Output No 2). 

Then I wire PWM, AN1, AN2 of motor1 to outputs 3, 4, 5. I repeat the same for motors 2 and 3 using outputs 6,7,8 and 9,10,11. I prepared the wiring of motor 4 on the driver's side, but I didn't connect it to the Arduino. 

This leaves us only 2 digital in/out's (12 and 13) available for other purposes. If I need more digital I/O's I will use alternative techniques to free some of them. But for the moment I prefer to solve the wiring of the drivers using simple techniques.

Phase 1: soldering the wiring.

Phase 2: Gluing the plugs to create a socket.

Observe that I bend the motor pins to allow me to plug / unplug them when the driver is in his socket. Believe me, it is always a help to have an easy way to disconnect motors...

Then we add the battery pack. The final result looks like this:

I needed some 2 "part-time days" to create the concept, figuring out how to put all the elements together, then soldering & wiring. So, this is something you can do in a single week end. If you are good at soldering, you may be finish in a few hours.

Wiring is finished. Now, the very interesting part of the project. The software! But you must give me some little more time for it. 

Keep doing!

No hay comentarios:

Publicar un comentario