On Thursday, November 1st, after we received all the parts we need for the experiment, our group starts to test and design the experiment. We made significant progress.
We connected relay, raspberry pi, and transmitter. We also implemented a simple code to turn on and off transmitter with raspberry pi.
Achievement:
- Make relay control transmitter work. Raspberry pi controls relay turn on / off 1 sec each.
- Code:
import RPi.GPIO as GPIO
import time
channel = 21
# GPIO setup
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel, GPIO.OUT)
def transmitter_on(pin):
GPIO.output(pin, GPIO.HIGH) # Turn motor on
def transmitter_off(pin):
GPIO.output(pin, GPIO.LOW) # Turn motor off
if __name__ == ‘__main__’:
try:
transmitter_on(channel)
time.sleep(5)
transmitter_off(channel)
time.sleep(5)
GPIO.cleanup()
except KeyboardInterrupt:
GPIO.cleanup()
What we still need:
- Research – programming w/ iRobot
- Sending infrared signal back to the server, the server turns on the transmitter 1 UNTIL the robot docks at the transmitter 1. Once robot docks at t1, t1 turns off, t2 turns on immediately.
- The only problem is, how to program the robot so it can leave t1 immediately after arriving it.
- How to monitor the robot when it DOCKED
- Sending infrared signal back to the server, the server turns on the transmitter 1 UNTIL the robot docks at the transmitter 1. Once robot docks at t1, t1 turns off, t2 turns on immediately.
- Further – connect several raspberry pis with servers
- Further – programming real-time automatic transmitter turn on and off
- Web server