FIREFLY DEVICE
Hardware
•	Main processor: Wemos D1 Mini
•	Display: SSD1306 128x64 OLED display
•	Push Buttons: 2
•	Terminal Blocks: OneWire, 2Wire, Analog In, Digital In/Out, 2 Relay Contacts
•	IR receiver: 58Khz
Pin Assignment
•	D0: I/O digital
•	D1: I2C data - 2WIRE terminal SD – Display SD
•	D2: I2C clock – 2Wire terminal SK – Display SK
•	D3: Relay D3
•	D4: Relay D4
•	D5: I/O Digital Terminal Block
•	D6: One wire Terminal Block
•	D7: I/O Digital Terminal Block, Push Button 1
•	D8: I/O Digital Terminal Block, Push Button 2
List of Analog Inputs
•	A0
Tried Setups
•	Ultra sound sensor: connects to D7 (trig) and D5 (sense)
Types of Sensors
•	Analog sensors: Always input to the Analog In Terminal, this pin can receive an analog voltage between 0 and 3.3 volts from any device. The 3-way terminal block provides connections to 3.3v, A0, and GND.
•	I2C protocol sensors: Connect always to 2WIRE terminal block and are memory addressed so it’s possible to connect multiple devices in parallel at the same time.
•	One wire protocol devices: Connected to the ONEWIRE terminal block, this protocol is memory addressed so it’s possible to connect multiple devices in the same pin.
•	Digital input pins: Can be used to connect any device that has an ON/OFF output like end of run switches, PIR sensors, tilt sensors, etc.
•	Rpm/Flow sensors: Sensors that give a low signal on each revolution of a mechanism, normally they use a small magnet and a hall effect sensor to achieve this, examples are rpm sensors and liquid flow sensors. These sensors can be connected to any I/O digital pin.
•	Custom protocol sensors: Some sensors have their own communication protocol and have to be implemented for each sensor in the firmware. For example, the weight sensor HX711 is such a case and it needs 2 digital pins to work.
•	Ultrasonic distance sensors: Sensors that use ultrasound to determine the distance to an object. They need 2 pins assigned, one for trigger and one for sense.
•	IR receiver sensor: This sensor can receive encoded IR signals from any remote control. It needs one Digital I/O pin. The Firefly board comes with a 38Khz IR sensor integrated and connected to pin D7.
•	Push Button 1: This momentary pushbutton is connected to ground and to pin D7.
•	Push Button 2: This momentary pushbutton is connected to 3.3 volts and to pin D8.
Notice that in the board D7 connects to pushbutton 1, the IR sensor, and is also exposed in the digital I/O terminal block. Similarly, D8 connects to pushbutton 2 and is also exposed in the digital I/O terminal block.
Specific Software Inputs Objects
•	ANALOG_IN: Any sensor that outputs an analog voltage between 0 and 3.3 volts can be connected to this pin. Example: analog pressure sensor, MQ2 Gas Sensor, Soil moist sensor.
•	DIGITAL_IN: This interface can accept any input that is digital like limit switches (either 0 volts or 3.3 volts) (needs to select one pin).
•	BMP180: This is a sensor that works on the I2C protocol and can measure atmospheric pressure and temperature (uses pins D1 & D2).
•	Ds18B20: Temperature sensor that works on the ONEWIRE protocol (always on D6).
•	DHT11: Temperature and humidity sensor, works on the I2C protocol (D1 and D2).
•	HX711: Load cell amplifier, custom communication protocol (needs to select 2 pins, data_pin and clock_pin can be any pin with I/O capabilities).
•	FLOW/RPM: This kind of sensors can be connected to any I/O digital pin (needs to select one pin).
•	HCSR04: Ultra Sonic distance sensor, this sensor needs 2 digital pins for trigger and sense (needs to select 2 pins).
Specific Outputs from Library
•	DIGITAL_OUT: This output can be used to drive any digital device, led, actuator, alarm, etc. (needs to select one pin). Pins D3 and D4 are connected to relays in the Firefly device, these can be used to drive higher current loads.
•	SERVO: This output allows driving a servo motor (needs to select one pin).
•	PWM: This output can drive loads at partial power by the technique of Pulse Width Modulation (needs to select one pin).
List of Possible Sensors to Incorporate to the Library
Environmental Sensors
•	DHT11 / DHT22: Barometric pressure sensor (also measures altitude and temperature).
•	BME280: Analog temperature sensor.
•	DS18B20: Gas sensors (MQ-2 for smoke, MQ-3 for alcohol, MQ-7 for carbon monoxide, etc.).
•	Soil Moisture Sensor: Detects ultraviolet light.
•	Light Dependent Resistor (LDR): Passive Infrared sensor for detecting motion.
•	HC-SR04: For remote control communication and proximity detection.
•	MPU6050: Magnetometer (digital compass).
•	ADXL345: Detects the angle of tilt.
Sound and Vibration Sensors
•	Microphone Sensor (KY-037): Detects vibrations and knocks.
•	Sound Detection Module: Ultrasonic sensor for measuring distance.
•	SHARP IR Sensor: Infrared reflectance sensor (used for line-following robots).
•	Laser Distance Sensor (VL53L0X): Detects touch input.
•	Force Sensitive Resistor (FSR): Measures weight or force applied to it (often used with an HX711 amplifier).
Gas and Chemical Sensors
•	MQ-2, MQ-3, MQ-7, etc.: Measures the acidity or alkalinity of a solution.
•	TDS Sensor: Measures light intensity.
•	TCS3200: Detects the presence of a flame.
Biometric Sensors
•	Pulse Sensor: Used for biometric identification.
•	ECG Sensor: Detects magnetic fields.
•	ACS712: Magnetic switch that closes in the presence of a magnetic field.
Miscellaneous
•	Rain Sensor: Reads RFID tags for identification.
•	Gyroscope (MPU6050): Measures rotation position and speed.
List of Possible Output Devices to Connect
Visual Output Devices
•	LED: A multicolor LED that can change colors using PWM on three channels (Red, Green, and Blue).
•	7-Segment Display: Alphanumeric displays for showing text.
•	OLED Display: Full-color graphical display for more detailed visual output.
•	Neopixel (WS2812B): Can generate tones and simple melodies.
•	Active Buzzer: Used for playing sound or music, requires additional circuitry like an amplifier.
Mechanical Actuators
•	Servo Motor: Provides continuous rotational motion, commonly used in fans, robots, etc.
•	Stepper Motor: Converts rotational motion into linear motion for moving objects in a straight line.
•	Solenoid: Acts as a switch for controlling high voltage or high current devices like lights, fans, or appliances.
•	Solid State Relay (SSR): Can be used as a switch or to amplify signals, often used for controlling higher current loads.
Lighting and Displays
•	LED Matrix: An array of LEDs for more complex visual output.
•	EL Wire / EL Panel: Small motor that creates vibrations, commonly used for haptic feedback in devices like phones.
•	Haptic Feedback Actuators: Used in projects requiring temperature control, such as heated beds for 3D printers or heating elements for incubators.
•	Peltier Module (Thermoelectric Cooler): Used in projects requiring air movement or compression.
•	Water Pump: Controls the flow of liquids or gases, useful in automated watering systems or pneumatic projects.
Rotary and Positional Output Devices
•	Rotary Encoder: Similar to a servo motor but rotates continuously like a DC motor, often used in robotics.
Communication and Control Devices
•	IR LED (Infrared): Sends and receives radio frequency signals, commonly used for wireless communication.
•	Bluetooth Module (HC-05, HC-06): Enables wireless internet communication.
Mechanical Devices
•	Electric Lock: Actuated arms used for automated tasks.
•	Robotic Claw: Projects a small beam of laser light, useful in certain types of communication or alignment tasks.
•	Fan (DC Fan): Used for creating magnetic fields, useful in magnetic locking mechanisms.