SimpleResponse

by Niels in Circuits > Raspberry Pi

271 Views, 1 Favorites, 0 Comments

SimpleResponse

questions-pex.jpg

SimpleResponse is a tool to make communication easier with people that sit behind their desk with headphones on.

How does it work? On a website users can log in and then they can send a message to the device that rests on the desk of the person you want to reach. Once the device receives the message, lights will flicker to alert the person. After that the person can respond with a joystick with some quick replies, replies like: “Yes”, ”No”, ”Okay”, ”I’ll be there”.

In the device there also is a temperature sensor and a light sensor. The temperature, the light intensity and the time can be seen on the LCD display.

On the website you are able to see the values of the sensors but you can also control a fan and LEDs. For the fan you can set the temperature that you would like. If it's hotter than the temperature you want, the fan will turn on. You can put the LEDs on and off or you can put it on automatic mode. With automatic mode the LEDs will turn on when it's dark.

On the website you are also able to see the history of some data. You can see the amount of messages that are sent per day and you can check the temperature the last 24 hours, week or all time.

Materials

Picture1.png

I made a block diagram to visualize the main components I needed to make this project work.

For the device you need the following things:

  • Raspberry Pi
  • Actuators;
  • Push button
  • Toggle switch to turn the device off
  • 3 RGB LEDs
  • Sensors:
  • Light Depending Resistor
  • Temperature sensor
  • Joystick
  • 16x2 LCD display

In my github link you can find the detailed Bill Of Materials.

Creating a Database

Capture.PNG

After getting all the materials, I made database in MySQL workbench.

First I made an ERD and then I did a forward engineer to make a database out of the ERD.

The database has 5 tables and the main table is called 'history'. In this table I store all of the data from the sensors, actuators, messages, their actions, date and the value.

I decided to work with users because if you recieve a message you want to know who sent the message. I didn't add a password because its something you would use at home. Also if you want to send a message it would be annoying to constantly type your password instead of just typing your name. So therefore the name of the user cannot be NULL and must be unique.

You can find the database dump in my github.

Making the Circuit

breadboard.PNG

After creating the database and receiving all of the components, I started making the circuit.

The first step was creating a fritzing scheme to visualize what I was going to make. After that I checked if I had all the components I needed and then I recreated the scheme.

The black wires are for ground, the red wires are for 5V and the orange wires are for 3.3V.

In the attachments below you can find the schemes and component list.

Coding the Circuit

code.PNG

After making the circuit, I started coding.

First I made sure I could control all of the components.

After that I started with coding the local device so you could control the components physically without a website.

Then I made the back-end with socket.io and API routes. When the back-end was done I coded the front-end.

You can find the code in my github repository.

Making a Website

website.PNG

After creating the database, I began thinking about the design for my website.

The idea was to create a website that is responsive for mobile and desktop. So I started making the design using Adobe XD.

When I was done, I started recreating the design with HTML and CSS. After making the website, I noticed I needed to make some improvements. So I opened Adobe XD again and made some changes. When I was satisfied with the new design, I changed my HTML and CSS.

The first thing you need to do after connecting to the website is to make an account or log in. After that you land on the home page. This is the page where you can send messages to the raspberry pi and see the previous messages.

Next you have the dashboard page where you can see the temperature and the intensity of the light, but you can also control the LEDs and the 12V fan.

The last page is the history. On this page, you're able to see the amount of messages that are sent per day and the temperature. You can filter on day, week or all time.

You can find the design in my github repository.

Making the Housing

nieuw.jpg
DSC_0004.JPG
DSC_0009.JPG
DSC_0011.JPG
DSC_0015.JPG
DSC_0016.JPG
DSC_0018.JPG
nieuw1.jpg
nieuw2.jpg
nieuw3.jpg
nieuw4.jpg

When the coding was done, I began creating a housing.

The housing I created was made with MDF and a laser cutter.

First I made a simple box on makercase with the following dimensions:

  • Width: 250mm
  • Height: 125mm
  • Depth: 200mm
  • Material thickness: 6mm
  • Edge joint: Finger
  • Finger size: 24

Then I downloaded the box plans as SVG, I opened the SVG in Adobe Illustrator and made some holes for the LCD, a button, the joystick and a hole for the wiring. Later on I had to make 3 extra holes with a drill. One for the shutdown toggle switch, one for the cables for my fan and one for the led in the front.

Later on I put a fly screen over the front of my fan, so that you cannot put your fingers in it.

In the attachments you can find the box plans.