---

Showing posts with label monkmakes. Show all posts
Showing posts with label monkmakes. Show all posts

Thursday, June 14, 2018

Cuban Makers at "Copincha" in Havana

Last week I found myself in front of a room full of Cubans in Havana, delivering a course on Arduino in broken Spanish. Was this a variation on the kind of dream where you are sitting down to an exam without having done a stroke of revision? Or the dream where you find yourself at work having forgotten to put on your trousers? 
The sequence of events that led to this radical departure from my comfort zone - not so much stepping outside it, but more waving it goodbye and jumping on a plane - started a couple of years ago when I was contacted by Jonnet who had seen a Spanish language edition of one of my books and wanted to borrow it for her Cuban partner Mauri.
Mauri and Jonnet were keen to establish some kind of makerspace in Havana to provide a place for local makers could come and share ideas, tools and resources. Cubans, by necessity, are an inventive and creative group of people. Resources are scarce and so a make-do-and-mend culture is totally natural to them. If ever there was a race of makers, it is probably the Cubans.
My wife Linda and I have been learning Spanish for years despite little evidence of success. We also spent our honeymoon in Cuba and have very fond memories of the country. And so, to cut a long story short, in a rash moment I volunteered to run an Arduino course at their makerspace when it was up and running. And a year or so later, that is how I found myself in front of a group of Cubans, talking about Arduino in Spanish.
Mauri, the driving force behind the makerspace also lives in the house containing the makerspace in quarters above the two rooms that make up the space.  The space is called "Copincha" - "pincha" is Cuban slang for "work" and so "copincha" is a way of saying "co-work".
Mauri and friends have used scrap wooden packaging cases to make box stools for sitting on as well as large work tables with table-tops that are removable to reveal ample storage space for tools and supplies to make best use of the space. There's probably ten square meters of table top and maybe twenty stools for sitting on. That is quite some labour of love!

My Arduino course was the first course to be run at the makerspace and since we had mixed levels of ability, with some very skilled Arduinoistas, I ran introductory Arduino lessons in the morning and in the afternoon offered "consultations" to the advanced groups who had projects that they wanted to work on.
I brought Arduino compatibles (actually MonkMakesDuinos) together with basic component kits and breadboards with me but the course relied on the students having access to a laptop to program the MonkMakesDuinos. In true Cuban style, this involved a fair amount of borrowing and inventive solutions. For example, one student used a homemade Raspberry Pi laptop to program the Arduino. Another used a Windows tablets with a pop-up keyboard. With sharing and cooperation everyone was able to participate.
I am very pleased to hear that the course is due to be repeated in July (when many Cubans are on leave from their day jobs). This time, the course is being delivered by Yusinier, one of the local experts at the course who amongst his many skills in art and technology has taught Arduino to university students.
The course and supporting code is available as open source on GitHub here and I would very much welcome any pull-requests to improve the Spanish.
Here are just a couple of the things that the course attendees made during the course:
Juan, a retired mechanical engineer with a passion for replica cars, worked on adding automation to a fibre-glass modelled replica he was building from scratch.

The chassis of the car was built to use a single gear-motor as rear-wheel drive and a servo motor to control the steering. This was combined with an ultrasonic range-finder to detect obstacles and invoke an avoidance function that involved a randomly chosen turn to the left or the right, followed by reversing. The design also included automatic brake lights. The steering mechanism was made entirely from waste pieces of plastic and skilful use of a Dremmel.
Juan has an enormous collection of vintage model cars that he restores, some of which are for display and some for sale at a shop he runs with friends, at San Lázaro 1060 entre San Francisco y Espada - somewhere around here.
Yusinier is a visual artist and film maker and amongst other things has to devise his own props, such as remotely triggered fake bullet strikes. He often uses Arduino and his project during the course was the controller for a motorized camera dolly.




The attendees at this first course at Copincha were: Sergio Valdés García, Yusnier Mentado Fernández, Lisa Gómez Blanco, Juan Infante, Alberto José Quesada Madrigal, Javier Quesada Madrigal, Os Leans and Jossue Arteche .

In England, when I need components, an Arduino or a cheap module from China, all of these things are easily obtainable with a few clicks of a mouse. This is not so easy in Cuba. For most Cubans a £30 Raspberry Pi represents more than a months pay. Even if they want one, they cannot just order it from Amazon or any of the other sources that we take for granted. Typically, getting such things into Cuba relies on visitors to Cuba like us bringing things with us when we visit. Donating things as personal gifts to Cubans. Visitors to Cuba are advised in the guide books to bring crayons, bars of soap and Lego as gifts so why not things for makers?


Perhaps if you are planning a trip to this beautiful country and will be visiting Havana, you could contact Mauri (maurice.haedo@gmail.com) and see if he could make use of a few Arduino clones, or eBay specials for "Copincha". If you do, you will be assured of a warm welcome a great coffee and a glimpse behind the scenes of  this amazing country.

Sunday, January 22, 2017

On Switch for Raspberry Pi

When you gave finished using your Raspberry Pi, you should really shut it down, otherwise, its possible to corrupt the SD card image which would mean you having to reinstall Raspbian. Having shut-down your Raspberry Pi you can get it to boot up again by unplugging and plugging the USB lead, but a neater solution is to add a reset button to your Raspberry Pi.

Most models of Raspberry Pi have a connector just for this purpose.

  






You will Need

* 2 pin header
* A push button with female header connectors.






For the push button, you can either use a scavenged reset switch from an old PC, or, as I have here, a MonkMakes Button, which is sold as a twin-pack on Amazon.com or Amazon.co.uk.








Construction

First of all, you need to identify the two holes in your Raspberry Pi board that you need to make connections to. These are circled in yellow in the figures below, for the Raspberry Pi models that I have. The location of this has moved with pretty much every Raspberry Pi release. The two pins will either be labelled RUN or P6

Raspberry Pi 3 model B


Raspberry Pi 2 model B


Raspberry Pi model B ver 2


Raspberry Pi Zero


Raspberry Pi A+




Having found where the pin headers need to go, if you have soldering equipment, then solder the pin header into the socket as shown here:




If you want to avoid soldering, then you can do so as follows. First push the plastic part of the header pin down as shown below:



Then push the header pin through from the underside of the board and push the header sockets of the MonkMakes Button into the header pins so that the Pi is the filling in a header sandwich. As long as the switch is not moved around too much, it should stay connected and make a reasonable contact, but soldering is better if you can.


Shutting Down and Starting

To test out your modification, power up your Raspberry Pi and then shut it down, by selecting Shutdown from the raspberry menu.



Then select the option Shutdown.



After a while the screen will close down and the Pi will go into a 'halt' mode, where it uses minimal power and is basically in standby mode.

Now to start your Pi, all you need to do is press the button and it will start to boot up!



If you liked this article, you will probably like my Raspberry Pi books:

 






Friday, September 25, 2015

The Phobot board and Stepper Motors

The MonkMakes Phobot motor controller board is designed primarily to control a pair of DC motors, to make roving robots that can be controlled over the Internet using the Particle Photon Arduino-ish IoT module. However, you can also use it to drive a bipolar stepper motor.



The stepper motor I used was this 12V motor from Adafruit.

Wire one coil of the stepper (yellow and read wires for my motor) to the M4 screw terminals and the other coil (gray and green) to M3. You will also need a 12V DC power supply wires to screw terminals GND and Vin on the Phobot board.


The Phobot will provide 12V to the stepper motor, but also provide a regulated 5V supply to the Photon, so your Photon's USB port does not need to be connected.

All that remains is to write some code. So log into particle.io and then start a new App. Paste the following code into it:

#include "PhoBot/PhoBot.h"

PhoBot p = PhoBot(12.0, 12.0);

void setup() {
}

void loop() {
    forward(100, 5);
    reverse(100, 5);
}

void forward(int numSteps, int period) {
    for (int i = 0; i < numSteps; i++) {
        p.setMotors("M3-F-100");
        p.setMotors("M4-B-100");
        delay(period);
        p.setMotors("M3-F-100");
        p.setMotors("M4-F-100");
        delay(period);
        p.setMotors("M3-B-50");
        p.setMotors("M4-F-50");
        delay(period);
        p.setMotors("M3-B-50");
        p.setMotors("M4-B-50");
        delay(period);
    }
}

void reverse(int numSteps, int period) {
    for (int i = 0; i < numSteps; i++) {
        p.setMotors("M3-B-100");
        p.setMotors("M4-B-100");
        delay(period);
        p.setMotors("M3-B-100");
        p.setMotors("M4-F-100");
        delay(period);
        p.setMotors("M3-F-50");
        p.setMotors("M4-F-50");
        delay(period);
        p.setMotors("M3-F-50");
        p.setMotors("M4-B-50");
        delay(period);
    }
}

You will also need to add the PhoBot library to the app, by selecting the Libraries button on the Particle IDE and then search for Phobot. Click on the INCLUDE IN APP button to add the library to your new app.



Click on the lightening bolt to deploy the app to your Photon. As soon as the app has finished installing, the motor should start turning, first in one direction and then the other.

Try changing the value of the second parameter to forward and reverse in loop from 5 to 10 and the motor will turn at half the speed. You can also try altering the number of steps (the first parameter).

Note that a period of 5ms is a little fast for this motor, so if you want to avoid steps being missed, it probably needs to be 10ms or more.

You can buy the Phobot board from Seeedstudio Adafruit and also find it on Amazon.com and Amazon.co.uk.