TrumpyBot- Building a Twitter Bot

Well, I had a solid half-hour before practice and decided to build a twitterbot.

(You can follow him at @trumpybot)

I had him set up on a crontab but then decided to make my own little menu system so I could cycle through the poorer generated tweets.

(Following this tutorial closely: http://jitp.commons.gc.cuny.edu/make-a-twitter-bot-in-python-iterative-code-examples/)

Essentially, the code takes 20 or so trump-isms, goes through some adjective and noun repositories on GitHub, and then creates a madlib with some random generation, spitting out interesting results.

From there, tweepy handles the rest. Doing this in Python made things really easy!

Screen Shot 2016-10-15 at 5.35.40 PM.png

my tiny Python menu system, and the result:

Screen Shot 2016-10-15 at 5.36.09 PM.png

Advertisements

Raspberry Pi RetroArcade

This will be a series of posts documenting my progress on a retro arcade. Here is a link to the Hackaday.io page: (Link)

Here is the page itself:

Hi, all!

I’ve been working on this project for several weeks now and I’m just getting around to posting it here on Hackaday.io

I started by shopping a case out of wood, sanding some of the rougher edges into rounded sides, and carving in an indent to mount the screen. Ended up using those little picture frame clasps to secure the screen.

From there I spray painted the body and cut out a stencil for some sticker paper and sprayed down a piece of plexiglass that I sanded with fine sand paper for diffusion.

I was able to tie all the components together and have a generally operational setup:

Then I shoved it all into the case, added a kickstand and clasps to secure the screen:

So I started to test the thing, and I realized that there was a colored square in the upper right corner of the screen when running the device. I read that this was a sign of low power. I went and designed another case in Sketchup to see if I could manage some better spacing and heat dissipation:

And that was actually pretty fun because I have minimal experience in CAD programs. Didn’t struggle too much with this though because I have hefty experience in Blender3D.

So I redid the power circuit to see if my switching mechanism was weird and struggled alot with the new design. I kept having odd issues, and eventually consulted a forum. We settled on this solution:

However, now the circuit behaves in really strange ways. For instance:

When I plug in the circuit to power, everything works fine, 5V coming out of the end of the relay. However, once I connected a load (Either the LCD driver board or the RPI), the voltage output drops. Then, once the load is disconnected *the voltage output remains low (1.8V or so)*. I’ve never seen this behavior before in a circuit. What could be the issue?

I Made a Car That Doesn’t Work

It always comes back to the Legos.

I’ve been wanting to prototype some kind of four-wheeled rover since I got my hands on my first microcontroller three years ago. Robotics has always been the goal. I learned a lot and eventually got to a point where I could attempt it.

But where to start? Cardboard is usually a nice option, and tape and paint sticks looked good too, but I can’t ignore the Lego pieces I failed to sell at the garage sale when most of them left me. I have a bunch of Lego Technic pieces sitting around, and so I decided to build the chassis from them.

Steering Mechanism

The two images below helped a lot with the construction of a wheel-driven steering mechanism. I didn’t have a flat piece with gear teeth, but I noticed that the same effect could be achieved by using a hard connection on the diameter of the wheel to the shaft (Much like those things on train wheels).

4bigejedelantero252812529

The result of this sits below. Note that in the poorly-focused image the wheel is pointing on the z-axis, and I eventually modify it to face y.

Screen Shot 2016-06-02 at 4.04.53 PM

The Drive Train

This part was only difficult because real-world parts don’t always mix well with Legos. Much hot glue was employed, and I ended up gluing a connector piece to the motor shaft, extending the axle from there. I used a small gear on the motor to turn a large gear connected to the back wheel axel, so that the gear ratio would produce the maximum amount of torque.

IMG_4928.JPG

Putting it all Together

Eventually, I was able to cobble everything together and use an adhesive breadboard mounted onto the back of the vehicle, putting pressure on the back wheels where the chassis was highest off the ground.

I originally intended to use a raspberry pi to drive the thing, but it seemed kind of overkill. I grabbed the ISP Backpack I created in an earlier post and had my ATTiny 85 send pwm signals from pin 0 into the servo, whilst sending pertinent data to the lovely dual h-bridge breakout from Adafruit. There are only two pins on the ATTiny capable of pwm output so this worked nicely.

Powering the vehicle was a different story. The DC motor driving the rear wheels operated off of 9V and the rest (ATTiny, servo) had a 1.5-5.0 operating voltage. I was able to very carefully solder together an LM807 voltage regulator circuit onto a small cut piece of veroboard. I used some male header pins to act as a breadboard power supply and routed the leads from the battery both to the regulator circuit and to the exposed pins of the h-bridge breakout.

Results

IMG_8895.JPG

In the end, the ATTiny was able to successfully steer and drive the vehicle. The gear ratio worked really well, and when the car wasn’t weighing itself down, the tires spun so quickly they generated wind.

However, when in contact with the ground, the motor lacked the power to move the vehicle at more than a laughably slow pace. I started this project trying to see if I could fabricate a vehicle from scratch, and I would say I have succeeded.

I could purchase a higher-torque motor, but then I’d need a battery upgrade, and then I might as well go all in and mod an RC Car.

That’s a project for another day. Cheers!