- Pwm
- Calculation of duty cycle for pwm
- ADC resolution
analog write commands can be written only on the pins 3,5,6,9,10,11, ie, the pins with a tilde(~) sign in front of them
3,9,10,11 – 490Hz
5,6 – 980Hz
calculation of output volatge from the value generated:
Vout = digital value * Vref/(2^n -1)
eg, Vout = 65*5/((2^8)-1)
class activities:
controlling the intensity of led using pwm (led as actuator)
controlling the position of servo motor using pwm (motor as actuator)
servo commands
attach()
servo.attach(pin)
servo.attach(pin.max,min)
write()
servo.write(angle)
map()
map(value, fromLow, fromHigh, toLow, toHigh)
Mobile android Programming
android – ecosystem:Google
iOS – ecosystem: iPhone
windows
Blackberry
Android – OS based on linux kernel, open source, large deveopment community
inter app integration
system architecture of android:
- Linux Kernel – Driver display, usb drive, camera...
- Libraries, Android Runtime
- Application framework
- Applications
MIT App inventor
Android Studio
Unity 3D
B4A
Bluetooth version 2.0
BLE – bluetooth low energy – sends data in short ranges and packages, can run for 4-5 yrs, consumes low energy
HC05 model – used for continuous streaming model, consumes more energy
used in accordance with their application
eg – BLE – ecg monitoring, industrial processes
HC05 – music streaming
WiFi – range is upto 300m, star topology, many connections as opposed to a bluetooth with one to one connections, easy to add and remove nodes, not as secure as bluetooth, can be easily hacked
Zigbee – mesh topology
GPS
GSM
Software serial.pin library has to be used to have pins other than 0 and 1 to act as Tx and Rx
Selecting the Microcontroller: - I/O pins - reqd Peripherals(RAM,ROM...) - reqd Interfaces(USB,UART,I2C...(protocols)) - IC Packages - affordability - availability, future availability - support for the device(application and technical forum support)
Search:General Hardware block Diagram for a microcontroller
Communication Protocols: - Serial Peripheral Interface(SPI) - Master Slave Relationship - 4 Pins: - MOSI(MasterOutput/SlaveInput) - MISO(MasterInput/SlaveOutput) - SCLK(Clock)(line for synchronus clock signal to all sensors/slaves) - Select Line for activation of a specific slave - Disadvantage: 4 bytes of data due to 4 lines - followed by: Pressure sensor, Dual axis tilt sensor - Inter Integrated Circuits(I2C) - only 2 lines : SCL and SDA, one for serial clock input and the other for serial data - The master also sends and address along with the serial data to choose the slave to which the data has to be sent. After address matching, the slave sends a low SDA to the master as an acknowledgement. Hence a communication b/w the master and the slave is setup. - Disadvantage: too manny steps have to bbe performed to establish and stop communication. - UART - Rx,Tx - Asynchronous - 3 types of communication: - Simplex - Half Duplex - Full Duplex