Dan's Progress Log

Remote Controlled Outlet Strip
Home
High-Level Design
Hardware Design
Software Design
Results
Conclusions
Pictures
Appendices

Daniel Warren

Heidi Ng

 

Ø      Earlier, before keeping track of dates

o       Looked up various relays … decided on G3MB-202P-5DC from Omron

o       Scrounged around for random parts

§         Romex cable, CAT5 cable, the surge strip, buttons, etc

o       Sent emails about sample parts

o       Drew up preliminary schematics

Ø      Friday 4/9

o       Started physical assembly

§         “Borrowed” a sponge and solder wick from 315, but the irons in 476 suck

§         De-soldered ZIF sockets from old boards

§         De-soldered plug from 5V power supply

·        Might be issues with continuity between solder pads and lines

§         Attempted to connect neutral wires for outlet

·        Bent one of them too far… may cause trouble later – weak connection

o       Gathered parts

§         Perfboard, relays, voltage regulator, etc

Ø      Saturday 4/10

o       Continued assembly

§         Soldered wires to power supply, wrapped in electrical tape

·        Tested it – it’s good

§         Started soldering relays to perfboard

·        Hard to find a place for it to fit in the box… should be good by input wires

·        Got cat5 wires hooked to inputs, common 120VAC input soldered

Ø      Monday 4/12

o       Met with Bruce to get transmitter soldered and notch cut in end cap

§         Discussed methods of detecting dying battery – Zener diode at 8V, using internal bandgap of ADC on chip with voltage divider

o       Completely assembly

§         Hooked all outlets to ground and corresponding output of relays

§         Fit everything in (relay block, circuit breaker, power supply, wires), taped up anything that might contact something else, put wire caps on the main 120VAC inputs, closed the box

o       Tested it

§         Hooked up 4 lamps and pushbuttons to the relay inputs

§         It worked!! For about 30 sec, and then died

§         The 5V power supply was busted… looked and smelled like something was burnt, continuity between output +5 and Gnd

§         Tested everything else using 9V battery and LM340 – relays still good

o       Found a 74HCT30 and tested it – it’s good

o       Looked through data sheets for pins to use for various things

o       Started soldering circuit together on perfboard

§         Extremely tedious, annoying, pointless, sensation of burning

§         Decided to just do it on the breadboard, maybe move to soldering later if time

§         Can’t afford nicer solder boards – other stuff was scrounged

o       Heidi worked on the transmitter code a bit, and helped with the soldering

Ø      Wednesday 4/14

o       Took the box apart and wired in a new 9V power supply – this one has a separable plug and transformer section, so if another one gets blown up, we won’t have to open the box again.  Besides, it was a little bigger than the previous one, and didn’t fit

o       It was at that point that I was reminded of the importance of unplugging your circuit before grabbing leads that connect to 120VAC

o       Made a 5V supply from a full wave bridge rectifier (4x 1N4001 and LM340)

o       Made a clock circuit for the breadboard (8MHz crystal and 2x 22pF capacitors)

o       Made a connector for the cat 5 cable connected to the relays, but then realized we should make it keyed, to prevent accidental insertion backwards, which would destroy the relays

o       Hooked up LEDs to the same pin as the relays, to see if the parallel resistance would matter – didn’t seem to, but hard to tell

o       Started to reconsider the decision to breadboard stuff instead of soldering… the soldering really isn’t that complex for the receiver, and half of the transmitter is done

Ø      Thursday 4/15

o       Fixed the connector to the relays such that it is keyed – put two grounds to the same pin, and filled in that hole – can only put it in the right way

o       Decided soldering is annoying, but worth it – takes forever though

§         First prototype a circuit on the breadboard, and once it’s good, copy it

§         Did some work on the receiver – everything worked

·        Put the 5V supply circuit on the perfboard and soldered it in

·        Put the status LEDs and resistors, and soldered those

·        Started to solder basic functionality stuff (capacitors between ARef/Gnd and AVcc/Gnd)

Ø      Friday 4/16

o       More soldering

§         Random capacitors and resistors to make the microcontroller function

§         Programming port

§         Connected LEDs to microcontroller

§         Relay output port

o       Tested it

§         Preliminary code to blink various LEDs and relays – worked properly the first time – relays successfully controlled by microcontroller

o       Started coming up with communication scheme – what to use bits for, data frame, error correction, synchronization issues, etc

o       Figured out how to detect low voltage on battery of transmitter

§         Use internal 2.56V bandgap ARef, and connect very large resistive voltage divider across battery

§         when it falls below a certain level, light an LED

Ø      Saturday 4/17

o       Heidi did some soldering of random capacitors, resistors, and the crystal

Ø      Sunday 4/18

o       We soldered the socket for the NAND gate into place

o       Figured out resistors for battery check

§         Maximum (at 9V) has to be below ~2.4V, to account for variations between bandgaps of different microcontrollers

§         1MΩ and 330kΩ

·        9V => 2.33V, 8V => 1.98V, 7V => 1.74V

·        6.7 μA current through the divider – practically nothing

Ø      Monday 4/19

o       Finished preliminary construction

§         Soldered receiver and transmitter into place

§         Measured and cut antenna wires

§         Status LEDs for transmitter

§         Power supply section for transmitter

§         Battery voltage monitoring resistors

·        Discovered bandgap reference does change slightly with Vcc, but it shouldn’t be too much of a big deal if we choose appropriate transitions

o       Started software testing

§         Plugged it in, programmed both boards… and nothing happened

§         Realized we needed a more definite specification of what was being transmitted, and different states to be in – started defining specs better

§         Started verifying bit patterns in status registers… some were incorrect

§         Code needs a lot of work before it’ll do something useful

Ø      Wednesday 4/21

o       Spoke with Atmel sales contact

§         Will sample two ATMega32L-8PI chips… may take 2 weeks though

o       Added a power jumper to the transmitter board

§         Another way to save battery life, as well as monitor current usage

§         At first, it was drawing ~75mA active, 40mA powered down

§         Then, after some modification to the code, 35mA active, 5mA powered down

§         We’ll see what we can do about that 5mA – should be well under a milliamp

o       Worked on code a lot

§         Sometimes bugs would be bad enough that a new program was necessary

§         Just write a shell of a program, to try to isolate the problem

o       Rewrote transmitter code

§         Random things going wrong, debugging excessive power usage

§         Only transmit if a single button is pressed

§         Transmit the port when waking up, otherwise use debounce state machine

§         Not transmitting continuously, so use a data frame, with parity

§         Turns out the microcontroller USART is at 5V for idle, not 0V as initially expected

·        Turn off the UART transmit and zero the port when not in use to save power in the radio transmitter

§         Eventually got something working, saw the waveform show up at the radio transmitter input, but couldn’t tell if it was actually doing anything

o       Started rewrite of receiver code

§         Huge mess – started over

§         Wrote receive interrupt to handle data frames – hopefully robust, but hard to tell – ignores input if any parity or frame errors, or if missing start or stop tags

§         No heartbeat LED for a while, nothing appeared to be working

§         Turned out the USART was initialized improperly – constantly taking an interrupt that had no routine

§         Used oscilloscope – data transmitted is actually showing up on receiver output

·        Incredible!  It’s like magic

·        Although, it’s pretty noisy, and often is a gigantic mess

·        Probably will need low-pass filtering

§         Data not successfully received though – needs more work

§         Will have to figure out state machines for all the various modes of operation

Ø      Thursday 4/22

o       Figured out the source of the powered down current draw – it’s the voltage regulator

§         LM340 has 5mA quiescent current – not acceptable

§         74HCT30 = 2μA, MCU = 5μA, transmitter = 100μA

§         Tried alternate circuit with a 5.6V zener diode, 10K pot, and npn transistor – lower quiescent current, but hard to tune the output correctly

§         Found better parts by Analog Devices, ordered samples – overnight delivery

·        17μA quiescent, 0.2μA standby (probably won’t use)

·        Require 10μF capacitor

·        Can’t use the 74HCT30 to power down the supply regulator, since it only operates from 4.5V to 5.5V

o       Worked on the radio link

§         Low pass filtering won’t help – not that type of problem

§         At 2400bps, the reception seems to have a delay on the rising edge

§         Slowed it down to 1200bps, so it wouldn’t be as much of an issue

§         Tried transmitting with 2 stop bits

§         Getting frame errors in strange places, always on the one data byte we need

§         Haven’t found a byte sequence to get the receiver synched up – tried varying combinations of 0xaa, 0xff, 0x00, 0x0f, different start and stop bytes, etc.

§         After transmitting a constant high (idle) for a bit, the receiver drops out, and thinks it’s a zero – frame error

§         Found an error in UCSRC setting - was incorrectly writing a 0 to a field that needs to have 1 written to it always (register select) – found after lab closed – will have to test tomorrow

§         Outlook pretty bleak – Bruce and the TAs can’t figure it out, other groups don’t have this problem

§         Range of reception rather small

o       Other software stuff

§         More or less put on hold until radio link solved

§         If radio not solved soon, may have to disconnect it and just connect a wire between the UARTS, pretend it was the radio link

§         Changed power down code to start up the debounce state machine in the pushed state – make sure same button not sent twice

Ø      Friday 4/23

o       Changed that UCSRC thing – and it fixed the problem

§         It was interpreting the parity bit as the stop bit, and the data byte’s odd parity was 0, while all the synchronization bytes were 1

§         Shortened the synchronization to an acceptable level

o       Found errors in the data byte decoding – was active high instead of active low

o       IT’S ALIVE

§         MWAHAHAHAHAHAHAHA

o       Made all on, all off, 1, 2, 3, 4 buttons work individually

o       Added speed and mode control

§         Modified function of other buttons to change the active set of outlets, instead of the port directly

§         Started coming up with different modes – need a few more

o       Timing of blinking seems non-constant

§         Sometimes it won’t be on for long enough, or won’t be off for long enough

§         Seems random, and doesn’t occur very often – hard to capture on the scope or find a cause

o       Sampled microcontroller probably won’t arrive before the project is due

o       Sampled voltage regulators won’t come until later in the week – being shipped from the Philippines – LM340 still works, but draws a little more current that desired

§         Considered disabling the transmitter completely (cutting off Vcc) when powered down to save the 100μA, but decided that’s getting excessive

§         Considered using the new voltage regulator to indicate when the battery is dead, since if the battery is really dead, the microcontroller won’t power up enough to indicate that

·        New part won’t be here soon enough to test though

·        Another analog circuit that needs tuning

·        Not worth the trouble – nothing happens, try a new battery

o       Started working on the webpage

§         Haven’t done one in a few years

§         Figured out FrontPage again (new version)

§         Made a basic template, started filling some silly things in

§         Reworked block diagram slightly

Ø      Saturday 4/24

o       More work on the webpage

o       Cropped and resized some pictures to include in report

Ø      Sunday 4/25

o       Investigated alternate antennas

§         Couldn’t come up with any better designs for homebuilt ones, other than putting the ¼ wavelength wire perpendicular to a ground plane

§         Conditions in lab would probably adversely affect reception, but other groups have seemed to have better luck with range

§         Purchasing tuned antennas cost ~$10 each

Ø      Monday 4/26

o       Decided to make the transmitter run at 9V to get more power out

§         Hooked its Vcc up to the battery directly, without a regulator

§         Apparently, it needs the input to be Gnd-Vcc, not to 5V

§         Tried a few circuits, decided on a rail-to-rail op-amp with gain 2

·        Tried a few op-amps, but went with LMC7111

·        It had lowest quiescent current, in a small package

·        However, it had a really slow slew rate, so the signal out was very sloped – thought it might be a problem, surely can’t run UART faster

·        Looked for non-inverting Schmitt triggers, but couldn’t find any in lab that would run up to 9V… it works anyway though

§         Transmission range with a fresh battery did increase slightly – yay

o       Tried putting a ground plane below the transmitter antenna – no noticeable effect

Ø      Wednesday 4/28

o       Tried more antenna shapes, but nothing seemed better than the straight 17cm wire

§         Helical was very bad, despite the luck other groups were having

§         Sometimes putting an alligator clip on in a big loop helped

§         Sometimes touching the metal and using your body as a tuned element helped

§         Decided what we have now is good enough – works most of the way across the lab

o       More work on the website

§         Fixed up schematics to be consistent with final circuitry

§         Wrote stuff for the intro and high level design

§         Started writing hardware design

o       No word on the sampled ATMega32L-8PI chips – probably won’t come in time

o       Analog Devices voltage regulators shipped overseas last Friday, should arrive this Friday

Ø      Thursday 4/29

o       Took more pictures of the project, and a video

o       Edited the video to smoothly work as an infinite loop

o       Wrote a lot of text for the website, and finished the formatting

o       Got the website ready for demo

Ø      Friday 4/30

o       Demo-ed

§         Went well, as far as we could tell

§         Everything worked as expected

o       After demo, the voltage regulators from analog devices showed up

Ø      Monday 5/3

o       Tested new voltage regulators

o       Ripped apart transmitter power supply, reconstructed it with new regulator

§         Used ADP3367 – SOIC-8, so used a PCB Prof. Land had

§         Has a lot more features, but decided not to design for them this late

§         Dropped quiescent current from 5.1mA to 62μA

§         Battery will now last nearly a year, instead of less than a week

o       Updated website slightly

o       Done… for now


 


Home | High-Level Design | Hardware Design | Software Design | Results | Conclusions | Pictures | Appendices

 ECE 476 Final Project
© Spring 2004 Daniel Warren and Heidi Ng
Problems? Questions?  Contact sleepdeprived@cornell.edu.
Last updated: 05/03/04.