She Codes Brighton is a social meet up group for female developers co-organised by Happy Bear Software developer Rosa (me) along with Wendy Armstrong and Seren Matthews. In September 2015 She Codes held an event under the umbrella of The Brighton Digital Festival..
Entering its 5th year, the Brighton Digital festival aggregated more than 140 events across the course of September. The festival makes for a great opportunity to meet like minded people and delve into something new, as there are multiple events held every night across the city.
In discussing ideas for our event, She Codes members expressed that they wanted to learn hardware skills to couple with their coding knowledge. Having an understanding of how to build projects with hardware would mean that we could diverge from creating interactions solely via screen which would open up new development possibilities.
As much as it might feel like an irritating buzzword ‘The Internet of Things’ is becoming increasingly difficult to ignore. The Internet of Things is a vision of technology slithering into our lives in a way that lets us interact with day to day objects for greater convenience.
The idea is to inject physical objects with digital behaviours; from Amazon Dash buttons attached to our cupboards to send more powder when supplies are diminishing, to sensors built into parking spaces to prevent us cirlcing the car park over and over again.
Coupling physical interactions with digital APIs opens up the imagination to a new world of possibilities. There is of course a downside - technology breaks often and the more dependent we become on it, the more stuck we become when it doesn’t work. Cybercrime is also a problem and of course the discomfort people may feel in corporations knowing more about their day to day interactions if not using this information for the greater good.
It is an exciting area with a lot of potential. To start exploring we opted to focus the workshop on learning to use Arduino.
Aruduino is comprised of easy to use hardware and software. It can be used to read inputs such as light or temperature (picked up by sensors) or a even things like tweets. An output is then generated from the input.
I had used Arduino a while ago but I had found myself at a point where if I wanted to try and build something more advanced, that I could follow a diagram and get something to happen but I wasn’t overly sure why it was working. Essentially I was just copying which isn’t useful for debugging if something does go wrong. Therefore in this workshop we wanted to make sure we discussed each part of the process in some depth rather than focusing on building something more impressive but not really understanding the components.
Alex Hosford, a director at Build Brighton joined us for the workshop and beforehand to put together the material. Build Brighton is a communal workshop and collective of over 100 makers, designers, tinkerers, hobbyists, engineers, artists and hackers who love to build stuff. They have loads of awesome equipment and an open evening every Thursday to drop in if you are interested in finding out more.
Remy Sharp, founder of Leftlogic kindly donated 9 Arduinos and lots of wires and components to She Codes and Codebar. This was a great help and we used them all on the night.
We began the workshop by discussing the ‘Maker Movement’.
The Maker Movement is the collection of millions of people with a shared interested in making their own projects or products. Thanks to the affordability and availability of equipment such as Arduino or 3D printers, people are able to manufacture and sell their own products. This diminishes the need for external manufacturing. As this notion increases it is set to have an impact on the economy in a way that may shift the powers back from large retailers to smaller independent companies.
This becomes even more interesting if we consider that people could one day generate their own energy and free themselves from contracts with corporate energy companies. Grace Choi the CEO of Mink is developing a product that people can use to 3D print make up. Instead of buying a new lipstick from a store, people could choose any colour and print their own. This(and similar use cases) would have a huge impact on the economy and is likely to mean that large corporations will need to apply greater focus to factors such as their energy impact, customer relations and promoting social justice in order for people to opt to use their products.
To begin the She Codes workshop we watched a section of this TED talk by Massimo Banzi a co-founder of Arudino. He speaks about interesting projects that people have built using Arduino. These ranged from a fun project to silence a TV when the names of certain TV Personalities are mentioned, to a start up that have built a business using an Aruduino based robot to fly medical supplies between remote villages in Africa. He also mentioned a group of people in Japan who wanted to provide unbiased data as they felt they could not trust government information. They created Geiger counters (an instrument used for measuring ionizing radiation) and posted the data online for the public to view.
A key take away from this video is that Arduino is completely open source. This is so that people can better understand how the hardware works and can make and share those changes. The software is also open source. The source code for the Java environment is released under the GPL and the C/C++ microcontroller libraries are under the LGP.
We began by looking at the boards and discussing the different components.
Here is the link to the official description of the boards the majority of us used on the Arduino website.
The key take aways were:
The Chip
- This is where the programs we write for Arduino are uploaded to. The chip is very small but luckily the Arduino language is very clever and compiles programs down in a way that they take up minimal space. Only one program at a time can be stored on the chip. This program then sends information to the pins on the board.
The Pins
Digital I/O pins
- Inputs are used to read information from sensors whereas outputs are used to control actuators (motors used for controlling a mechanism or system). Whether you want the pin to act as an input or an output is determined in your Arduino program.
Analog In pins
- Used for reading voltage measurements from analogue sensors. This is in contrast to digital inputs which can distinguish between only two levels HIGH and LOW. Analogue inputs can measure 1024 different levels of voltage.
Analogue Out pins
- Provide analogue output (are actually 6 of the digital pins).
5vts
- This is set to 5volts. In the Arudino code, if a pin is set to HIGH it is sent 5 volts). LOW means the pin will be set to 0 volts. HIGH and LOW are pretty much used instead of ON and OFF.
gnd (ground)
- This is set to 0volts.
This is important because electricity flows from the place of highest potential difference to the place of lowest potential difference. Ground effectively ends the circuit.
We discussed how electricity flows through a circuit using the water analogy.
Imagine that:
- Resistor = a restricted pipe
- Wire = pipe
- Charge = water
** How does the voltage effect the current? **
When we increase the voltage, the current flowing through the circuit will increase (same as increasing water pressure at a pump and the flow rate increasing).
When we increase the resistance the current will decrease. If a pipe is small then there will be more resistance as there is less space for water to flow so it slows down.
We need resistance to prevent a short circuit (the component blows up due to not being able to handle the current).
The Arduino is connected via USB. Information is sent to the chip via Serial Port. Serial Port basically sends information in one direction and then back in another.
We downloaded the Arduino IDE so that we could start writing programs to send to the chip. The Arduino language is designed to be simple and is modelled on a language called Processing. When code is uploaded to the board it is converted into C and then passed to an avr-gcc compiler.
We selected the port and the board and uploaded the Ardunino blink example sketch so make the first physical connection between the code and the board.
SCREEN GRAB OF BLINK EXAMPLE
An Ardunio program (often referred to as a ‘sketch’) must contain these two functions:
void setup()
{
/* This code runs once at the beginning of the code execution. This is where you would define which pins you want to use.
}
void loop()
{
/* this code runs repeatedly over and over as long as the board is powered. */
}
Next we looked at the breadboard. Alex explained that is is called a breadboard as people used to literally nail circuits to breadboards (the ones used to slice bread on) when prototyping. He demonstrated how the rows of holes connect using an ammeter which bleeped when a connection was made. He then showed us how components must be placed within these holes so that the flow through the board is not broken.
Picture of breadboard
We then started building our first circuits.
The workshop material can be found here and was kindly written by recent Computer Engineering graduate Ben Kazemi.
The schematics can be found here.
Schematics visually represent how a circuit is put together. Example One includes symbols which represent an LED, Resistor and Ground. They are connected by lines which represent wires. There are many schematic cheat sheets available online which display a vast array of symbols. Here is an example!
- LED
LED stands for Light Emitting Diode.
Here is AN IMAGE OF ONE (taken from rapidonline.com).
It is important that the LED is placed the correct way around in the circuit due to its polarity. One of the wire legs of an LED is usually longer than the other. The long leg is the anode (which has a positive polarity in a diode) and the shorter leg is the cathode (negative polarity). Alex showed us that even if someone had used wire cutters on the LED to make the legs the same length, you can tell them apart by peering inside the coloured plastic casing. Inside are two little metal shapes, each attached to a leg. The bigger shape is attached to the cathode.
Because electrons flow from positive to negative potential, the longer leg needs to be taking the incoming flow and the cathode needs to be placed so that the electrons will be headed towards the ground.
- Resistor
The resistor's ability to reduce the current is called Resistance and is measured in units of ohms (in the schematic for examples 1&2 100R means 100ohms). We can work out what the resistance of a resistor is by looking at the coloured bands on it. These colours correspond to the numerical values.
This website gives a great example of what a 100R resistor looks like. The coloured bands go Brown = 1, Black = 0, Brown = 10 (multiplier), Gold = 0 (tolerance).
The first two colours are put together (NOT added together just kind of pushed together to make a 2 digit number) to make 10, this is then multiplied by the multiplier (10) to make 100. There are lots of online resistance calculator tools available if you are wondering what the resistance of your resistor is. Here is an example..
We found there was some lee-way and we didn’t need to use exactly 100R but if the resistance was too high then it prevented the light from flashing.
We then worked further through the material. We experimented with changing parameters in the code and discussed how Ben had made the code examples more efficient as they were along.
The session served as a really useful introduction for laying the foundations of using Arudino. Even to build relatively simple circuits there is still a lot of information to process at each part of the chain; from writing the code, to how it physically communicates with the Arduino to each component in the circuit and how it will effect the flow of the electrons to enable the desired result.
If you are interested in experimenting with physical computing I would highly recommend Arduino. There are plenty of kits online (check out Ada Fruit and Spark Fun for tutorials and project ideas). Arduino also works well with languages such as Processing and Max MSP. You may also find it useful to a find a hack space or maker group in your local area.