Myvideo

Guest

Login

04. Temperature & Pressure Sensor Reading Simulation with Arduino in Proteus Simulator

Uploaded By: Myvideo
1 view
0
0 votes
0

After seeing this video, you'll be able to learn about creating a project in Proteus and Simulate it by taking hex file generated from the compilation of the code in Arduino IDE. Arduino Code: int val; int tempPin = 1; // pin defs int pressurePin = 0; #define kpa2atm // variables float pkPa; // pressure in kPa float pAtm; // pressure in Atm unsigned long time; void setup() { (9600); } void loop() { val = analogRead(tempPin); // read analog volt from sensor and save to variable temp float mv = (val/1024.0)*5000; float cel = mv/10; float farh = (cel*9)/5 32; // convert the analog volt to its temperature equivalent (“Temperature = “); (cel); (“*c “); (farh); (“F“); (); delay(3000); // update sensor reading each one second /* get the pressure */ val = analogRead(pressurePin); pkPa = ((float)val/(float)1023 )/; pAtm = kpa2atm*pkPa; /* send pressure to serial port */ (“Pressure = “); (pkPa); (“kPa “); (pAtm); (“Atm “); delay(3000); }

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later