This Operator needs to use two servos, sixteen photoresistors, sixteen LEDs, five buttons, a laser, an LCD display, and a seven segment display. The microcontroller used will be the Arduino MEGA, and the ESP32 Development Version. The current is expected to spike at times which intuitively exceeds the maximum possible current that is provided by the MEGA.
This is the photoresistor and the constant resistor in series. In the previous image, we assume that the lighting is bright enough such that the resistance across the photoresistor is 10k Ohms making the total resistance be 20k Ohms. This will supply a current without the laser of 0.25mA and since there are 16 of them, there will be 4 mA of current across these resistors. The leakage current for each analog input will still be two magnitudes smaller than the current flowing across the resistors making this the perfect configuration. If we assume that the resistance across the photoresistor may reach 0 Ohms, there will still be a resistance of 10k Ohms which will supply a total current 8mA.
These are LEDs in parallel as position indicators powered from digital output ports. In the previous image we can see 16 LED’s in parallel. Each LED will have a maximum of 20mA across. We did not want to tinker with the specific resistance for each LED since that will only complicate the system more. In this configuration, we will need to supply the 20 mA, 6 times since we only want to indicate the position of the targets which we will limit to 6. The total current flowing across the LEDs will be 120mA. This alone calls for an external power supply since this is expected to approach the limit of the Arduino.
In the previous figure, we have the maximum expected value for the circuit at the moment. Since we still need to power the two servos and the laser which is less than 20 mA, we will need to draw significantly more current. The servos are meant to be powered by this microcontroller, but running everything directly from the arduino is surely going to decrease the brightness (the current flow) of the 16 LED indicators.
In this image we show all of the digital output pins that will power the LEDs. For this design, we decided to only have 6 LED’s turn on and the current flow has already been determined. In this case, this is completely fine to have.
This image shows one of the power supplies for simulation purposes, but they may be redistributed as needed.
In this image we use decided to have groups of four for each color. Each LED is in series with a 220 Ohm resistor and powered by a digital output pin. The first digital pin begins on pin 22 and continues from top to bottom and left to right. The last pin is on pin 37 which accounts for the bottom right LED.
For this circuit, we have all of the photoresistors spaced out by an inch from each other. Each photoresistor is in series with a 10 kiloohm resistor. As the light intensity is increased on the photoresistor, the resistance is decreased. Since the photoresistor is adjacent to the power source, we need to determine the times when the voltage increases by a significant amount.
In this figure we have five buttons that are all labeled. The top, bottom, left, and right buttons are all digital inputs that are initialized sequentially beginning from pin 38 and ending on pin 41. Pin 42 is reserved for the enter button which is the rightmost button. All buttons are initialized with the internal pull-up resistors of the Arduino which are expected to be 20 Kiloohms per push button.
We needed to use all sixteen analog pins on the Arduino MEGA. Pin A0 to A4 refers to the four reference voltages for the top row of photoresistors. The pattern for the analog pins is A(4*r+c) where 'r' refers to the row number and c refers to the column number. The row and column numbers have a range of 0 to 3 each.
In this image we can see pins 1 and 19 are used for communication between the Arduino MEGA and the ESP32. In later updates, they were updated to use pins 18 and 19 for consistency and control over the communication lines.
This ESP32 is communicating with the Arduino. The ESP32 supports 3.3 volts for communication so we made a quick voltage divider circuit that consists of a 2 kiloohm resistor and a 1 kiloohm resistor. The voltage output from the Arduino MEGA is 5 volts which is dropped down to approximately 3.333 volts. Both microcontrollers are communicating through UART and the ESP32 is communicating to an MQTT server.
The following image shows the configuration for the 7 Segment Display and the LCD display.
The following configuration are the hidden resistors used to control the contrast and the current flow of the LCD.
This image just shows how how we needed to manage many cables to work for one container.
This image shows the 220 Ohm resistors that are attached to the seven segment display.
Note: Some of these physical configurations were updated as the experiment progressed.
In this image we show the ESP32, the Arduino Mega, the sixteen photoresistors, the sixteen LEDs, the five buttons, the seven segment display and the shift register used, and the LCD display.
The ESP32 Development board is used to communicate with the MQTT server.
This image shows the sixteen LEDs in series with a 220 Ohm resistor.
The 16 Photoresistors are used in series with a 10 Kiloohm resistor.
These are the buttons that I will use and their respective connections.
This image shows the configuration between the seven segment display and the shift register. Each LED is in series with a 220 Ohm resistor. More information over where the shift register is connected could be found on the coding section.
This image shows the configuration of the LCD and the Arduino MEGA. There is an extra resistor and potentiometer used to control the current flow into the LCD display and control the contrast with the potentiometer.
Note: Some of these physical configurations and schematics were updated as the experiment progressed. With some modifications to the code, an experienced user may be able to replicate the experiment.
LCD is used to see current laser commands, targets
Potentiometers used to change row, column position commands
The motor is used as feedback for when the MPU or PIR sensors are triggered.
MPU sensor is used to check for acceleration along various axes. Exceeding a threshold triggers the motor to spin faster or slower.
The bar LED is used to show when the FSR, sound and tilt sensors are triggered.
The FSR sensor reads an amount of force being put on it, and activates a series of LEDs once a threshold is hit.
The RGB LED is a feedback device used to communicate when the ultrasonic sensor goes off. It flashes a series of red, green, and blue lights.
The sound sensor detects when a certain decibel threshold is exceeded, and turn on the bar LED as a response.
The tilt sensor reads when a interior ball rolls past a certain point, and triggers the bar LED as a response.
The PIR sensor is used to detect motion via infrared light. By moving rapidly or slowly within its field of view, we speed up or slow down the motor.
The ultrasonic sensor uses ultrasonic sounds waves to detect how far something is, and triggers the RGB LED once it reads something near.
To send signals between each operator, wifi communication is used via a pair of Esp32s. These devices allow us the standby operator to tell the master operator where to point the laser, and allow the master operator to tell the standby operator where they have aimed the laser.