September Sparks - Techshed Frome Meetup [25th Sept 2019]

We have some digital electronics kit for members to work with in the space - planning to get people intoroduced to Arduino this week to show how simple it is to get started with interactive electronics.

The idea is to get everyone a up to speed, then move on to connected devices.

This should give us a decent base for collab on up-comming community projects around environmental monitoring and interactive widgets for the space.

Weekly open/casual meetups for making, networking & general collab.

Wednesdays 7-9pm, Welshmill Hub, Frome.

2019-09-25 19:00

Digital Electronics

We’re going to be walking through some basics of digital electronics using Arduino - a simple microcontroller allowing you to get to grips with the basics of controlling electronics with code.

Many people see electronics intimidating or some kind of magic…

We want to create some useful/interesting interactive items for the Techshed to help people to get past that and see how simple interactive devices can be, so they can create things of their own.


Setup/Equipment

We now have some Arduinos, breadboards and other bits for use at sessions, but if you have your own kit - feel free to bring it.

Behold: our stuff!

Arduinos are beginner-friendly type of microcontroller - a programmable electronic chip used to control and receive input from other electronics.

Not only are they a great entry point into digital/programmable electronics, they’re a simple way to prototype electronic devices and can make some really useful kit (if you don’t believe me, take a look at some projects Hackaday or Instructables or look at some of the devices for sale by makers on Tindie for some inspiration).

Arduino also has it’s own development environment - an app with a text editor and tools for managing connections to your devices, that runs on your computer. There’s a bunch of support for 3rd party microcontrollers (like the ESP series of microcontrollers [with WiFi] and smaller devices like the DigiStub USB device) which we’re likey to work with in some projects.

Note

If you have your own laptop feel free to bring it along, but please go ahead and set up the Arduino development environment before Wednesday to makes sure we have more time in the session.

Session Info

We had a fair amount of kit to unpack and organise, but we did get around to some wiring and code.

In terms of prep for these sessions, the resources below should get you up and running.

  • Download the Arduino Development Tools
    • Install Arduino IDE (Integrated Development Environment)
  • Download code samples and PDF from Elagoo
    • Unzip the files into an easy to find location
    • Open the PDF titled 37 SENSOR KIT TUTORIAL FOR UNO AND MEGA v2.<some numbers>.pdf and take a quick look at the sorts of projects that can be made with the kit we have available.
    • If you had any issues setting up the Arduino environment

The projects in the PDF are just a bit of a taster - combining different sensors and actuators into interactive tools, devices and objects is where things start to get interesting.

As an example project, we looked at “Lesson 4 Temperature and Humidity Module”

Temperature and Humidity Module

Sensors

The kit contains a temperature and humidity sensor for basic environmental monitoring.

There’s an example sketch (the main .ino code files in Arduino are known as “sketches”) in the code samples you downloaded from Elagoo.

It works really well (if, unlike me, you pick the correct sketch to run the sensor).

The code below takes a reading from the sensor and writes it back to the serial port so you can read it in the “serial monitor” in the Arduino IDE. In a more real-world use, you might be sending out environmental data periodically, or using temperature changes to trigger contol systems like starting fans, or closing the blinds on a window!

//2018.6.28
#include <dht_nonblocking.h>

#define DHT_SENSOR_TYPE DHT_TYPE_11
//#define DHT_SENSOR_TYPE DHT_TYPE_21
//#define DHT_SENSOR_TYPE DHT_TYPE_22

static const int DHT_SENSOR_PIN = 2;
DHT_nonblocking dht_sensor( DHT_SENSOR_PIN, DHT_SENSOR_TYPE );

void setup( )
{
  Serial.begin( 9600);
}
void loop( )
{
  float temperature;
  float humidity;

  if(dht_sensor.measure(&temperature, &humidity)){
    Serial.print( "T = " );
    Serial.print( temperature, 1 );
    Serial.print( " deg. C, H = " );
    Serial.print( humidity, 1 );
    Serial.println( "%" );
  }
}

That’s just quick entry into writing code for electronics. Hopefully it sparks off some ideas and gets you thinking of creative ways to use technology.

See you next time!

The Techshed Team

Notes:

  • Baud (port speed) should be set to 9600 when working with the Arduino Uno board to make sure the serial monitor works correctly.