From e994f2962f163472524be66736e13ce064991acd Mon Sep 17 00:00:00 2001 From: Zachary Johnson Date: Thu, 12 Apr 2018 00:37:22 -0400 Subject: [PATCH 1/2] Added Toasty's blog post --- _posts/2018-04-11-toasty.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 _posts/2018-04-11-toasty.md diff --git a/_posts/2018-04-11-toasty.md b/_posts/2018-04-11-toasty.md new file mode 100644 index 0000000..ad3a40d --- /dev/null +++ b/_posts/2018-04-11-toasty.md @@ -0,0 +1,37 @@ +--- +layout: post +title: Toasty +date: 2018-04-11 +categories: + - python + - raspberrypi + - arduino + - projects +description: Simple bluetooth controlled 4 motor robot, using a raspberry pi and arduino +author: Zachary Johnson +author-image: https://avatars1.githubusercontent.com/u/22699646?s=460&v=4 +author-bio: First Year Computer Science Student at RIT +author-email: zrj5139@rit.edu +author-social: + github: https://github.com/ZacharyRJohnson + linkedin: +--- + +## Summary +Over winter break I bought a small 4 motor robot chassis with the intent of learning some basic hardware and robotics topics. Toasty is the result of that learning experience. Toasty uses a Raspberry Pi as its brain and an Arduino as an I/O slave board. The Pi runs a python script that gets input from the PS4 controller and then sends commands to the Arduino driving the motors. + +## Toasty's Physiology +Toasty's main logic is written in Python and uses nanpy, a python library, to control the Arduino. The PS4 controller connects to a playstation wireless dongle plugged into the Pi and then the script uses pygame's joystick module to get the button and axis states on the controller. With these the pi can interpret which buttons are pressed and how far down they are pressed to send appropriate commands to the arduino and move the robot. The actual code running on Toasty is pretty simple, I made a few classes to make controlling the motors easier and reduce the amount of repeated code. Then in the main Control.py file, a main loop continuously reads the input from the controller and sends commands via nanpy telling the arduino what to do. + +## Toasty's Anatomy +The main hurdle involved with making Toasty was the hardware. I hadn't done much with hardware prior to this so debugging everything was a challange but once it was all hooked up properly it came down to implementing features in the code. The hardware of Toasty consists of a Raspberry Pi 3 board connected through usb into the Arduino Uno. The arduino then connects to two Dual TB6612FNG motor drivers connected to the motors. The motors are powered by 5 AA batteries and the Raspbery Pi and arduino are powered by a portable battery bank through a micro usb cable. You can see a wiring diagram for Toasty below, minus the Raspberry Pi. + +Toasty Wiring Diagram + +## Future Augmentations +In the future I'd like to give Toasty a proper platform to hold the components that isn't just an Extra Toasty Cheez Its box glued to the frame. Also, the main feature I'd like to add would be hooking up a camera to the Raspberry Pi and implementing some basic OpenCV or computer vision functionality to make Toasty a bit "smarter." + +## GitHub +Checkout how Toasty works below. + +[Toastys GitHub](https://github.com/ZacharyRJohnson/BC-Car) From 844feed0fa67e00599d1e37f6b9d8ff7523bcdc5 Mon Sep 17 00:00:00 2001 From: Zachary Johnson Date: Thu, 12 Apr 2018 14:22:35 -0400 Subject: [PATCH 2/2] Update 2018-04-11-toasty.md --- _posts/2018-04-11-toasty.md | 1 - 1 file changed, 1 deletion(-) diff --git a/_posts/2018-04-11-toasty.md b/_posts/2018-04-11-toasty.md index ad3a40d..e750357 100644 --- a/_posts/2018-04-11-toasty.md +++ b/_posts/2018-04-11-toasty.md @@ -14,7 +14,6 @@ author-bio: First Year Computer Science Student at RIT author-email: zrj5139@rit.edu author-social: github: https://github.com/ZacharyRJohnson - linkedin: --- ## Summary