Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.

In-Depth Series

Arduino and related devices

In this series various contributors talk about how to use and program Arduino single-board microcontrollers and related devices.
See the Wikipedia article for details of the range of devices.

building an arduino programmer - Brian in Ohio | 2019-04-25

  1. intro

1.1 brian in ohio

1.2 out from under my rock

  1. motivation

2.1 ken fallon bootloader episode

  • hpr 2660
  • burned many bootloaders
  • used usbtiny programmer
  • putting together a programmer would be a good learning experience

2.2 still use arduino

  • easy to check out a new piece of hardware
  • boards are cheap and easy to find
  • boards are robust

2.3 need to run an arduino board at lower frequency

  • developing a data logger
  • write code in c using the avr open source tool chain
  • prototype on arduino board
  1. needed supplies

3.1 arduino ide

3.2 avrdude

  • use it to test the programmer outside of the arduino environment
  • part of the gnu avr toolchain

3.3 arduino nano clone - un assembled


  • look for the boards that have the unpoplated icsp header
  • make sure its a nano and not a pro-mini

3.4 3 leds 3mm or smaller


  • optional but are useful, especially the heartbeat led

3.5 3 resistors 200 ohm - small

  • if you install the led’s

3.6 1 5-10 uF electrolytic capacitor

3.7 3-4 inch long jumper wire

3.8 2x3 female header


3.9 some way to cut wire

3.10 soldering supplies

  1. howto

4.1 upload arduino isp sketch to nano


  • i modified the sketch changing where the led’s are placed
  • i put the led’s at digital 9, 7, and 5 for spacing

    #define RESET 10 // Use pin 10 to reset the target rather than SS
    #define LED_HB 9 // No change define LED_ERR 7 // changed define
    #LED_PMODE 5 // changed
  • upload the sketch

4.2 solder on led’s


  • solder the anode leg to the apropriate digital pin on the board
  • add a resistor to the cathode leg of the led (usually the shorter leg)
  • solder the resistor attached to the cathode to ground pin of the board
  • i started with pin 9
  • you can test each led before moving on to the next led
  • my soldering ended up messy but it gets the job done


4.3 modify sketch and test leds

  • you can modify the sketch
  • change the heartbeat pin to whatever led you just soldered
  • upload the modified sketch
  • the led you just soldered should pulse

4.4 clip jumper wire and attach


  • pin 10
  • used the hole on the end of the board as strain relief

4.5 add capacitor

  • watch polarity
  • no more auto reset
  • if you want to program with arduino ide, you need to push the reset button

4.6 2x3 header

                         MISO -|o o|-+Vcc
                          SCK -|o o|-MOSI
 Do not attach-Reset-|o o|-Gnd


  • remove reset connecter south-west connector
  • solder the remaining 5 pins
  • the header is soldered on the bottom of the board


  1. how to use

5.1 plug usb cable into programmer and your computer

5.2 start the arduino ide

5.3 plug programmer onto target board remember to plug the wire into the reset pin of the target

5.4 in the tools folder of the ide make sure your usb port is selected


5.5 and that in the programmer section you select arduino as isp not arduinoisp

Tools→Programmer→Arduino as ISP

5.6 at this point you can burn a bootloader as Ken described

5.7 upload a program

5.7.1 bring up the blink example sketch

5.7.2 under tools make sure your target board type is selected


5.7.3 under the sketch menu you’ll see upload using a programmer

Sketch→Upload Using Programer

5.7.4 when you select that the blink sketch will be compiled and uploaded

  1. at the command line

6.1 check functionallity

bash-4.3$ avrdude -p m328p -c arduino -P /dev/ttyUSB0 -b 19200

6.2 output

  avrdude: AVR device initialized and ready to accept instructions

  Reading | ################################################## | 100%

  avrdude: Device signature = 0x1e950f (probably m328p)

  avrdude: safemode: Fuses OK (E:FD, H:DE, L:FF)

  avrdude done.  Thank you.
  1. things to look out for

7.1 permissions issues - arch wiki gentoo

7.2 when you upload this way you overwrite bootloader

7.3 arduino ide boards.txt has some fuse errors

7.4 avrdude version 6.2 will not work

7.5 baud rate using avrdude command line

7.6 capacitor is non-optional, but makes uploading to that board non-trivial

  1. conclusion

8.1 upload via icsp vs usb serial

8.2 do you need a bootloader?

8.3 challenge to max out any 8bit microcontroller

  • if you need to do one or two things use a microcontroller i.e. arduino
  • if you need to do many things use a linux single board computer i.e. raspberry pi

Kickstarter Omega2 Plus first time setup walkthrough - Jrullo | 2017-01-27

I paid for one Omega2 Plus Kickstarter pledge. Later, as most do, the project offers upgrades. My pack was for one Omega2 plus, an OLED module, and the expansion board. After pledging I then added on another Omega2, a GPS module and a mini expansion board. Review wise, this is a good inexpensive IOT kit for any beginner. Someone that is more advanced can get into Arduino, or ESP8266 with microPython.

I mention Arduino and ESP8266 with microPython.

Really good tutorials on how to get going with microPython:

Arduino Pumpkin - droops | 2015-11-25

Code for Pumpkin

int ledPin1 = 5;
int ledPin2 = 6;
int motorPin = 8;
int lightPin = 3;
int lightVal;
int potPin = 0;
int potVal;

void setup(){
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(motorPin, OUTPUT);
  pinMode(potPin, INPUT);
  pinMode(lightPin, INPUT);
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, LOW);
  digitalWrite(motorPin, LOW);

void loop(){
  potVal = analogRead(potPin);
  lightVal = analogRead(lightPin);
  if (lightVal < potVal){

void animate(){
  digitalWrite(ledPin1, HIGH);
  digitalWrite(ledPin2, HIGH);
  digitalWrite(motorPin, HIGH);
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, LOW);
  digitalWrite(motorPin, LOW);

Arduino Bluetooth HOWTO - klaatu | 2015-10-16

Klaatu talks about the HC-05 and -06 series of bluetooth modules and how to use them with an Arduino, including some basic code on the Arduino to get it to respond to signals over bluetooth, and some basic PyQt code on how to send signals to the bluetooth device. PLUS, he talks about configuring the bluetooth so that it is connected to the serial port of your system (so that Python can use it).

A super basic bluetooth controller app can be found here: (it's Klaatu's code, and it's not quite finished, so if you have improvements or questions, feel free to comment or merge or email)

Arduino 101 Arduino IO - klaatu | 2015-01-26

In this two-part series, Klaatu introduces you to the Arduino. First, learn about the breadboard and how to make electricity course through it in order to power your very own simple circuit.

To follow along with what Klaatu is talking about, refer to these two graphics:

And here are diagrams of the simple circuits that Klaatu constructs.

image: a diagramme of the simple circuit in todays show

The simple code to reset the servo:

#include <Servo.h>
Servo myservo;

int servoPosition;

void setup()

void loop() {}

And the code that responds to input:

#include <Servo.h>
Servo myservo; 

int servoPosition;
int servoMax = 180;
int servoMin = 0;

int value;
int valMax = 600;
int valMin = 50;

void setup()

void loop() 
  value = analogRead(0);
  servoPosition = map(value, valMin, valMax, servoMax, servoMin);
  servoPosition = constrain(servoPosition, servoMin, servoMax);

And here is a bonus diagramme that you can try to create, using a light sensor, servo, and resistor.

image: homework

Arduino 101 Breadboard - klaatu | 2015-01-23

In this two-part series, Klaatu introduces you to the Arduino. First, learn about the breadboard and how to make electricity course through it in order to power your very own simple circuit.

To follow along with what Klaatu is talking about, refer to these two graphics:

And here are diagrams of the simple circuits that Klaatu constructs.

image: a diagram of the simplest circuit in todays show

image: a diagram of the switched circuit in todays show