SCROLL

finalProject 0000 0001 CAD 0010 cutting 0011 programmer 0100 3Dprinting 0101 elecDesign 0110 makeBig 0111 embedProg 1000 moldCast 1001 inputs 1010 outputs 1011 networks 1100 machine 1101 interface 1110 wildcard 1111 notes

1001

Input Devices

Individual Assignment:

Group Assignment:

Group Assignment

hands

 

squiggle

 

Analog:

screen

 

box

 

 

Individual Assignment

One of the sensor options for my final project is a circle of sonar proximity sensors. I am going to try to get the basic hello.HC-SR04 board working. This board is simpler than the hello.world board I worked on a few weeks ago.

 

Board Drawing

Parts (eagleFab library):

ATTINY45

AVRISPSMD

10K OHM RESISTOR

1uF CAPACITOR

HC-SR04 SONAR SENSOR

 

Here are the parts laid out in my eagle schematic. I could not find the sonar sensor part in libraries, so I will just draw the pads in manually.

 

parts

Connected up (minus the sonar sensor). Note, even though the sonar part is not present in the schematic, it is important to net and name the pins it will be connected to (PB3, PB4). If you do not, you will not be able to draw traces from those pins to the rectangles you add in to act as pads for the sensor.

Also, where connecting wires to your self drawn rectangles, Eagle may stop you from drawing a wire right onto a pad. Instead draw the wire as close to the pad as allowed and then use the move tool to drag the trace longer and onto the pad. Alternatively you can drag the pad onto the wire.

conn

 

red

 

Images for mods:

Traces

sonarTraces

Outline

sonarOut

 

Milling & Soldering

I milled, soldered and programmed the board as per past weeks. The programming took a few extra steps than last time.

boards

 

progress

Just need to add the FTDI connector and the sonar sensor.

The pins on the sensor are too long and at an awkward angle for securely soldering onto the board.

long

 

angle

 

I'm going to bend out then snip the legs so that they can be securely soldered to the board.

 

snip

 

Complete:

fin

 

complete

Programming

Ran make -f hello.HC-SR04.make

Tried the make-fuses command but kept getting an error saying no "target".

I read through this handy guide I noticed that I do not have these lines:

in my make file... maybe I don't need to run the sudo make -f hello.HC-SR04.make program-usbtiny-fuses command at all.

Going to skip it and run

sudo make -f hello.HC-SR04.make program-usbtiny

Loading the program onto my board seems to have been successful

Now trying to run it with CoolTerm following the steps from electronics design week. (Selecting port and baud rate of 115200 (this turned out to be wrong, should be 9600))

Strange output (incorrect baud rate selected):

Screen Shot 2019-11-02 at 10.24.15 PM

 

I want to get the cool GUI visualization that Neil showed in class. Time to do some digging.

Downloading the hello.HC-SR04.py file from here

Running python hello.HC-SR04.py

Some errors I corrected one by one - most seem to be coming from the fact that I'm running python 3.7.1 rather than 2.7 which has some syntactical differences.

Now retrying python hello.HC-SR04.py but I need to add the serial port as a command line argument. Only problem is I do not know what exactly the port is nor how to find out.

I remembered that in coolTerm options there was a port field in which I selected usbserial-FT9PFE7K

Trying full command: python hello.HC-SR04.py usbserial-FT9PFE7K

Returned an error saying "No such file or directory: 'usbserial-FT9PFE7K"

Clearly I need to find the actual name of the serial port... to Google I turn

Found this, suggesting I first use ls /dev/tty.* to find the serial port.

Then use screen /dev/tty/.[yourSerialPortName] [yourBaudRate] to read the port

So the command I'm going to try is: screen /dev/tty.usbserial-FT9PFE7K 9600

Which gives me this wacky output as I move my hand closer to and away from the sonar sensor:

Screen Recordings:

 

 

Going to re-try in CoolTerm now with the proper baud rate selected

Now trying with the original python command except python hello.HC-SR04.py /dev/tty.usbserial-FT9PFE7K

YESSSSSS!!!

Moving my hand closer to then away from the sensor causes the display to read:

I found the sensor to be accurate within 1cm up to ~135cm. However I was bouncing the sound waves off of a concrete floor. I imagine it would be much less accurate on softer materials and materials not perpendicular to the direction the waves coming out of the sensor are traveling.

 

Concise Instructions

If and only if using python 3 (check using python --version in terminal):

 

If you don't have serial package downloaded:

 

Run ls /dev/tty.* and copy the /dev/tty.usbserial-FT9PFE7K (or what ever alphanumeric sequence you get)

Run python hello.HC-SR04.py /dev/tty.usbserial-FT9PFE7K (where /dev/etc... is the port name you copied)

Voila

 

FIN