in sync
This is an example of using 2 photocells and a variable resistor as analog inputs to control 8×8 LED Matrix with PIC18F452, UDN2981, and ULN2803. The input values of the two photocells are compared. When the values are the same, LED lights up randomly within the entire board. Depending on how much darker a photocell is compared to the other, LED lights up within the range that is more focused towards a corner. The variable resistor controls how fast the LEDs blink. This is how the board was set up:
The following is the code:
This is an example of using 2 variable resistors as analog inputs and a switch as a digital input to control 8 LEDs with a PIC18F452 chip. Variable resistor 1 is used to control which LEDs light up. The second variable resistor controls how fast the LEDs blink. The switch decides whether the LEDs blink or not. MAX232CPE is used to allow serial communication with a computer. PICBASIC was used to program the chip. This is how the board was set up:
The following is the code:
DEFINE LOADER_USED 1
DEFINE OSC 20
INCLUDE “modedefs.bas”
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 20
ADCON1 = %10000010
TRISA = %11111111
TRISB = %00000000
TRISC = %10001000
adc VAR WORD
adcbyte VAR BYTE
SPEED VAR WORD
SPEEDbyte VAR BYTE
SWITCH VAR PORTC.4
main:
IF SWITCH = 1 THEN
ADCIN 0, adc
adcbyte = adc/140
ADCIN 1, SPEED
SPEEDbyte = SPEED/140
PORTB = %00000001 << adcbyte
PAUSE 100*SPEEDbyte
PORTB = 0
PAUSE 100*SPEEDbyte
ELSE
ADCIN 0, adc
adcbyte = adc/140
PORTB = %00000001 << adcbyte
ENDIF
GOTO main
Today was my first day at a physical computing workshop run by Jin-Yo Mok (http://www.geneo.net). I’m starting from the very basics to understand how every single piece operates at the most fundamental level. The breadboard in the image shows the simplest setup of current amplification using an NPN transistor (2N2222). Hopefully, I’ll be able to design custom circuit boards in the future as I become more comfortable with all these volts and currents :)
I’ve been craving to learn how to utilize sensors, actuators, controller boards, and osc to build some interactive environments (post-robotic-ecologies-trauma). Suspecting that most of these products would be made in China anyways and that they’d be quite cheap, my friend and I have started to explore the world of Zhong Guan Cun. We ran into a few stores that specialize in making sensors and circuit boards. We spent about $10. We now have about a hundred LEDs, an infrared sensor, a photosensor, and etc -_-b
It wasn’t easy getting a controller board that we could burn customized program on to. Luckily, we got in touch with an IBM engineer that builds Arduino boards for hobby. So, now the experiment begins :)

