Instructables
Picture of Custom Arduino Shield and Sensors

Overview:

This instructable will construct a series of custom sensor modules and an Arduino shield. Such modules are available from many different sources, but fans of the Instructables website would probably find satisfaction in making their own. Each module will be a set size of 1.5cm by 2.5cm and employ a three pin connector of the form Signal-Voltage-Ground. The custom shield will break out the Arduino pins into the same Signal-Voltage-Ground configuration. Thus, electronic connections will be reduced to using a three pin cable to attach a sensor to its corresponding pin set on the Arduino shield. Uniformly spaced mounting holes at the corners of the modules will allow for interchangeable configurations on a robot deck or in other electronics projects. The embedded video displays the sensors in action on an autonomous obstacle avoiding robot. The Arduino code for the robot is given below. The light sensors described in step three of this instructable were also used in my previous instructable.

The construction of the sensors will involve some basic materials including several perf boards, header strips, socket strips and three pin cables. Both straight and right angle headers will be used. The perf boards need to be cut into several 1.5cm by 2.5cm rectangles with a screw hole drilled into each corner. (See figures in the following steps.) In the following steps, an image note in the upper left will give each figure a number of the form Figure x-x. For example, Figure 2-4 refers to the fourth figure of step two.

 
Remove these adsRemove these ads by Signing Up
craftclarity6 months ago

Seems like a lot of work, but I bet is totally rewarding when you look at it and say, "I made the whole thing. No, really, I did."

joesinstructables (author)  craftclarity6 months ago

Thank you for the kind words. Seeing all the sensors work together on the robot was very rewarding.

cheesphht7 months ago

Anybody knows what he means by "shield"?

joesinstructables (author)  cheesphht7 months ago

A shield is an Arduino attachment dedicated to some specific purpose; controlling motors or establishing wireless communication, for example. See http://arduino.cc/en/Main/Products. The purpose of this shield is to provide simple plug-in connections for the sensor modules.

steinie447 months ago

Very cool. Here is a neat module you can make to control 2 LED's with 4+ states. All off one output pin. Took me a few days to develop it. One LED on, one off. The other LED on and one off. Both LEDs on. Both LEDs off. Plus PWM, all with ONE output pin. One LED or the other on, just a High or Low. Both LEDs on, fast clock. Both LEDs off, set pin to input. Use any type inverting IC, 74LS04, 74LS02 etc. See image, how to do it.

2 LED Module.jpg

See my Module, now has 8 functions, on YouTube at:

http://youtu.be/8uZndVTIc24

joesinstructables (author)  steinie447 months ago

You're too quick for me. I breadboarded your circuit and took a video of if, but I see you beat me to it. My video of your circuit is contained below. I wasn't sure where the resistor listed in your description went, so I just put in one on each LED. Thanks for sharing this clever idea.

image.jpg
steinie44LEDmodule.MOV(516x290) 20 KB

Great. Looks real nice.

JDS 2 LED Module
by: Jim Steinbrecher
8 functions, all off one Arduino pin.

One LED on
Other LED on
One LED Flashing
Other LED Flashing
Flashing LEDs
Both LEDs on
Both LEDs off
Flashing LEDs with PWM

<CODE>
/* Module_2_LEDs 17 May 2014 JDS
To make this module:
1) 1" X 1.5" perf board
1) male 3 pin header
2) female 2 pin headers
1) 220 Ohm reststor
1) 74LS04 IC or any inverter IC like 74LS02 etc.
2) LEDs

Wireing the module:
3 pin male header pins are:
Signal, 5 Volts, Ground.
Connect the Signal pin to a inverter input and one pin
of each 2 pin female headers.
Connect the inverter output to the other side of the
two female 2 pin headers.
Connect the 5 Volt male header to the IC pin 14 of 74LS04
Connect the Ground male header to the IC pin 7 of 74LS04.
Plug 2 LEDs into the 2 female 2 pin headers, one
cathode, and on Anode, to the signal side.
That's it!
Then connect the Signal to Arduino pin 3 'in this example'.
Connect 5 Volt pin to Arduino 5 Volts
Connect Ground pin to Arduino Ground.
Then load and run this program.
*/
int i;
int j;
int SignalPin = 3;

void setup() {
pinMode(SignalPin,OUTPUT);
Serial.begin(9600);
}

void loop() {
Serial.println();
Serial.println("JDS LED Module");
Serial.println("by: Jim Steinbrecher");
Serial.println("All off one Arduino pin.");
Serial.println();

digitalWrite(SignalPin,HIGH);
Serial.println("One LED on");
delay(5000);

digitalWrite(SignalPin,LOW);
Serial.println("Other LED on");
delay(5000);

Serial.println("One LED Flashing");
digitalWrite(SignalPin,HIGH);
for (i = 1; i < 25; i++)
{
pinMode(SignalPin, INPUT);
delay(100);
pinMode(SignalPin, OUTPUT);
digitalWrite(SignalPin,HIGH);
delay(100);
}

Serial.println("Other LED Flashing");
digitalWrite(SignalPin, LOW);
for (i = 1; i < 25; i++)
{
pinMode(SignalPin, INPUT);
delay(100);
pinMode(SignalPin, OUTPUT);
digitalWrite(SignalPin, LOW);
delay(100);
}


Serial.println("Flashing LEDs");
for (i = 1; i < 25; i++)
{
digitalWrite(SignalPin,HIGH);
delay(100);
digitalWrite(SignalPin,LOW);
delay(100);
}

Serial.println("Both LEDs on");
for (i = 1; i < 2500; i++)
{
digitalWrite(SignalPin,HIGH);
delay(1);
digitalWrite(SignalPin,LOW);
delay(1);
}

pinMode(SignalPin,INPUT);
Serial.println("Both LEDs off");
delay(5000);
pinMode(SignalPin,OUTPUT);

Serial.println("Flashing LEDs with PWM");
for (i = 1; i < 10; i++)
{
for (j = 1; j < 255; j++)
{
analogWrite(SignalPin, j);
delay(2);
}
for(j = 255; j > 0; j--)
{
analogWrite(SignalPin, j);
delay(2);
}
}
}

</CODE>

jkineas7 months ago

excellent

peterjaap7 months ago

I very often see 10k resistors needed for these things. I just started fiddling with this stuff and it also works without these diodes. Why are they needed? And why does it also work without?

treyes4 peterjaap7 months ago

Those 10k resistors are needed to give a stable analog output with out it the values you will see in the arduino analog read will be fluctuating now again to remove that problem we connect a 10k resistor from the ground pin of the sensor to the signal pin of the sensor

OrrinG7 months ago

Very Well done!

madmoonfish7 months ago

Totally fab. I can see myself building some of these sensors tomorrow ;)