My cat is going to give birth soon, and I want to make a house for her kittens.
i make this model of kittens house
Electronics Tools
tinker cad
To simulate the circuit and ensure it works with the correct connections.
Crafting Tools
cutter
cardboard
scissors
Electronics Tools
breadboard
adapter 5 volt
scissors
led
crocodile wires
arduino uno
jumper wires
restores 220 ohm
ultra sonic sensor
.
https://www.tinkercad.com/things/aznAv34348m/editel?returnTo=%2Fdashboard
this is the circuit in tinker CAD in the above link
Design Circuit on Tinkercad:
Circuit Components:
LED
ultra sonic sensor
arduino uno
resistor 220 ohm
bread board
wires
the idea of the sensor is to know if there any body and when the body is near i used the arduino to make illumination
Circuit Actions:
LED illumination
Steps Taken:
Connection of the Adapter to Arduino
Connect two wires from the adapter to the Arduino:
The positive wire from the adapter to the 5V pin on the Arduino.
The negative wire from the adapter to the GND pin on the Arduino.
Connecting the LED
Connect the positive terminal (anode) of the LED to pin on the Arduino.
Connect the negative terminal (cathode) of the LED to GND on the Arduino.
Connecting the Ultrasonic Sensor
VCC from the HC-SR04 ultrasonic sensor to 5V on the Arduino.
GND from the HC-SR04 ultrasonic sensor to GND on the Arduino.
Trig from the HC-SR04 ultrasonic sensor to pin on the Arduino.
Echo from the HC-SR04 ultrasonic sensor to pin on the Arduino.
TESTING CIRCUITS
coding
i wrote the code to make the room lightinning when a strange body enter
// C++ code
//
long readUltrasonicDistance(int triggerPin, int echoPin)
{
pinMode(triggerPin, OUTPUT); // Clear the trigger
digitalWrite(triggerPin, LOW);
delayMicroseconds(2);
// Sets the trigger pin to HIGH state for 10 microseconds
digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);
// Reads the echo pin, and returns the sound wave travel time in microseconds
return pulseIn(echoPin, HIGH);
}
void setup()
{
pinMode(8, OUTPUT);
}
void loop()
{
if (0.01723 * readUltrasonicDistance(3, 2) < 9) {
digitalWrite(8, HIGH);
}
if (0.01723 * readUltrasonicDistance(3, 2) > 9) {
digitalWrite(8, LOW);
}
delay(10); // Delay a little bit to improve simulation performance
}
Build Circuit on Breadbord
I connected the motor to the switch, then completed the rest of the wiring as shown in Tinkercad. Finally, I verified that the circuit works properly.
I made the connection after ensuring that the wiring was correct on Tinkercad. I uploaded the code as text to the Arduino software and ran the circuit.
Making robot
I used a FAN AND make a cardboard for the body, and used tape
With the rush to get things done quickly, we sometimes forget simple things that affect the whole work. While working on a CAD design, I forgot to change the resistor's ohm value, and after I built the circuit and the lights lit up, I went back to check and found the problem was that I hadn't changed the 220-ohm resistor. Once I changed it, I figured out what the issue was.