Hand tools and fabrication machines
Cleaning floors as part of Housekeeping is a daily activity for most households. Not only just Vacuum Cleaning the floor, in many countries wiping the floor is a regular thing as part of housekeeping. In case of Home Automation, this project conveys the Basic Idea of Housekeeping for Smart Homes.
Another thing about this project is that there are ZERO Lines of C Code in the Main Loop ! The ARM Cortex M0 is doing nothing here, all the controls (although simple for the time being) are done using UDB (Universal Digital Block) bases Hardware of PSoC 4, that's the magic of PSoC!
The MCU is free to send a Space Ship to the Mars or maybe running a Nuclear Power Plant (just kidding).
1. A Glowing Transparent Breadboard ( Hot Glued SMD PLCC3528 R-G-B 3 LEDs )
2. My Homemade one of the most useful Portable, Rechargeable (using Laptop Adapter), Multi Rail (Fixed 3.3, 5, Adjustable 1.25- 11, 12-28 volts) state-of-the-art Project Power Supply with integrated 7-Seg LED Voltmeter.
An alternate option is to use 2 Li-Po Batteries in series with these regulators.
3. Broken RC Toy Jeep's chassis with functional Motor-Wheels (6 Volts)
5. 120 RPM High Torque DC Motor (6-12 Volts)
6. L298 H-Bridge Motor Controller (2 A max)
7. DC Fluid Pump (6-9 Volts)
8. Connecting Wires (M-M)
9. Water Flux/Bottle ( + Water)
10. Wooden Spoon as the Sweeper( + Rag will be wrapped on it )
11. PSoC Creator IDE
12. 5mW Red Line Laser
The Quickest and Easiest way to put everything about a project is to " Hot Glue them All ! "
There are some soldering works too ! Adding male headers to the PSoC kit, connecting wires to the RC Cars internal Motor, Pump, Wiping Gear Motor and that's about it!
All the connections ( for signals, PSoC,Laser ) are done with Breadboard jumper wires.
Power connections are done using thick wires, because jumper cables have few ohms of resistance (including contact resistance) which is very bad choice for powering motors.
Finding flexible pipes for the size of small DC pump was kind of challenging, so I came up with an alternate solution by using the Insulation of Household Wires.
By removing the copper strands (really hard to pull them out) , the insulation became nice, well fit pipes for the pump!
Well, the functions of this Robot right now is pretty basic. It's like this :
Turn on the Pump for 1 sec
Turn off the Pump
Sweep to the Left for 0.5 sec
Wait for 0.5 sec
Sweep to the Right for 0.5 sec
Move forward for 1 sec
Start from the beginning
A "Logic 1" travels through the D-Flip Flops followed by "Logic 0s", the MUX sends the 1/0 s to the first Flip-Flop and the Counter selects the MUX Inputs on each Clock pulse of 1 Hz. The Counter Resets when the "Logic 1" reaches the last Flip-Flop's output and the cycle begins again.
There is another 2 Hz Clock for the 0.5 second sweeps and HeartBeat pulse from the PSoC Kit's on board Blue LED.
So far I have only used 2 Clock dividers ( out of 4 ) and some Universal Digital Blocks resources like Macrocells ( the FPGA like chunks in PSoC ) only.
I still have ARM Cortex M0 doing nothing, 2 Opamps, 4 Analog Comparator, 12 Bit ADC, Cap Sense, IDAC, SPI/I2C/UART and many more stuffs to play with ! This is why I love PSoC, because it ROCKS!
The Line Laser Beam is not only for Style but also for detecting end of the line. There is a LDR+Resistor on the Laser side, which is connected to the PSoC's UDB based Digital Comparator!
Why Digital Comparator ? Because I can't use the Analog ones, since they require Initialization in C Code ( but I promised no C code ).
Although Digital, Analog comparison is still possible to some degree. Because, analog voltages close to 0 volt ( usually below 0.8v ) is still "logic 0".
The LDR+Resistor values are chosen to have an analog voltage that is not "logic 0" under normal Indoor Ambient Light condition making the Comparison True and the comparator Outputs High, which is connected to the Enable Pin of L298 Motor Driver. So the system keeps running.
So, what happens when the Wiperbot approaches a wall ? The line Laser Beam creeps on the wall from the floor and diffused light shines on the LDR, LDR starts losing it's Resistance and voltage across it. At some point the analog voltage across LDR is small enough to be detected as Logic 0 by the Digital Comparator, then it makes the Enable Pin Low and all motors stops running!
Although it is Possible to make purely Hardware PWM Blocks based on UDB resources ( there are also 4 PWMs within the ARM subsystem of this PSoC but that requires C Code for configuring/running ) and use PWM output to control the speed, pump water flow rate, sweeper sweep angle - I didn't bother to do so !
Because I have my adjustable power supply, I can simply control the speed by adjusting the Voltage of Power pin of L298 Motor controller.
By adjusting this voltage between 5.50 volts to 8.00 volts, I can achieve my expectations.
There is another way, by changing the 1 Hz to 2,3,4, Hz - I can reduce the On time for the motors !
Most projects just don't start up and keep running on the first try ! But, most people will be embarrassed to show that. I am going to share some of the failures I have observed during test runs, so you can keep these in mind while troubleshooting your future projects !
Like I said, no C Code and using a stupid RC Toy Jeep leaves me not much freedom to do with the smart movements, obstacle detection, water level detection, low battery detection, smart app control, wifi/IoT kind of things.
I have plans to write some C codes, add a HC-05 Bluetooth module with PSoC and Play with an Android App from the phone later !
I have to add another Motor Controller for Front Wheels Left/Right movements.
According to Issac Asimov's 3 Laws of Robotics :-
1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
2. A robot must obey the orders given it by human beings except where such orders would conflict with the First Law.
3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws.
Well, laws are for good Robot ( & good People, who are good people anyway ? )
Making some good, smart, useful Robots based on this basic idea :
a. Fire Fighting Robot
b. Fertilizer/Insecticide spraying Agrobot
c. IoT connected smart, self maintained Housekeeping Robot
d. Toilet Cleaning Robot
e. Hospital/Airport/School hallway cleaning Robot
f. Pet Watering (for Drinking) Bot
How about some really nasty Bad Ass Robots ideas? ( just for Fantasy, please don't even consider making them for Real - Mankind must Prevail ! )
a. Nitric Acid Spraying, Flesh burning Robot
b. Alcohol Spraying, Fire Making Robot
c. Pet Poisoning Robot
d. Water Polluting Robot
e. Germ Spreading Robot
That's all for now, thank you !