→ 10 April 2013, Coimbra - Interface Programming.
At this point i am wainting for my next lab session and update all my electronics assignements. News soon.
12-04-2013
I'm working on changing the interface of my input devices assignement in python, doing a few tests to make it work properly and trying to know this programming language better.
20-04-2013
I Decided to make some research on tkinter programming and i made a few changes to my Input sensor interface. I changed the size of the frame, changed some collors, added a button and a grid to read the sensor activity, as you can see in the pictures above:
You can download the code here, but here it is explained
# hello.mic.45.py
#
# plot microphone audio
# hello.mic.45.py serial_port
#
# Neil Gershenfeld
# CBA MIT 10/31/10
#
# (c) Massachusetts Institute of Technology 2010
# Permission granted for experimental and personal use;
# license for commercial sale available from MIT
#from Tkinter import *
import serialNX = 400
NY = 200
nloop = 100
path = []
baseline = 0
baseline_filt = 0.02
gain = 0.5def idle(parent,canvas):
global path, baseline
#
# idle routine
#
# look for framing
#
byte2 = 0
byte3 = 0
byte4 = 0
while 1:
byte1 = byte2
byte2 = byte3
byte3 = byte4
byte4 = ord(ser.read())
if ((byte1 == 1) & (byte2 == 2) & (byte3 == 3) & (byte4 == 4)):
break
path = []
for i in range(nloop):
lo = ord(ser.read())
hi = ord(ser.read())
reading = 256*hi + lo
baseline = baseline_filt*reading + (1-baseline_filt)*baseline
value = NY/2 + gain*(reading - baseline)
path.append(i*400/float(nloop))
path.append(value)
canvas.delete("path")
canvas.create_line(path,tag="path",width=3,fill="#38332b")
parent.after_idle(idle,parent,canvas)
# check command line arguments
#
if (len(sys.argv) != 2):
print "command line: hello.mic.45.py serial_port"
sys.exit()
port = sys.argv[1]
#
# open serial port
#
ser = serial.Serial(port,9600)
#
# start plotting
#
root = Tk()
#Set Interface Title
root.title('Joao Milheiro Hello Mic')
# Set x Key to exit
root.bind('x','exit')
#Draw Button to Exit
y = Button(root, text="EXIT", fg="white", command=root.quit, background="#a28356")
#Put Button on the Left side
y.pack(side=LEFT)
#Draw Title inside the interface
w = Canvas(root, width=400, height=50, background ="#bea373")
w.pack()
w.create_text(20, 30, anchor=W, font="Purisa",text="My Input Device assignement Updated") #write text
canvas = Canvas(root, width=NX, height=NY, background='#a28356') #format text
canvas.create_line(200, 0, 200, 200, fill="WHITE", width="2") #draw X axis line
canvas.create_line(0, 100, 400, 100, fill="WHITE", width="2") #draw Y axis line
x=0
while x<400: #draw scale lines along the X axys
canvas.create_line(10+x, 90, 10+x, 110, fill="WHITE", width="1") #big line
canvas.create_line(20+x, 95, 20+x, 105, fill="WHITE", width="0.5") #small line
x = x + 20
y=0
while y<200:#draw scale lines along the Y axys
canvas.create_line(190, 0+y, 210, 0+y, fill="WHITE", width="1") #big line
canvas.create_line(195, 10+y, 205, 10+y, fill="WHITE", width="0.5") #small line
y = y + 20
canvas.pack()
canvas.pack(expand = YES, fill = BOTH)
gif1 = PhotoImage(file = 'fab.gif') #Load Fabacademy image
canvas.create_image(300, 120, image = gif1, anchor = NW) # insert image
root.after(400,idle,root,canvas) #Reload sensor path
root.mainloop()
Tools Used - Ubuntu , python, tkinter
→ 17 April 2013, Coimbra - Output Devices.
After watching Neil's lesson and take a look at the options i had, i decided to make the RGB Light output Device.
I downloaded the files needed to the project.
So i started to mill the board,collected the components and soldered all the components to the board. I had to verify all the solderings at the end because the board wasn't flashing properly, and found 2 weldings that weren't supposed to be connected.
I connected a 9V battery to the board for auxiliar power.
Here is my final Board
When all components were connected to my FabIsp i compiled the C code:
sudo make -f hello.RGB.45.make
and then
sudo make -f hello.RGB.45.make program-usbtiny
sudo make -f hello.RGB.45.make program-usbtiny
avr-objcopy -O ihex hello.RGB.45.out hello.RGB.45.c.hex;\
avr-size --mcu=attiny45 --format=avr hello.RGB.45.out
AVR Memory Usage
----------------
Device: attiny45
Program: 330 bytes (4.0% Full)
(.text + .data + .bootloader)
Data: 0 bytes (0.0% Full)
(.data + .bss + .noinit)
avrdude -p t45 -P usb -c usbtiny -U flash:w:hello.RGB.45.c.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e930b
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "hello.RGB.45.c.hex"
avrdude: input file hello.RGB.45.c.hex auto detected as Intel Hex
avrdude: writing flash (330 bytes):
Writing | ################################################## | 100% 0.37s
avrdude: 330 bytes of flash written
avrdude: verifying flash memory against hello.RGB.45.c.hex:
avrdude: load data flash data from input file hello.RGB.45.c.hex:
avrdude: input file hello.RGB.45.c.hex auto detected as Intel Hex
avrdude: input file hello.RGB.45.c.hex contains 330 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.33s
avrdude: verifying ...
avrdude: 330 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Everything went well. Work done! watch my video
Want to show you some photos of my board working with lights on:
I also followed my colleagues assignements, because i'll need these knowledge for my final project.
Tools Used - Fabmodules, Modella, welding tools, Ubuntu 12.04, C Language
→ 24 April 2013, Coimbra - Networking and Communications.
At the beginning I was expecting to make something with my microphone sensor, because it would be great to communicate between the nodes with this kind of input.
I saw an assignment that could help me. If I have the time, I’ll do it.
I downloaded all the files to this project, milled and started collecting the components. Here are some pictures of the final boards:
After having some problems again with the circuit soldering and verifying everything again I decided to mill again the PCB and start over again with the 2 nodes, once the bridge was flashed ok. Everything seemed to work well:
For each component in this project, I needed to modify the "hello.bus.45.c" code with the correspondent numbers (node 0 – 0; node 1 – 1; bridge – 2).
#define node_id '*'
sudo make -f hello.bus.45.make program-usbtiny
I then flashed the nodes with different node numbers:
ml@ubuntu:~/Desktop/Networking$ sudo make -f hello.bus.45.make program-usbtiny
avr-objcopy -O ihex hello.bus.45.out hello.bus.45.c.hex;\
avr-size --mcu=attiny45 --format=avr hello.bus.45.out
AVR Memory Usage
----------------
Device: attiny45
Program: 796 bytes (19.4% Full)
(.text + .data + .bootloader)
Data: 4 bytes (1.6% Full)
(.data + .bss + .noinit)
avrdude -p t45 -P usb -c usbtiny -U flash:w:hello.bus.45.c.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9206
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "hello.bus.45.c.hex"
avrdude: input file hello.bus.45.c.hex auto detected as Intel Hex
avrdude: writing flash (796 bytes):
Writing | ################################################## | 100% 1.00s
avrdude: 796 bytes of flash written
avrdude: verifying flash memory against hello.bus.45.c.hex:
avrdude: load data flash data from input file hello.bus.45.c.hex:
avrdude: input file hello.bus.45.c.hex auto detected as Intel Hex
avrdude: input file hello.bus.45.c.hex contains 796 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.72s
avrdude: verifying ...
avrdude: 796 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
I opened the arduino IDE and the serial monitor, changed the baud rate to 9600, typed the number of the node and pressed ENTER
and here’s the final result:
Tools Used - Arduino IDE, Ubuntu 12.04, C Language, Modella, Soldering Tools, Terminal
→ 1 May 2013, Coimbra - Mechanical/Machine Design.
This week assignement consists in teamwork and me and our colleagues decided to improve our 3D native printer, the RepRap. There are needed a few ajustments to make it work better. we are going to make a module for the AC power unit, model the consumable rollout, optimize the Z axe. we are dividing tha tasks and i'll update asap.
15-05-2013
Me and Jose Viana decided to make a pressfit box to hold the abs spool and the power supply, so i started, because the old system wasn't adequated and needed a few adjustments as you can see in this photo. I started model the base of the box and shared with jose so he could make the side parts with precise pressfit. I also modelled the middle base and and the back cover as you can see in this render:
I Sent my stl file to Coimbra so they could start to machine the parts through the lasercutter.
22-05-2013
The rest of the group assembled the box and the day i went to Fablab Coimbra took some photos of the work done:
Next work will be putting all the wires inside the box and the sanduino board, so the electric system doesn't affect the printing system and the temperature will be much more equal along the printer. The goal for building this box is also to thermoisolate the printing area to potimize the quality of the printed models.news asap
Tools Used - 3D Studio Max, Laser cutter, 3D printer, SolidWorks
→ 8 May 2013, Coimbra - Applications and Implications.
Here is the Assignement for my Xorganizer final Project:
What will it do?
As said before, the Xorganizer will be a multiple cd case holder that allows people to select what music they want to hear and the correspondent cd cover will be ejected.
Who's done what beforehand?
I know that there are similar systems but I didn’t base in none of them and I didn’t make any research about my project originality. Maybe it’s time to do it ;)
What materials and components?
I’ll use the following materials:
Acrylic for the base
ABS (3d Printer) for the junction cylinder and the ejection clip
PCB for the Board
Electronics components (resistor, diodes, sensors, servomotors, input sensors, etc.)
Arduino IDE
Design the Interface to the project
9V battery
Where will they come from? and How much will it cost?
I’ll do it tomorrow in Lab session in a more accurate way, but the aproximated cost of my project is the $200.
What parts and systems will made?
I require design and manufacture:
The entire modeling will be in 3d studio Max, with STL exportation to the machines, peraphs with some solid(works).
I’ll design the whole circuit in Eagle, and will program in Arduino IDE
I’ll program the boards with my FabISP.
I’ll design the project interface with Tkinter or other solution
What processes will be used?
Pressfit for the acrylic
Arduino Ide for programming microcontroller
What tasks need to be completed?
Modelling the parts
Machining the parts
Parts availability
Design the boards
Make some sketches
Program the boards
Testing the motors and sensors
What questions need to be answered?
Can I program an interface for Android to communicate with Xorganizer?
The ejection system needs improvement?
Will I end the project ontime?
What is the schedule?
22-05-2013 – 27-05-2013 - update my project development and start modeling the parts and check if everything’s ok
28-05-2013 – 03-06-2013- check the parts availability and start doing the electronics (design, testing , machining, modeling and programming
04-06-2013 – 10-06-2013– Parts Machining and Assembly
11-06-2013 – 17-06-2013 – Final Tests and Presentation
With Continuous project development update
How will it be evaluated?
Does it ejects the right cd?
Does it stores the cd info?
Does it talks with android?
Has a good design, is it fashionable?
Tools Used - Word, Dreamweaver
→ 15 April 2013, Coimbra - Invention, intellectual property, and income.
News soon.
Tools Used -
→ 22 May 2013, Coimbra - Project Development.
22-05-2013
I've just updated my Application and Implication Assignement and it helped me to organize my ideas and global planning for my project. Tomorrow i'm going to Coimbra to watch Neil's Lesson and start doing some modelling for my final project pieces and discuss sith my colleagues about the electronic needs. Update soon!
22-05-2013
I started model my box with precise dimension and i'm a bit confused on how to make the ejection system, if with one step motor or if with a motor inside each box, something like a cd ejection system. I have some old drives at home and maybe i'll use them and put them inside my Xorganizer base.
Tools Used -
→ 29 May 2013, Coimbra - Final Presentation.
Not ready yet.
Tools Used -