Final Project Proposal

Final Project Proposal

Name: pJazz

What will it do?

  • Play jazz music from a local FM station when you enter the bathroom.
  • Turn on based on input from a PIR sensor.
  • Turn off when you leave.
  • Display info on a small OLED display.
    • Diaplay RBDS info about the music if it's being broadcast on the signal.
    • Display the current time (As the RBDS encodes this so why not)
  • Provide hands free interfacing with capacative touch proximity sensing

Who's done what beforehand?

  1. Here is a hack were someone wired a small mortable mp3 player into their bathroom light on the ceiling.
  2. Example of intefacing a similar FM reciever chip with an Arduino.
  3. Arduino Shield with similar chip on board FM reciever chip.
  4. Designs for laser cut speaker enclosures are quite abundant.

What materials and components will be required and where will they come from?

  • Enclosure
    • Acrylic or Wood (Fab Lab)
  • Speaker (Junk Drawer)
  • OLED display (Adafruit)
  • PIR sensor(Amazon)
  • Battery (Adafruit)
  • Circuit Boards (Fab Lab)
    • Main control unit
      • ATMega328
    • FM reciever
      • SI4705
    • Amplifier (adafruit)
      • TPA2016 module
    • Power/Battery Charger
      • MCP73831T
    • Touch sensor pads
  • Aditional components for all circuit boards (Mouser)

What will it cost?

Here is the complete BOM of components excluding non stocked fab lab components. The BOM total comes to $37.17 in single order qty. So if we included the scrap wood for the enclosure and extra capacitors and resistors used from the fab lab the totall would be right around $40.

What processes will be used?

  • 2D and 3D CAD
    • Circuit boards
    • Enclosure Design
  • Computer Controlled Cutting
    • Enclosure
  • PCB Fabrication/Electronics Design/Embedded Programming
    • Control Unit
    • Amplifier
    • FM reciever
    • Touch Sensors
  • Input Devices
    • FM radio
    • PIR Motion Sensor
    • Touch Sensors
  • Output Devices
    • Speaker Volume
    • FM Radio Control
    • LED's
    • OLED Display
  • Networking
    • FM radio (SPI)
    • Amplifier (I2C)
    • OLED Display (I2C)

What tasks need to be completed?

  • Board designs finalized
    • Control Unit
    • Amplifier
    • FM reciever
    • Touch Sensors
  • Order board electronics
  • Order speakers
  • Design/Make enclose
  • Test all boards with control unit
  • Integration and final testing

What questions need to be answered?

  • What should it look like?
  • How should it specifically be controlled?
  • Can the RDS information be searched for specific music types?

What is the schedule?

  • Baords designs finalized (5/20)
  • Parts ordered (5/21)
  • Enclosure Designed (5/25)
  • Baords assembled and tested (5/27)
  • Integration and final testing (6/3)

How will it be evaluated?

Do I hear jazz when I go pee...?

Tasks that have been completed

Design

Power Supply Board

  • USB Powered
  • Built in LiPo Battery charger
  • 3.3V 2A regulated output
  • Battery Voltage and Shutdown Enable output for enabling ultra low power modes.

FM Reciever Board

  • Utilized a SI4705

Control Unit

  • ATMega168 Board
  • I2C interface for controlling periferals
  • Low power voltage reulator on board so that it can be powered directly from a battery
  • LED for status indication
  • 4 buttons for input

Enclosure

I first created a 3D model of the basic design. The plan is to mount a speaker out the bottom and use the mesh opening at the top as a way to hide the PIR sensor. The box also doesn't need feet as I'll add felt feet to the bottom so that it doesn't rattle on a hard surface.

Top view:
Bottom view:
Next I created a 2D cut file for the box using this press fit box maker site. I then added the vents, power input, and speaker mount cuts in inkscape. Here is the final cut file:
The final cut product looked great. It just needed a little glue in the joints to make it solid as the speaker was kind of heavy.

Microcontroller Code

The code utilizes this arduino based Si4705 library. This basic version of the code turns on the radio, tunes to a preset station, and then adjusts volume based on it motion is detected in the room:

#include <Si4705_Lib.h>
#include <Wire.h>
int counter =0;
int resetPin = 9; 
int PIRPin = 3;
int volume;
int delayCount;
int PIRValue;
int RadioON;
int SDIO = A4; //SDA/A4 on Arduino
int SCLK = A5; //SCL/A5 on Arduino
char printBuffer[50];

Si4705_Lib RADIO(resetPin, SDIO, SCLK);

void setup(){
    pinMode(PIRPin, INPUT);
    if (RADIO.powerOn()<0){
        //Serial.println("Power on error");
    }
    RADIO.setVolume(0x3Fa);
    delay(100);
    if (RADIO.RDSConfig()<0) {
    //    Serial.println("RDSConfig on error");
    }
    //Serial.println("done setup!");
    if(RADIO.setChannel(9450)) {
        //Serial.println("setFreq Error");
    }
}

void loop()
{
    PIRValue = digitalRead(PIRPin);
        if(PIRValue == HIGH && RadioON == 0){
            RADIO.setVolume(0x3Fa);
            RadioON = 1;
        }
        else if(PIRValue == LOW && RadioON == 1) {
            delayCount++;
            if(delayCount > 200)
            {
                RADIO.setVolume(0);      
                RadioON = 0;
                volume = 0;
                delayCount = 0;
            }
            else {
                delay(100);
            }
        }
 }

Testing

Video of Early Testing

Power supply

  • What works
    • The power supply works well when running off of USB power. It's supplies 3.3V and is able to be shutdown by the microcontroller for ultra low power modes.
    • The LiPo charger circuit also works fine and charges the battery.
  • What Doesn't
    • The power isn't well regulated when the USB cable is unplugged and the system is running off just battery power. The output spikes above 4V which is unacceptable for some components so I can't currently run it off of battery power.

FM Reciever

  • What Works
    • The FM reciever works and I can tune to specific stations no problem by communicating through the I2C network.
  • What Doesn't
    • I haven't gotten the RDS functionality working. I need to setup a board that has better serial debug capabilities to that I can get feedback on what's happening.

Main Control Unit

  • What Works
    • The MCU seems to be working fine as it's just an arduino clone board.

Motion Sensor

  • What Work
    • The cheap motion sensors I got off amazon work perfectly.

Enclosure and Sound

  • What Works
    • The enclose is great. It blends well into it's surroundings and doesn't even look like a radio.
    • The vents near the top allow for plenty of coverage by the PIR sensor so it's nice and responsive even though it's hidden inside the box.
  • What Doesn't
    • There could be better sound isolation between the speaker and the vents at the top of the box to improve the low end response of the speaker.
    • There could also be build in slots for the electronics, right now the boards are just mounted to the walls and it's a bit ugly.

Video of Working Project

Tasks remaining/Next Steps

  • I originally planned to add an OLED display to show station and music information but it was kind of expensive and I'm not sure how necisarry it is. It's also kind of nice to just have a plain box with no noticable inputs.
  • The power supply issue with not being able to run off of battery power reliably needs to be resolved.
  • I more advanced user interface utilizing the push button interface on the MCU to allow setting volume and channels would be useful.

Things I have learned

  • Using the Arduino envoronment is a bleasing and a curse. If you have exactly the right hardware configuration everything works fine but small changes reguire hours of fiddling with board files and reading forums to debug reliability issues. There's also no good debug interface other than the serial port which can also waste a lot of time.
  • The press fit boxes look great, it's a really easy way to create a simple prototype enclosure that is pretty acceptable looking.
  • The fact that an FM Radio is an easy to interface single chip solution is pretty great.
  • Protoyping circuits on the Modela is great for larger packages but I'm not quite sure it's a replacement for a solid OSHPark board when it comes to fine pitch no lead packages.
  • Music that plays when you enter the bathroom is exactly as awesome as I thought it would be....

Design Files