---
# System prepended metadata

title: Food truck temperature watch

---

# Food truck temperature watch

>By: Alexander Bokvist(ab225ur)

This project is supposed to help monitor the temperature of a foodtruck so the workers can work in a safe environment.
### time
The project should take around 1-2h to do depending on your knowledge setting up connections and if you encounter any bugs and errors.

## Objective

### Why did i create it?

During this summer i worked(still works) at a food-truck. Me and me colleague have been complaining alot about the current temperature and often remind eachother do drink water because it's so warm inside the truck. 
After some discussion we decided to google around how hot it's allowed to be inside the truck.

According to [AV]([Arbetsmiljöverket](https://www.av.se/inomhusmiljo/temperatur-och-klimat/))(Arbetsmiljöverket)
The temperature should not be over 26 degrees celsius. 
### Purpose and insight
The IOT devices purpose is to alert me and my colleague when it's to hot to work so we can take small breaks,exit the truck and hydrate. We can also measure the temperatur after or before work to see what kind of clothing fits for the day and we can also control that we have turned off the griddle after our shift.







## Material


Components

| Component          | ~Pris(kr)  | 
| ----------------- |:----------------------- |
| Pycom lopy4 ![](data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHCBYVFBcVFRQVGBYZGyIbGhcaGh0cIR0cGyAcGyAdIRkhIiwjISQ1HRodJTUkKC0vMjIyICI6PTgwPSwxMi8BCwsLDw4PGRARFzEgIiUxMTIxMS8xMTIxPDExMTExMTEzMjExMTExLzExLzE8LzExMTExMTExLzovPTExMTExMf/AABEIALIBGwMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYDBAcCAQj/xAA9EAACAQIEBQIDBgMIAgMBAAABAgMAEQQSITEFBhMiQVFhMnGBBxQjQpGhUnKxFTNDYsHR4fBTkjSC8ST/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAQMC/8QAHBEBAAMAAgMAAAAAAAAAAAAAAAECEQMhEjFB/9oADAMBAAIRAxEAPwDs1KUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoPlKjMbxzDwkCSZFJ2F77aeL+a3MNikkF0dXHqpB/pU2NzVyWxSlKqFKUoF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odKDnfDfsrgjIMk8slvCgRg/P4m/Qirnwvg8GGXLDEkY8kDU2/iY9zfU1I0oFKUoFak+Aid0keNWeO+RiASua17Hx8I/QVt0oFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoFKUoP/2Q==)       |  400   |
| Pycom Expansion board ![](https://www.electan.com/images/Sparkfun/14675.jpg) | 250     |
| Breadboard ![](https://m.media-amazon.com/images/I/61p+QTbMf5L._SL1010_.jpg)       | 35    |
| MCP9700 Temperature-sensor ![](https://www.electrokit.com/uploads/productimage/41011/41011628.jpg)      | 15   | 
| Jumper wire ![](https://www.electrokit.com/uploads/productimage/41015/41015693.jpg) | 29 |
| Micro-usb to usb-A ![](https://media.startech.com/cms/products/main/uusbhaubxm.main.jpg)  | 40 |
In this coruse i decided to use a Lopy4 device that works similiar to a Arduinio. The lopy4 device is the brain of this project and also the thing we code to send data to pybytes later using our sensor MCP9700 that is a temperature sensor. We can connect the sensor by using the breadboard and wires and then connecting them to the Lopy4 Expansionboard were Lopy4 is neatly seated. The Microusb cable was used to connect our Lopy4 to our used computer so we can upload the files created in Atom(IDE)
Everything was bought from Elektrokit. With a total cost of around 900kr but is cheaper buying just the needed parts instead of a bundle. The prices in the picture above is the price i see from googling the products(Price may vary) 
### Computer setup
#### How i did it.
>Can also be found here: https://docs.pycom.io/index.html
Download the latest version of Python which can be found here: https://www.python.org/downloads/

In my project i used Atom that I can higly recommend I'm used to Vscode but might use Atom in the future.But shouldn't be a diffrence which IDE you use aslong as you have all the needed programs and plugins.An is IDE were we program our Lopy4 board by downloading the plugin called Pymakr we can now connect and communicate to the Lopy4 device.  

![](https://i.imgur.com/1zt8ALv.png)
The file structor looks like this were you type your main code aka your project code in the main.py file. The boot.py file is used to connect to wifi whenever the board starts and the lib folder is where we store the library of more advanced sensors in my case i did not have to use any library.

When you have downloaded your IDE downloaded the pymakr plugin and the board is connected to the computer correctly you should also make a good file directory that is easy to navigate. Then you are free to start coding away.When you are done with your code you can either just run the file or you could also save it on the board. Recommend just running the file until you are done and then upload it to the board. When you are ready to upload your code and make so pybytes can your the data I recommend that you read this awesome guide where you can also decide what type of connection to use: https://docs.pycom.io/pybytes/gettingstarted/ 
## Putting everything together
Excuse my paint picture ![](https://i.imgur.com/I2u2Q3J.png)
The black dot represents the sensor that is grounded from the blue line that goes to the "negative" marked spot on the breadboard, We get an active ground by connecting that part to the ground on the lopy4 device. Same thing applies to 3volt which we also get from the lopy4 board that is powered by my computer in this case. Also important to check the polarity of the pins on the sensor. The middle pin is where we can collect data from by reading the analog pin which is set to pin16 in our project. In this project no resistor was needed, but if we were to use a higher energy source a pair of resistors might come in handy.

### Platform
I ended up using Pybytes as my platform for the data because it an easy alternative to set up and create a widget. You might not get super advanced widgets but in my case just to read the temperature it was enough. But if i were to make more advanced stuff like get alarms on the phone when the temperature reaches a special degree i would probaly use another platform or connect Pybytes to something else. You can find pybytes here which is free to use! :https://pybytes.pycom.io/ 

## The code
```python=
import machine
import time
import pycom
import sys
import os

pycom.heartbeat(False)
adc = machine.ADC(bits=10)
apin = adc.channel(pin='P16')

while True:
  millivolts = apin.voltage()
  celsius = (millivolts - 500.0) / 10.0

  if (celsius >= 26 and celsius <30):
    print("temp is currently:",celsius,"and therefore over the recommended working conditions")
    pycom.rgbled(0xFF3300)  # Orange condition is over recommened but not dangerous
  elif celsius < 26:
    print("temp is currently",celsius, "and therefore within the recommened working conditions")
    pycom.rgbled(0x00FF00)  # green condition is okay and safe to work in
  else:
    print("temp is currently:",celsius,"and therefore significantly over the recommended working conditions(Take a break!)")
    pycom.rgbled(0xFF0000)  # Red condition is dangerous high and you should take regular breaks as long as the statement is true
  pybytes.send_signal(1, celsius)
  time.sleep(5)
```
This code works by converting the milivolts from MCP9700 sensor to celsius so we can easily make statements using celsius so whenever we get that celsius is over 25 degrees it's no longer recommened to keep working in that environment so we warn the user by using the built in RGB on the lopy4 device to signal a yellow light. If we were to meassure celsius to over 30 degrees it is REALLY not recommened to work so use a red light as a warning for the user that it's dangerous and he/she should take a break and hydrate. If none of these statements would be true that means that it's less than 26 degrees and within the recommend working condition so we show that by using a green light meaning everything is okay.

But to later send this information somewhere we use
```python=
pybytes.send_signal(1, celsius)
  time.sleep(5)
 
```
that every five second sends whatever output celsius have to the virtual signal 1 in pybytes. 

### Transmitting the data/ Connectivity
The data is sent every five seconds to Pybytes but pybytes prints out every minute not to make the dashboard clustered. In my project i used WIFI because it was the most consistent when i was working on the proejct from home, Inside the foodtruck we can also use wifi by using a hotspot from the cash register. So the board should always have wifi if not that also means we can't take customers. The transport protocol used was MQTTT because i used pybytes 
```python=
pybytes.send_signal(1, celsius)
  time.sleep(5)
```
that uses the MQTT protocol
### Presenting the data

![](https://i.imgur.com/5O8TF9n.png)



In the picture above you can see the data being sent to Pybytes.In my code i have so it sends a signal to Pybytes every fifth second. but is showed in Pybytes every minute to not send unnecessary data. I have made this choice because the temperature will not change much in five second if anything it might go down and back up again and repeat. So we wait and type or data every minute instead.  
I have a linechart of all the temperatures that is "printed out" every minute. 
If i were to choose one second it might be hard to read the data because it would jump all over the place 

## Finalizing the design 
The project have went "okay" had some problems with my USB port on the Lopy4 board so i needed to be very careful and not move it around at all. Except that i first had another project idea that i abandoned because i was unsure about time restraints. But i plan to continue it!
![](https://i.imgur.com/e0Opgx1.jpg)
It is a very simple project but also very helpful for the foodtruck. So the plan for now is to continue working on it and see if we can make the foodtruck more IOT friendly by adding diffrent sensors so we can work not less but smarter!