A virtual laboratory for random arduino experiments
Schematics:
Code:
//OSCILLOSCOPE LAB + ArduinoUno //Author: Niam Moltta #define Potentiometer A2 #define LED 13 int val = 10; void setup() { pinMode(LED, OUTPUT); } void loop() { val = analogRead(Potentiometer); digitalWrite(LED, HIGH); delay(val); digitalWrite(LED, LOW); delay(val); } /*OP AMP: To use the oscilloscope with other components you have to wire the positive input of the oscilloscope to the Vout of the Operational Amplifier and the negative input of the oscilloscope to the positive input of the Op Amp (to get an Inverter Circuit). */
Circuits.io Simulator:
Schematics:
LT Spice Simulator:
Circuits.io Simulator:
Parts:
4 diodes 1N4007
1 Capacitor 10,000uF min 0.4V
1 LED
Let the 3V battery be the voltage generated by the rotating wheel.
Code for Arduino:
// Bird trap test
// Author: Niam Moltta
// L'Astra Lab
#include <IRremote.h>
int ActuatorF = 11;
int ActuatorR = 10;
int val = Serial.read();
int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup(){
pinMode(ActuatorF, OUTPUT);
pinMode(ActuatorR, OUTPUT);
digitalWrite(ActuatorF, LOW);
digitalWrite(ActuatorR, LOW);
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop(){
if (irrecv.decode(&results))
{
Serial.println(results.value, DEC);
digitalWrite(ActuatorF, HIGH); //forwards
digitalWrite(ActuatorR, LOW);
}
else
{ digitalWrite(ActuatorF, LOW); //backwards
digitalWrite(ActuatorR, HIGH);
}
}