Studies and realizations Recumbent Bike ROUTIN Jocelyn GERARDI
Studies and realizations Recumbent Bike ROUTIN Jocelyn | GERARDI Marcelin | MARMONT Maxime BACHET Clément | KOIVUMAKI Markus 1/27
0. Contents I. Overview II. Electronic conception III. Arduino’s software IV. Windows interface V. Energy consumption VI. Project management VII. Conclusion 2/27
I. Overview Specifications Recumbent Bike • • Made by students in Mechanical Dept World university record: 117, 7 km/h (Nevada, 2008) Improvement by Electrical engineering Build a passive assistance for the driver: • • • 3/27 Indicate if he is late or not (real time) Store reference on microchip Transmit data from/to computer
I. Overview Synoptic of the project 4/27
I. Overview The Printed Board: The Hall sensor and the switch ON/OFF button The push butons The EEPROM and the Arduino card The state RGB Led and the colored Led for the indication time 5/27
I. Overview The Arduino Nano: • • • 6/27 Small chip Low consumption Interruption pins 16 MHz clock Not enough memory Numbers of Inputs/Outputs
I. Overview Clock The memory: • • • Data 7/27 256 KB memory PDIP case Low power CMOS 2 wires Serial Interface Add a capacitor
I. Overview The Hall effect sensor: • • • 50 cm Bike wheel Graphic representation of the sensor 0 V-5 V outputs Better lifespan Better detection Diagram of the Hall sensor 8/27
II. Electronic conception Schematic Hall sensor Supply Push button RGB Push button Arduino Nano LED RGB 9/27 EEPROM memory
III. Arduino’s software Hardware features used From microchip • • • Timer/Counter Interruptions - on timer overflow - on external pin Sleep mode From Arduino’s references • • 10/27 Serial library EEPROM library
III. Arduino’s software Principle of operation • Mode switcher 11/27
III. Arduino’s software Real-time comparison Wait for start Start button Wait for tick Tick (sensor) Compare real delay with reference Real < Reference Display Yellow LED Real = Reference Display Green LED Reset timer 12/27 Real > Reference Display Red LED
III. Arduino’s software Composition of the memory ADDRESS SIZE OF THE MEMORY 256 K (262 144 bytes) ADDRESS RANGE 0 x 00000 – 0 x 3 FFFF VALUE (BYTE) 0 x 00000 SIZE_OF_DATA[0] 0 x 00001 SIZE_OF_DATA[1] 0 x 00002 SIZE_OF_DATA[2] 0 x 00003 SIZE_OF_DATA[3] 0 x 00004 NUMBER OF DATA AVAILABLE 131 070 . . . MAX TOTAL TIME @ 120 KM/H 6 182 s (1 h 43 mn) 13/27 0 x 3 FFFF max. DATA_0[0] DATA_0[1] DATA_1[0] DATA_1[1]. . .
III. Arduino’s software Power saving mode Different levels • • • IDLE (the least power savings) ADC Power save Standby Power down (the most power savings) #include <avr/sleep. h> set_sleep_mode(SLEEP_MODE_PWR_DOWN); sleep_enable(); // enables the sleep bit in MCUCR register /* We must attach an interrupt on LOW here */ sleep_mode(); // puts the device to sleep /* Here the device is sleeping until the interrupt is enabled */ sleep_disable(); // disable the sleep /* We can detach the interrupt to come back to normal running time */ 14/27
IV. Interface CSV file • • Comma-Separated Values long string semi-colon for columns ‘n’ and ‘r’ characters for lines Example • • 15/27 line 1: 0; 0 line 2: 1; 2 line 3: 2; 5 ‘n’ and ‘r’ characters between new lines
IV. Interface Class diagram • • • 4 classes CInterface CCSV CSerial. Connection CSerial. Communication Aim of the program • read/write to Arduino • serial communication • decompose CSV files 16/27
IV. Interface CInterface class • main class • graphical part • manage the buttons and other graphical elements Problem • • when loading data show the progress but inter-threads problems use of delegates 17/27
IV. Interface How does it work? In the other class In CInterface Step 1: declaration of the delegate public Loading. State m. Delegate; Step 2: instantiation of the delegate Call of the delegate (and pass parameters) m. Delegate = new Loading. State(Delegate. Method); Step 3: method of the delegate private void Delegate. Method (var my. Var) { … } 18/27 m. Interface. Invoke(m. Interface. m. Delegate, my. Var);
IV. Interface CCSV class • open, save, browse, clear • decompose into byte or string arrays Decomposition • CSV to 2 D string array void Decompose. String. Array(string str. Input, out string[][] str. Values, out int i. Count); • 2 D string array to 1 D byte array void Decompose. Byte. Array(string[][] str. Values, int i. Count, out byte[] BValues); 19/27
IV. Interface CSerial. Connection class • manage the connection • between computer and Arduino Features • • connection disconnection refresh COM ports list COM timeout Arduino Compatible device “y” Computer “c” Arduino Incompatible device 20/27 ? ? ?
IV. Interface CSerial. Communication class • manage serial communication • read and write • Data. Received. Handler() triggered when serial available • state machine know what we have to do Sending • 4 differents states • initialisation, full packet, last packet and end 21/27
IV. Interface Arduino to computer Frame model Sequence diagram • length of the data (4 bytes) • data until last byte • checksum of the data (1 byte) 22/27
IV. Interface Computer to Arduino Frame model Sequence diagram • length of the data (1 byte) • data packet (maximum of 32 bytes) • checksum of the packet (1 byte) 23/27
V. Energy consumption System ON Components Average consumed current Sensor Hall effect 7 m. A Arduino nano 15 m. A EEPROM 0. 4 m. A LEDs (red/green/yellow) 15 m. A RGB Led 9. 6 m. A Total 47 m. A System Standby • Mainly affects the Arduino Nano card • According to Arduino datatsheet standby consumption is about : 0, 84 m. A 24/27
V. Energy consumption Possible solutions ü Use a power reduction register 7. 6 m. A ü Bypassing the power plug 8. 4 m. A ü Change the internal clock at 128 k. Hz 10. 1 m. A ü Using a bare-bones board 30. 5 m. A 25/27
VI. Project management Mind map • Beginning of the project : 23/01/2017 • End of the project : 29/03/2017 26/27
VI. Conclusion Thanks for your attention! Do you have any questions? ROUTIN Jocelyn | GERARDI Marcelin | MARMONT Maxime BACHET Clément | KOIVUMAKI Markus 27/27
- Slides: 27