Skip to content

lowJ/fish-mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fish-mouse

alt text

PCB traces

alt text

Issues to fix

  1. Switche footprint needs bigger drill holes.
  2. Add switch to choose USBC GND or Batt GND.(Currently switch toggles between USB 5V and Regulator 5V, but GND stays the same). It will be safer if GNDs can be disconnected when not in use.
  3. Fix footprint of USBC, add drill holes for excess pins, but do not include metal surrounding. Extend smd pads.
  4. On USBC footprint, one of THT pads is off.
  5. Put i2c pullups on other side of pcb
  6. led to show when there is usb power
  7. probally more issues yet to be found...

Parts and Labels [Labels not fully updated!]

Note: This is not a full parts list

  • SN754410NE (U2) - Motor driver, used to control the speed and direction of the two motors.
  • Teensy 3.2 (U1)- Processor, will run code.
  • IR Emitters (D0-D3) - Send an IR signal, which will bounce off walls, allowing for the reciever to read. Each is connected to a digital pin on the Teensy, allowing them to individual turn on and off.
  • IR Reciever (Q0-Q3) - Reads how strong the IR signal is, depending on the value it reads it is able to detect if there is a wall, and how may cells away it is.
  • Pololu 3081 (U5, U4) - Motor encoders, used to keep track of wheel rotations.
  • LM1085 (3A) (U3) - Voltage regulator, a LDO regulator that gives a 5V source from the LiPo. 3A version.
  • Switch (SW1) - Any mechanical keyboard switch
  • Buzzer (BZ1) - ~5mm buzzer pin spacing, the small ones in the link fit.
  • LEDs (D4, D5) - Any 3528 sized led rated for at least 3.3v
  • 120Ω (R0, R1, R2, R3) - Current limiting resistors for Emitters.
  • 1.8KΩ (R4, R5, R6, R7) - Current limiting resistor for Recievers.
  • ...Ω (R11) - Pull Up resistor for switch. Value based on the LED bought. Calculate
  • 1-10kΩ (R8, R9) - Current limiting resistors for LEDs.

Building Notes

  1. Use header pins and sockets for the Teensy and Motor driver to make replacing parts easier.
  2. With the ir emitters and receievers short end is positive.
  3. When connecting wires to the motor encoder, make sure none of the wires are rubbing against the magnetic disk.
  4. When connecting the encoder make sure to double check wires are connected correctly.
  5. Early Testing

Software Notes

Interrupts

  • Interrupts are needed to keep track of the wheels revolution. When the wheels position changes, the motor encoder will send a signal to the Teensy. A total of 12 signals will be sent per 1 revolution. Interrupts allow it so the Teensy can update values as soon as the encoder sends the signal (asynchronously). If the encoders were updated in the main loop theres a good chance for some signals to be missed, causing the revolution count to be inaccurate.

  • To add an interrupt run the attatchInterrupt function in setup. Syntax is attatchInterrupt(pin, func, mode). The second parameter specifies the function that gets executed when the interrupt is triggered. In our case we want to put in a function that will add to the count of an encoder variable. The third parameter specifies what will trigger the interrupt. For example "CHANGE" will make the interrupt trigger whenever the pin changes value, however, "FALLING" will make the interrupt trigger only when the pin goes from HIGH to LOW. Read link for more info.

Variables

  • tickCount - Two variables, one for each motor. When interrupt its triggered, increment the tick count by 1.
  • emitterState - One for each emitter. Stores the current state of the emitter

Functions

  • readReciever() - One method for each reciever. Returns the value read by reciever
  • setEmitterState(x) - One method for each emitter. Set the state of the emitter to on or off.
  • getSwitchState() - Return the value of the switch
  • runMotorTime(m, speed, sec) - Set specific motor at speed for given amount of seconds. Uses delay function to count time.
  • runMotorRev(m, speed, rev) - Runs a specific motor at speed for given amount of revolutions. Uses the encoder varible to count revolutions.
  • setLED(l, brightness) - Sets a specific led to a certian brightness.
  • setBuzzer(strength) - Sets the buzzer to a given strength.

More Functions

  • turnRight() - Use encoders and tickCounts of both motors to make a percise right turn
  • turnLeft() - similar to turnRight()
  • goForward() - Use encoders to go straight.
  • turnAround() - turnRight * 2

About

Small Robot for maze navigation (Micromouse)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages