Introduction: NOCAR (Notificación De Carga)

Abstract

We create new technologies and techniques every year. In the past, the steam machine was the first step of something that we named the Industrial Revolution. The human being hasn't lingered since then. We have been creating machines to make our lives easier, and every time now we try to improve the things and processes we have already made.

The modern car was first introduced in 1886. Since then, it has had a big develop on many aspect. From the speed limit, to the weight control, it has been changing and taking many paths. A new technology made the car to require no fossil fuels: the hybrid car. However, this method has more restricted limits. One disadvantage is the time it takes to recharge. It isn't that easy as go to the gas station and fill the tank in a couple of minutes. Some cars need hours to complete the recharge. Many if the gas station are near a recreative zone or shopping zone, however. And it has sense, if it takes longer to fill your battery, it has no point to you to be there the entire time so it gives you the opportunity to go wherever you want on the meantime. However, once the car is charge, if you haven't taken your car out of the charge station, a fine will be imposed on your car. The objective of this product is to solve a normal problem in the future hybrid cars (hybrid cars have a great bet on the table). We implement a circuit system using a Dragonboard 410c. It sends you an email to alert you that the energy charge of your car is up to certain percentage. In this way, you can be doing your activities without having to worry about if your car is still charging up or it is ready (and likely to get a fine). Although here in Mexico this kind of problem doesn’t look to come up, sooner than we expect new systems will take ground over the fossil fuels, and the hybrid cars will take an important role. New laws have been established, and fines are now a fact, not an distant idea.

Image Credit: Clipper Creek: Electric Vehicle Charging Stations

Step 1: Materials

  • DragonBoard 410c
  • Mezzanine for 96Boards
  • Protoboard
  • Jumper wire
  • Push-button
  • Resistor 10 ohm
  • Potenciometer 10k ohm
  • Capacitor 150 pF
  • Chip ADC0804

Step 2: Code

#include <stdio.h>

#include <stdiolib.h>

#include <time.h>

#include "libsoc_gpio.h"

#include "libsoc_debug.h"

#include "libsoc_board.h"

unsigned int GPIO_PIN1;

unsigned int GPIO_PIN2;

unsigned int GPIO_PIN3;

unsigned int GPIO_PIN4;

unsigned int GPIO_TRANSIS;

unsigned int GPIO_SELECT;

unsigned int GPIO_ENTER;

unsigned int GPIO_LEDTEST;

int flag;

int valorBoton;

int valorLEDTest;

int pin1_state=0;

int pin2_state=0;

int pin3_state=0;

int pin4_state=0;

int last_touch_pin1;

int last_touch_p1;

int last_touch_pin2;

int last_touch_p2;

int last_touch_pin3;

int last_touch_p3;

int last_touch_pin4;

int last_touch_p4;

int select_state=0;

int enter_state=0;

int transis_state=0;

int last_touch_b;

int last_touch_l;

int led_state = 0;

int buzzer_state = 0;

int running = 1;

__attribute__((constructor)) static void _init()

{

board_config *config = libsoc_board_init();

GPIO_PIN1 = libsoc_board_gpio_id(config, "GPIO-A");

GPIO_PIN2 = libsoc_board_gpio_id(config, "GPIO-B");

GPIO_PIN3 = libsoc_board_gpio_id(config, "GPIO-C");

GPIO_PIN4 = libsoc_board_gpio_id(config, "GPIO-D");

GPIO_TRANSIS = libsoc_board_gpio_id(config, "GPIO-E");

GPIO_SELECT = libsoc_board_gpio_id(config, "GPIO-G");

GPIO_ENTER = libsoc_board_gpio_id(config, "GPIO-H");

GPIO_LEDTEST = libsoc_board_gpio_id(config, "GPIO-I");

libsoc_board_free(config);

}

int main()

{

gpio *gpio_pin1, *gpio_pin2, *gpio_pin3, *gpio_pin4, *gpio_transis, *gpio_select, *gpio_enter, *gpio_ledtest;

int touch_pin1;

int touch_pin2;

int touch_pin3;

int touch_pin4;

int touch_transis;

int touch_select;

int touch_enter;

int touch_ledtest;

libsoc_set_debug(0);

gpio_pin1 = libsoc_gpio_request(GPIO_PIN1,LS_SHARED);

gpio_pin2 = libsoc_gpio_request(GPIO_PIN2,LS_SHARED);

gpio_pin3 = libsoc_gpio_request(GPIO_PIN3,LS_SHARED);

gpio_pin4 = libsoc_gpio_request(GPIO_PIN4,LS_SHARED);

gpio_transis = libsoc_gpio_request(GPIO_TRANSIS,LS_SHARED);

gpio_select = libsoc_gpio_request(GPIO_SELECT,LS_SHARED);

gpio_enter = libsoc_gpio_request(GPIO_ENTER,LS_SHARED);

gpio_ledtest = libsoc_gpio_request(GPIO_LEDTEST,LS_SHARED);

if((gpio_pin1 == NULL) || (gpio_pin2 == NULL) || (gpio_pin3 == NULL) || (gpio_pin4 == NULL) || (gpio_transis == NULL) || (gpio_select == NULL) || (gpio_enter == NULL) || (gpio_ledtest == NULL))

{

goto fail;

}

libsoc_gpio_set_direction(gpio_pin1, INPUT);

libsoc_gpio_set_direction(gpio_pin2, INPUT);

libsoc_gpio_set_direction(gpio_pin3, INPUT);

libsoc_gpio_set_direction(gpio_pin4, INPUT);

libsoc_gpio_set_direction(gpio_transis, INPUT);

libsoc_gpio_set_direction(gpio_select, INPUT);

libsoc_gpio_set_direction(gpio_enter, INPUT);

libsoc_gpio_set_direction(gpio_ledtest, OUTPUT);

if((libsoc_gpio_get_direction(gpio_pin1) != INPUT)

|| (libsoc_gpio_get_direction(gpio_pin2) != INPUT) || (libsoc_gpio_get_direction(gpio_pin3) != INPUT) || (libsoc_gpio_get_direction(gpio_pin4) != INPUT)

|| (libsoc_gpio_get_direction(gpio_transis) != INPUT) || (libsoc_gpio_get_direction(gpio_select) != INPUT) || (libsoc_gpio_get_direction(gpio_enter) != INPUT) || (libsoc_gpio_get_direction(gpio_ledtest) != OUTPUT))

{

goto fail;

}

while(running)

{

touch_pin1 = libsoc_gpio_get_level(gpio_pin1);

touch_pin2 = libsoc_gpio_get_level(gpio_pin2);

touch_pin3 = libsoc_gpio_get_level(gpio_pin3);

touch_pin4 = libsoc_gpio_get_level(gpio_pin4);

touch_enter = libsoc_gpio_get_level(gpio_enter);

touch_select = libsoc_gpio_get_level(gpio_select);

touch_transis = libsoc_gpio_get_level(gpio_transis);

touch_ledtest = libsoc_gpio_get_level(gpio_ledtest);

if(touch_select == 1)

{

valorBoton++;

if(valorBoton==4)

{

valorBoton=0;

}

}

if(valorBoton==3)

{

valorLEDTest=1;

libsoc_gpio_set_level(gpio_ledtest,valorLEDTest);

}

}

fail: if(gpio_pin1 || gpio_pin2 || gpio_pin3 || gpio_pin4 || gpio_transis || gpio_select || gpio_enter || gpio_ledtest)

{

printf("apply gpio resource fail!\n");

libsoc_gpio_free(gpio_pin1);

libsoc_gpio_free(gpio_pin2);

libsoc_gpio_free(gpio_pin3);

libsoc_gpio_free(gpio_pin4);

libsoc_gpio_free(gpio_transis);

libsoc_gpio_free(gpio_select);

libsoc_gpio_free(gpio_enter);

libsoc_gpio_free(gpio_ledtest);

}

return EXIT_SUCCESS;

}

Step 3: Electric Circuit

This circuit works as a analog-to-digital converter. It takes the signal of a potenciometer that comes in a value between 0 and 5 volts, then the converter makes it into a digital signal between 0 and 255 bits and sends it to the DragonBoard INPUTS.

Step 4:

Developed by:

Alfredo Fontes

Mauricio Gómez

Jorge Jiménez

Gerardo Lopéz

Felipe Rojas

Luis Rojas

Ivón Sandoval

Step 5:

Comments

author
DIY Hacks and How Tos (author)2017-02-26

Welcome to Instructables. Thanks for sharing the cool project. I hope you will post more in the future.

About This Instructable

15views

0favorites

License:

Bio: I think I think too much.
More by JorgeLJimenezA:NOCAR (Notificación De Carga)
Add instructable to: