Hello,
Thank you in advance for taking a moment to read this and offer assistance. I will begin the description of my project with a 2 photos.
The Bulb and husk become one unit. The seams and marriage will be tighter. The husk is removable.
The concept is that as one removes the husk a sensor recognizes this state, and there is a response.
Input:
From some preliminary research I think a Photoresistor would be the appropriate sensor. The CdS photoresistor would be mounted on/embeded on the interior bulb. When the husk is removed the CdS is exposed to more light.
Output: An LED illuminates in correlation with the state of a particular CdS Photoresitor. I.E. you remove a husk and and a LED lights up.
Note I would like there to be many Elephant Garlic bulbs in this system. I believe I will need a breakout board to accomplish this.
Question: I was able to find a tutorial for an input of many CdS Photoresitors to an Arduino Uno. I could not find a technique for correlating these inputs with an output of LED as described. To rephrase the problem statement; how can I make an LED light up in response to a photoresistor state. Additionaly how could this be accomplished on a scale of perhaps 64 of these units.
Here is a Pseudo wiring diagram:
Notice that the output(right side) is simply a copy of the input side. This is where my understanding is falling short.
Details:
The realization of this circuit will entail both an understanding the wiring and the coding. I would appreciate any insights. I was planning on using the following components, however I am open to adjustment;
-
Arduino Uno or Nano
-
CdS Photoconductive Photocells from Adafruit
PDV-P8001.pdf (93.7 KB)
(data sheet)
regarding this I think the most relevant bit of information from the adafruit tutorial would be the following chart. This chart would help me code the arduino to communicate with the LED. I would be attempting to make a sort of binary signal from the photocell; i.e. either husk peeled or not.
-
Warm white LED sequins. I think this are really attractive and I just like them. Probably not the cheapest option. Here is the datasheet, and a png of the more relevant part of the data sheet.
LED_sequin.pdf (220.9 KB)
-
Sparkfun multiplexor_8channel
MUX74HC_HCT4051.pdf (289.1 KB)
-
Power supply; I dont know what voltage I would need to illuminate 64 LED sequins. I understand this would depend on how bright. I would like them to be regular bright. I know this is not techinical specification. Maybe someone could help me describe this. I was thinking that a power supply like this would work:
If anybody has any suggestions regarding this I would be glad. I am essentially looking to power the circuit from a wall plug. Im pretty sure I need an AC/DC power supply that I can easily wire to the Arduino. -
List item
Here is the arduino code from the sparksfun tutorial. I think I could probably adapt this for this application.
/******************************************************************************
Mux_Analog_Input
SparkFun Multiplexer Analog Input Example
Jim Lindblom @ SparkFun Electronics
August 15, 2016
https://github.com/sparkfun/74HC4051_8-Channel_Mux_Breakout
This sketch demonstrates how to use the SparkFun Multiplexer
Breakout - 8 Channel (74HC4051) to read eight, separate
analog inputs, using just a single ADC channel.
Hardware Hookup:
Mux Breakout ----------- Arduino
S0 ------------------- 2
S1 ------------------- 3
S2 ------------------- 4
Z -------------------- A0
VCC ------------------- 5V
GND ------------------- GND
(VEE should be connected to GND)
The multiplexers independent I/O (Y0-Y7) can each be wired
up to a potentiometer or any other analog signal-producing
component.
Development environment specifics:
Arduino 1.6.9
SparkFun Multiplexer Breakout - 8-Channel(74HC4051) v10
(https://www.sparkfun.com/products/13906)
******************************************************************************/
/////////////////////
// Pin Definitions //
/////////////////////
const int selectPins[3] = {2, 3, 4}; // S0~2, S1~3, S2~4
const int zOutput = 5;
const int zInput = A0; // Connect common (Z) to A0 (analog input)
void setup()
{
Serial.begin(9600); // Initialize the serial port
// Set up the select pins as outputs:
for (int i=0; i<3; i++)
{
pinMode(selectPins[i], OUTPUT);
digitalWrite(selectPins[i], HIGH);
}
pinMode(zInput, INPUT); // Set up Z as an input
// Print the header:
Serial.println("Y0\tY1\tY2\tY3\tY4\tY5\tY6\tY7");
Serial.println("---\t---\t---\t---\t---\t---\t---\t---");
}
void loop()
{
// Loop through all eight pins.
for (byte pin=0; pin<=7; pin++)
{
selectMuxPin(pin); // Select one at a time
int inputValue = analogRead(A0); // and read Z
Serial.print(String(inputValue) + "\t");
}
Serial.println();
delay(1000);
}
// The selectMuxPin function sets the S0, S1, and S2 pins
// accordingly, given a pin from 0-7.
void selectMuxPin(byte pin)
{
for (int i=0; i<3; i++)
{
if (pin & (1<<i))
digitalWrite(selectPins[i], HIGH);
else
digitalWrite(selectPins[i], LOW);
}
}
and the webpage: Multiplexer Breakout Hookup Guide - SparkFun Learn
Conclusion
Thank you for your advice. I look forward to your correspondence.