Showing posts with label junk bot. Show all posts
Showing posts with label junk bot. Show all posts

Friday, 22 January 2016

mini-projects: Raspberry Pi , Python, Pimoroni ExplorerHat Pro to build a Junkbot (revised)



Junkbots (http://junkbots.blogspot.co.uk/) are based around using  materials such as drink's cans, broken propellors and motors to produce something that moves by vibration. Previous designs can be found at:



The latest tweak to the Raspberry Pi based Junkbot design is to use the combination of Python and Pimoroni's Explorer HAT PRO to control it. Explorer HAT Pro is a good choice, it can control two motors with a library provided to simplify the programming. For this the Junkbot was the one shown above: a drinks can, pen, LEGO bits, motor and broken propellor.

Before the Explorer HAT can be used the library needs to be installed via the Terminal and the instructions below

curl get.pimoroni.com/explorerhat | bash

Python code to control the junkbot is shown below.


import explorerhat
from time import sleep

def spin1(duration):
    explorerhat.motor.one.forward(100)
    sleep(duration)
    explorerhat.motor.one.stop()

def spin2(duration):
    explorerhat.motor.one.backward(100)
    sleep(duration)
    explorerhat.motor.one.stop()

spin1(1)
spin2(1)

Essentially the code spins the junkbot one way and then the other.

One extension thought understand consideration, is to use a Raspberry Pi Zero and Pimoroni Explorer pHat (https://shop.pimoroni.com/products/explorer-phat) and carry it on the junkbot.

If you do use or modify please leave a comment, I would love to see what others do with it.


 All views and opinions are the author's and do not necessarily reflected those of any organisation they are associated with

Wednesday, 27 August 2014

Raspberry Pi Junk robot in action

Video showing a Raspberry Pi controlled 'junk' based robot, junkbot, in action. All controlled, via a RaspberryPi, by Scratch or ScratchGPIO programs.




More information about this project can be found at:
http://junkbots.blogspot.com/
http://www.facebook.com/junkrobot


Related Links

 




 



If you would like to know more about the Junkbots project contact scott.turner@northampton.ac.uk. The views and opinions are the authors and should not be taken as representing the views of any organisation the author is associated with.

Friday, 15 August 2014

Raspberry Pi Robot from junk


Figure 1
In previous posts the idea of adding some programming into the a 'bot' made of junk, a junkbot, was briefly discussed (http://computingnorthampton.blogspot.co.uk/2014/07/physical-computing-junkbots-with-brain.html) and the use of LEGO to do this was discussed in a recent post (http://computingnorthampton.blogspot.co.uk/2014/08/controlling-lego-junkbot.html)

In this post the aim is to discuss using a Raspberry Pi and Scratch to do this. Including:
- Choice of motor controller card for the 'bot'
- Provide an example of a drawing junkbot controlled through Scratch and Raspberrry Pi


Choice of interface/Controller card
The card choosen was the 4Tronix PiRoCon card  (http://4tronix.co.uk/store/index.php?rt=product/product&product_id=182). Selected for four reasons
- Price is reasonable (in my opinion).
- Fits straight onto the Pi through the GPIO - no extra cables needed.
- ScratchGPIO has it as an addon so it makes programming it even easier (see http://cymplecy.wordpress.com/2013/10/31/pirocon-from-4tronix/).
- Others are using it for robot projects.

Use it is quite easy plug the board directly on to the GPIO connector of the Raspberry Pi (4tronix provide some advice in section 15 of http://4tronix.co.uk/blog/?p=22 on mounting the board). The only other changes that were needed were because the motors were not powered through the DC input jack, changesto the jumper settings next to Vin Connector (see http://4tronix.co.uk/blog/?p=41 for layout)  were neededto reflect this.



Example: Drawing Raspberry Pi Junkbot
Now for the fun bit get the whole thing to draw (see Figure 1 and the video at the end)!

The junkbot itself is made up of a drinks can, three supports (we used LEGO here but it equally could be straws, sticks), a pen/pencil, and a  motor and broken propeller combination to create an unbalanced motor.

With the Raspberry Pi off, the the motor's wires are connected to the controller card at the connections for MotorA and the battery is also connected. Turn the Pi on and run ScratchGPIO5plus.


Figure 2
Figure 3





Figure 4















The first task is to make the variables AddOn (which will be used to tell the program we are using the PiRoCon card) and MotorA for the motor (see Figure 3).

In Figure 4 the program can be seen, essentially the left and right key spin the junkbot clockwise or anticlockwise by setting the Motor to either +ve or -ve values from 0 to 100. The space bar is used to stop the motor.

As it moves because one of the supports is a pen it draws. See the video below to watch it draw a squiggly line - control is still a challenge.
 The bot was developed by Hayden Tetley and Scott Turner. Hayden's time was paid  for through the Nuffield Research Placements  Scheme (http://www.nuffieldfoundation.org/nuffield-research-placements).

Related Links

 




If you would like to know more about the Junkbots project contact scott.turner@northampton.ac.uk. The views and opinions is the authors and should not be taken as representing the views of any organisation the author is associated with.

Thursday, 2 January 2014

Robot Day videos

Videos and comments from the Robot Day at Hartwell Primary School can now be found at the following link
 Robot Day! | Class4 2013

Quote from the page "The whole class had a fantistic time and really enjoyed the challenge."

For more information about the activities go to http://computingnorthampton.blogspot.co.uk/2013/12/robots-in-hartwell.html




Tuesday, 2 April 2013

junkbots goes south again


During National Science and Engineering Week 2013, as part of the activities provided by the University of Northampton, the Junkbots project, run by a member of the computing team, returned as part of programme of activities to South End Primary School, Rushden, Northamptonshire, UK. 


National Science and Engineering Week is annual event celebrating science and engineering activities (http://www.britishscienceassociation.org/national-science-engineering-week)

Last year during the same week Junkbots also formed part of the activities (see http://junkbots.blogspot.co.uk/2012/03/junkbots-goes-south.html). The junkbots project is run by the computing team as part of the team's work on problem-solving skills (for example: http://computingnorthampton.blogspot.co.uk/2012/06/teaching-and-learning-journal-papers.html)




This time we worked with two classes - a year 2 and a year 5 class; building the drawing junkbot. Examples of previous drawing junkbots are shown above. Approximately 50 children took part across the two 45 minute activities.

Essentially a drawing junkbot is based around a drinks can that:
- draw patterns without anyone touching it;
-carried the battery pack or not depends on the age of the group;
-moves by shaking a can using an unbalanced motor with 'legs' make from pens.


Related links



If you would like to know more about the Junkbots project contact scott.turner@northampton.ac.uk